Skip to content

Sync fork with chromium/7827#261

Draft
huntie wants to merge 5813 commits into
react:mainfrom
huntie:repo-sync
Draft

Sync fork with chromium/7827#261
huntie wants to merge 5813 commits into
react:mainfrom
huntie:repo-sync

Conversation

@huntie
Copy link
Copy Markdown
Member

@huntie huntie commented Jun 4, 2026

Summary

Syncs the react-native-devtools-frontend fork with the upstream chromium/7827 branch (most recent stable from https://chromiumdash.appspot.com/branches).

There were a total of ~171 conflicts. The ~80 translated core/i18n/locales/*.json files were taken from upstream (generated artifacts, no RN strings). The remaining source conflicts were resolved as below.

Notable resolutions

Experiments (ExperimentName refactor)

  • Upstream moved ExperimentName from core/root/Runtime.ts into a new core/root/ExperimentNames.ts. We re-export it from Runtime.ts so the fork's pervasive Root.Runtime.ExperimentName.* references keep resolving, add the React Native experiments to ExperimentNames.ts, and register them for tests in upstream's new testing/RuntimeHelpers.ts. RNExperimentName/ConditionName stay in Runtime.ts.

Rollup build (⚠️ build-strategy change)

  • Upstream replaced the fork's cross-platform @rollup/wasm-node with native rollup, with platform binaries synced from cipd (infra/3pp/tools/rollup_libs) via a new DEPS entry + sync_rollup_libs gclient hook. Adopted the upstream native-rollup approach (per maintainer decision). gclient sync provides the binaries.

rehydrated_devtools_app entrypoint (⚠️ restored)

  • Upstream removed entrypoints/rehydrated_devtools_app/ in favour of its new trace_app. The RN debugger opens rehydrated_devtools_app.html by name, so the entrypoint was restored (kept alongside upstream's trace_app). The rehydrating connection accepts both via isTraceApp() || getPathName().includes('rehydrated_devtools_app').

Content Security Policy

  • Kept the fork's permissive single-line CSP with 'unsafe-eval' (required by the React DevTools panels and consumed by the rn_fusebox worker-src injection in generate_html_entrypoint.js), reverting upstream's stricter multi-line CSP — consistent with prior syncs.

Connection layer

  • Adopted upstream's ConnectionConnectionTransport / WebSocketConnectionWebSocketTransport / RehydratingConnectionRehydratingConnectionTransport renames and the new TraceObject-based hydration flow, while preserving the fork's richer connectionLostDetails ({reason, code, errorType}) callback used by RemoteDebuggingTerminatedScreen and the hosted-mode WebSocket URL handling.

Removed/renamed upstream APIs (re-applied in RN files)

  • UI.XLink / <x-link> removed → <devtools-link> (UI kit); UIUtils.createInlineButton removed → inlined; i18n.getFormatLocalizedStringui/i18n; SimpleView/VBox options-object constructors; Trace.Handlers.Types.ParsedTraceTrace.TraceModel.ParsedTrace (handler data now under .data); *.css.js imports are branded CSSInJS strings (dropped .cssText); getRegisteredViewExtensions is now a ViewManager instance method; UserMetrics.panelShownInLocation removed upstream (no callers).

Other necessary changes

  • Exported the RNPerfMetrics class (TypeScript 6.0 TS4094 on the re-exported singleton).
  • Converted the fork's check-license-header ESLint rule to ESM (the rules dir is now ESM).
  • Added missing BUILD.gn deps (ui/components/adorners, ui/components/icon_button, ui/kit) and a dropped Root import in NetworkLogView.ts; converted lantern metric test it() callbacks to function() so this is the Mocha context.
  • Dropped the fork's nanoid/serialize-javascript/ws dependency overrides (superseded by upstream's newer tree).
  • Exempted the RN components from upstream's new no-lit-render-outside-of-view / no-imperative-dom-api / no-adopted-style-sheets lint rules pending a proper view-function migration.
  • Accepted upstream's deletion of UserActionRow.test.ts, application/components/StackTrace.ts, elements/components/LayoutPane.ts, and e2e/issues/client-hint-issues_test.ts (fork changes there were incidental formatting / a disabled test).

Post-merge regression fixes (panel audit)

  • Window title no longer updated liveentrypoints/rn_fusebox/rn_fusebox.ts: upstream's new DevToolsContext holds the TargetManager singleton, and MainImpl swaps the global context in during bootstrap. FuseboxAppMetadataObserver/FuseboxFeatureObserver constructed during entrypoint eval therefore bound to an orphaned TargetManager and never observed the ReactNativeApplication model. Construct them inside a registerEarlyInitializationRunnable so they attach to the live TargetManager — and, being registered synchronously, before InspectorMain creates the main target.
  • Performance panel crash (Cannot find registered action with ID 'timeline.record-reload') — panels/timeline/TimelinePanel.ts: resolve isNode/isReactNative before constructing the panel and set recordReloadAction = null for React Native, where the reload action is intentionally not registered.
  • Protocol Monitor experiment no longer revealed its tabentrypoints/main/MainImpl.ts: upstream gated Protocol Monitor behind a Chromium-flag registerHostExperiment; restored it as a regular UI-toggleable experiments.register so enabling it shows the panel.
  • Duplicate [FB-only] Network banner in the empty-list state — panels/network/NetworkLogView.ts: keep the single persistent banner added in the constructor; drop the duplicate prepended in showRecordingHint.
  • Performance landing-page CTA wrapping onto multiple linespanels/timeline/ReactNativeTimelineLandingPage.ts: re-inline the record-button styling lost when upstream removed UIUtils.createInlineButton, so the button renders inline within the sentence.

Test plan

  • Build passesnpm run prebuild && npm run build (gn gen + ninja + tsc) completes cleanly; rn_fusebox.html, rehydrated_devtools_app.html, and inspector.html entrypoints generate, with the expected rn_fusebox CSP ('unsafe-eval' + worker-src 'self' blob:).
  • Lint passesnpm run lint -- --fix=false on the changed files reports no problems.

Smoke test on rn_fusebox.html (to complete before merge) — using the plan from #172:

  • Console
  • Sources
  • Performance
  • Memory (Heap snapshot, Allocation timeline)
  • React Components
  • React Profiler

Upstreaming plan

  • This commit should be sent as a patch to the upstream devtools-frontend repo.
  • This commit is React Native-specific and cannot be upstreamed.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.