bridge.js — react Source File
Architecture documentation for bridge.js, a javascript file in the react codebase. 4 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR 90c55265_8c71_a702_1208_8bdd01b6c4ae["bridge.js"] 141645a3_e6e3_7211_4514_81e079648b8c["events.js"] 90c55265_8c71_a702_1208_8bdd01b6c4ae --> 141645a3_e6e3_7211_4514_81e079648b8c 501f1668_e338_41a4_686c_5b2aee4863b8["types.js"] 90c55265_8c71_a702_1208_8bdd01b6c4ae --> 501f1668_e338_41a4_686c_5b2aee4863b8 40bf6909_04ae_bfb6_965f_14cfe98b94de["types"] 90c55265_8c71_a702_1208_8bdd01b6c4ae --> 40bf6909_04ae_bfb6_965f_14cfe98b94de 5fdaa481_4541_9cb7_b7d3_998d81934aa0["types"] 90c55265_8c71_a702_1208_8bdd01b6c4ae --> 5fdaa481_4541_9cb7_b7d3_998d81934aa0 c590b2f8_e784_4482_1344_3166beeda587["SettingsModalContext.js"] c590b2f8_e784_4482_1344_3166beeda587 --> 90c55265_8c71_a702_1208_8bdd01b6c4ae style 90c55265_8c71_a702_1208_8bdd01b6c4ae fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
import EventEmitter from './events';
import type {ComponentFilter, Wall} from './frontend/types';
import type {
InspectedElementPayload,
OwnersList,
ProfilingDataBackend,
RendererID,
DevToolsHookSettings,
ProfilingSettings,
} from 'react-devtools-shared/src/backend/types';
import type {StyleAndLayout as StyleAndLayoutPayload} from 'react-devtools-shared/src/backend/NativeStyleEditor/types';
// This message specifies the version of the DevTools protocol currently supported by the backend,
// as well as the earliest NPM version (e.g. "4.13.0") that protocol is supported by on the frontend.
// This enables an older frontend to display an upgrade message to users for a newer, unsupported backend.
export type BridgeProtocol = {
// Version supported by the current frontend/backend.
version: number,
// NPM version range of `react-devtools-inline` that also supports this version.
// Note that 'maxNpmVersion' is only set when the version is bumped.
minNpmVersion: string,
maxNpmVersion: string | null,
};
// Bump protocol version whenever a backwards breaking change is made
// in the messages sent between BackendBridge and FrontendBridge.
// This mapping is embedded in both frontend and backend builds.
//
// The backend protocol will always be the latest entry in the BRIDGE_PROTOCOL array.
//
// When an older frontend connects to a newer backend,
// the backend can send the minNpmVersion and the frontend can display an NPM upgrade prompt.
//
// When a newer frontend connects with an older protocol version,
// the frontend can use the embedded minNpmVersion/maxNpmVersion values to display a downgrade prompt.
export const BRIDGE_PROTOCOL: Array<BridgeProtocol> = [
// This version technically never existed,
// but a backwards breaking change was added in 4.11,
// so the safest guess to downgrade the frontend would be to version 4.10.
{
version: 0,
minNpmVersion: '"<4.11.0"',
maxNpmVersion: '"<4.11.0"',
},
// Versions 4.11.x – 4.12.x contained the backwards breaking change,
// but we didn't add the "fix" of checking the protocol version until 4.13,
// so we don't recommend downgrading to 4.11 or 4.12.
{
version: 1,
// ... (427 more lines)
Domain
Subdomains
Functions
Source
Frequently Asked Questions
What does bridge.js do?
bridge.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in bridge.js?
bridge.js defines 2 function(s): addListener, emit.
What does bridge.js depend on?
bridge.js imports 4 module(s): events.js, types, types, types.js.
What files import bridge.js?
bridge.js is imported by 1 file(s): SettingsModalContext.js.
Where is bridge.js in the architecture?
bridge.js is located at packages/react-devtools-shared/src/bridge.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free