| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * |
| 7 | * @flow |
| 8 | */ |
| 9 | |
| 10 | // This list should be kept updated to reflect additions to 'shared/ReactSymbols'. |
| 11 | // DevTools can't import symbols from 'shared/ReactSymbols' directly for two reasons: |
| 12 | // 1. DevTools requires symbols which may have been deleted in more recent versions (e.g. concurrent mode) |
| 13 | // 2. DevTools must support both Symbol and numeric forms of each symbol; |
| 14 | // Since e.g. standalone DevTools runs in a separate process, it can't rely on its own ES capabilities. |
| 15 | |
| 16 | export const CONCURRENT_MODE_NUMBER = 0xeacf; |
| 17 | export const CONCURRENT_MODE_SYMBOL_STRING = 'Symbol(react.concurrent_mode)'; |
| 18 | |
| 19 | export const CONTEXT_NUMBER = 0xeace; |
| 20 | export const CONTEXT_SYMBOL_STRING = 'Symbol(react.context)'; |
| 21 | |
| 22 | export const SERVER_CONTEXT_SYMBOL_STRING = 'Symbol(react.server_context)'; |
| 23 | |
| 24 | export const DEPRECATED_ASYNC_MODE_SYMBOL_STRING = 'Symbol(react.async_mode)'; |
| 25 | |
| 26 | export const ELEMENT_SYMBOL_STRING = 'Symbol(react.transitional.element)'; |
| 27 | export const LEGACY_ELEMENT_NUMBER = 0xeac7; |
| 28 | export const LEGACY_ELEMENT_SYMBOL_STRING = 'Symbol(react.element)'; |
| 29 | |
| 30 | export const DEBUG_TRACING_MODE_NUMBER = 0xeae1; |
| 31 | export const DEBUG_TRACING_MODE_SYMBOL_STRING = |
| 32 | 'Symbol(react.debug_trace_mode)'; |
| 33 | |
| 34 | export const FORWARD_REF_NUMBER = 0xead0; |
| 35 | export const FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)'; |
| 36 | |
| 37 | export const FRAGMENT_NUMBER = 0xeacb; |
| 38 | export const FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)'; |
| 39 | |
| 40 | export const LAZY_NUMBER = 0xead4; |
| 41 | export const LAZY_SYMBOL_STRING = 'Symbol(react.lazy)'; |
| 42 | |
| 43 | export const MEMO_NUMBER = 0xead3; |
| 44 | export const MEMO_SYMBOL_STRING = 'Symbol(react.memo)'; |
| 45 | |
| 46 | export const PORTAL_NUMBER = 0xeaca; |
| 47 | export const PORTAL_SYMBOL_STRING = 'Symbol(react.portal)'; |
| 48 | |
| 49 | export const PROFILER_NUMBER = 0xead2; |
| 50 | export const PROFILER_SYMBOL_STRING = 'Symbol(react.profiler)'; |
| 51 | |
| 52 | export const PROVIDER_NUMBER = 0xeacd; |
| 53 | export const PROVIDER_SYMBOL_STRING = 'Symbol(react.provider)'; |
| 54 | |
| 55 | export const CONSUMER_SYMBOL_STRING = 'Symbol(react.consumer)'; |
| 56 | |
| 57 | export const SCOPE_NUMBER = 0xead7; |
| 58 | export const SCOPE_SYMBOL_STRING = 'Symbol(react.scope)'; |
| 59 | |
| 60 | export const STRICT_MODE_NUMBER = 0xeacc; |
| 61 | export const STRICT_MODE_SYMBOL_STRING = 'Symbol(react.strict_mode)'; |
| 62 | |
| 63 | export const SUSPENSE_NUMBER = 0xead1; |
| 64 | export const SUSPENSE_SYMBOL_STRING = 'Symbol(react.suspense)'; |
| 65 | |
| 66 | export const SUSPENSE_LIST_NUMBER = 0xead8; |
| 67 | export const SUSPENSE_LIST_SYMBOL_STRING = 'Symbol(react.suspense_list)'; |
| 68 | |
| 69 | export const SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED_SYMBOL_STRING = |
| 70 | 'Symbol(react.server_context.defaultValue)'; |
| 71 | |
| 72 | export const REACT_MEMO_CACHE_SENTINEL: symbol = Symbol.for( |
| 73 | 'react.memo_cache_sentinel', |
| 74 | ); |
| 75 | |
| 76 | import type {ReactOptimisticKey} from 'shared/ReactTypes'; |
| 77 | |
| 78 | export const REACT_OPTIMISTIC_KEY: ReactOptimisticKey = Symbol.for( |
| 79 | 'react.optimistic_key', |
| 80 | ) as any; |