1 line
13 KiB
JSON
1 line
13 KiB
JSON
|
{"ast":null,"code":"/** @license React v0.18.0\n * scheduler-tracing.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function () {\n 'use strict';\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n }); // Helps identify side effects in render-phase lifecycle hooks and setState\n // reducers by double invoking them in Strict Mode.\n // To preserve the \"Pause on caught exceptions\" behavior of the debugger, we\n // replay the begin phase of a failed component inside invokeGuardedCallback.\n // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:\n // Gather advanced timing metrics for Profiler subtrees.\n // Trace which interactions trigger each commit.\n\n var enableSchedulerTracing = true; // SSR experiments\n // Only used in www builds.\n // Only used in www builds.\n // Disable javascript: URL strings in href for XSS protection.\n // React Fire: prevent the value and checked attributes from syncing\n // with their related DOM properties\n // These APIs will no longer be \"unstable\" in the upcoming 16.7 release,\n // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.\n // Experimental React Flare event system and event components support.\n // Experimental Host Component support.\n // Experimental Scope support.\n // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107\n // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)\n // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version\n // For tests, we flush suspense fallbacks in an act scope;\n // *except* in some of our own tests, where we test incremental loading states.\n // Add a callback property to suspense to notify which promises are currently\n // in the update queue. This allows reporting and tracing of what is causing\n // the user to see a loading state.\n // Also allows hydration callbacks to fire when a dehydrated boundary gets\n // hydrated or deleted.\n // Part of the simplification of React.createElement so we can eventually move\n // from React.createElement to React.jsx\n // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md\n // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance\n\n var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.\n\n var interactionIDCounter = 0;\n var threadIDCounter = 0; // Set of currently traced interactions.\n // Interactions \"stack\"–\n // Meaning that newly traced interactions are appended to the previously active set.\n // When an interaction goes out of scope, the previous set (if any) is restored.\n\n exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.\n\n exports.__subscriberRef = null;\n\n if (enableSchedulerTracing) {\n exports.__interactionsRef = {\n current: new Set()\n };\n exports.__subscriberRef = {\n current: null\n };\n }\n\n function unstable_clear(callback) {\n if (!enableSchedulerTracing) {\n return callback();\n }\n\n var prevInteractions = exports.__interactionsRef.current;\n exports.__interactionsRef.current = new Set();\n\n try {\n return callback();\n } finally {\n exports.__interactionsRef.current = prevInteractions;\n }\n }\n\n function unstable_getCurrent() {\n if (!enableSchedulerTracing) {\n return null;\n } else {\n return exports.__interactionsRef.current;\n }\n }\n\n function unstable_getThreadID() {\n return ++threadIDCounter;\n }\n\n function unstable_trace(name, timestamp, c
|