main
js 74 lines 3.68 KB
Raw
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 export const CHROME_WEBSTORE_EXTENSION_ID = 'fmkadmapgofadopljbjfkapdkoienihi';
11 export const INTERNAL_EXTENSION_ID = 'dnjnjgbfilfphmojnmhliehogmojhclc';
12 export const LOCAL_EXTENSION_ID = 'ikiahnapldjmdmpkmfhjdjilojjhgcbf';
13
14 // Flip this flag to true to enable verbose console debug logging.
15 export const __DEBUG__ = false;
16
17 // Flip this flag to true to enable performance.mark() and performance.measure() timings.
18 export const __PERFORMANCE_PROFILE__ = false;
19
20 export const TREE_OPERATION_ADD = 1;
21 export const TREE_OPERATION_REMOVE = 2;
22 export const TREE_OPERATION_REORDER_CHILDREN = 3;
23 export const TREE_OPERATION_UPDATE_TREE_BASE_DURATION = 4;
24 export const TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS = 5;
25 // Removed `TREE_OPERATION_REMOVE_ROOT`
26 export const TREE_OPERATION_SET_SUBTREE_MODE = 7;
27 export const SUSPENSE_TREE_OPERATION_ADD = 8;
28 export const SUSPENSE_TREE_OPERATION_REMOVE = 9;
29 export const SUSPENSE_TREE_OPERATION_REORDER_CHILDREN = 10;
30 export const SUSPENSE_TREE_OPERATION_RESIZE = 11;
31 export const SUSPENSE_TREE_OPERATION_SUSPENDERS = 12;
32 export const TREE_OPERATION_APPLIED_ACTIVITY_SLICE_CHANGE = 13;
33
34 export const PROFILING_FLAG_BASIC_SUPPORT /*. */ = 0b001;
35 // Bit 0b010 is retired: it flagged support for the removed Timeline profiler.
36 // Older backends still set it, so it must never be reused for a new flag.
37 export const PROFILING_FLAG_PERFORMANCE_TRACKS_SUPPORT /* */ = 0b100;
38
39 export const UNKNOWN_SUSPENDERS_NONE: UnknownSuspendersReason = 0; // If we had at least one debugInfo, then that might have been the reason.
40 export const UNKNOWN_SUSPENDERS_REASON_PRODUCTION: UnknownSuspendersReason = 1; // We're running in prod. That might be why we had unknown suspenders.
41 export const UNKNOWN_SUSPENDERS_REASON_OLD_VERSION: UnknownSuspendersReason = 2; // We're running an old version of React that doesn't have full coverage. That might be the reason.
42 export const UNKNOWN_SUSPENDERS_REASON_THROWN_PROMISE: UnknownSuspendersReason = 3; // If we're in dev, didn't detect and debug info and still suspended (other than CSS/image) the only reason is thrown promise.
43
44 export opaque type UnknownSuspendersReason = 0 | 1 | 2 | 3;
45
46 export const LOCAL_STORAGE_DEFAULT_TAB_KEY = 'React::DevTools::defaultTab';
47 export const LOCAL_STORAGE_COMPONENT_FILTER_PREFERENCES_KEY =
48 'React::DevTools::componentFilters';
49 export const SESSION_STORAGE_LAST_SELECTION_KEY =
50 'React::DevTools::lastSelection';
51 export const LOCAL_STORAGE_OPEN_IN_EDITOR_URL =
52 'React::DevTools::openInEditorUrl';
53 export const LOCAL_STORAGE_OPEN_IN_EDITOR_URL_PRESET =
54 'React::DevTools::openInEditorUrlPreset';
55 export const LOCAL_STORAGE_ALWAYS_OPEN_IN_EDITOR =
56 'React::DevTools::alwaysOpenInEditor';
57 export const LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY =
58 'React::DevTools::parseHookNames';
59 export const SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY =
60 'React::DevTools::recordChangeDescriptions';
61 export const SESSION_STORAGE_RELOAD_AND_PROFILE_KEY =
62 'React::DevTools::reloadAndProfile';
63 export const LOCAL_STORAGE_BROWSER_THEME = 'React::DevTools::theme';
64 export const LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY =
65 'React::DevTools::traceUpdatesEnabled';
66 export const LOCAL_STORAGE_SUPPORTS_PROFILING_KEY =
67 'React::DevTools::supportsProfiling';
68
69 export const PROFILER_EXPORT_VERSION = 5;
70
71 export const FIREFOX_CONSOLE_DIMMING_COLOR = 'color: rgba(124, 124, 124, 0.75)';
72 export const ANSI_STYLE_DIMMING_TEMPLATE = '\x1b[2;38;2;124;124;124m%s\x1b[0m';
73 export const ANSI_STYLE_DIMMING_TEMPLATE_WITH_COMPONENT_STACK =
74 '\x1b[2;38;2;124;124;124m%s %o\x1b[0m';