Skip to content

fix(web): remove private react-native imports in Fusebox DevTools bootstrap - #399

Merged
V3RON merged 1 commit into
mainfrom
fix/web-devtools-private-api
Aug 13, 2026
Merged

fix(web): remove private react-native imports in Fusebox DevTools bootstrap#399
V3RON merged 1 commit into
mainfrom
fix/web-devtools-private-api

Conversation

@V3RON

@V3RON V3RON commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

@rozenite/web's React DevTools Fusebox bootstrap imported three private React Native modules — react-native/src/private/devsupport/rndevtools/setUpFuseboxReactDevToolsDispatcher, react-native/Libraries/Components/View/ReactNativeStyleAttributes, and react-native/Libraries/StyleSheet/flattenStyle. These deep import paths resolve to null under React Native's Strict TypeScript API, which breaks module resolution for apps that opt into it.

This PR vendors local equivalents instead, each with a link back to the exact upstream source it was copied/derived from.

Related Issue

Closes #397

Context

  • fuseboxReactDevToolsDispatcher.tssetUpFuseboxReactDevToolsDispatcher.js is fully self-contained (no further RN-internal imports), so it's vendored near-verbatim (Flow → TS). Added one improvement over upstream: the Object.defineProperty call is now guarded to no-op if the global is already defined, instead of unconditionally throwing on a non-configurable redefinition.
  • flattenStyle.tsflattenStyle.js is also fully self-contained (a pure recursive array-flattening function), vendored near-verbatim.
  • nativeStyleEditorValidAttributes.tsReactNativeStyleAttributes.js pulls in 11 other private Libraries/StyleSheet/process* modules plus the private feature-flags module to build a table of {process, diff} value objects per style attribute. But fuseboxConnection.ts only ever calls Object.keys(ReactNativeStyleAttributes) — the value objects (and everything they depend on) are never read. So instead of vendoring the whole table, this vendors just the list of the same 150 attribute names (verified 1:1 against the upstream key list), which needed no further private imports at all.
  • fuseboxConnection.ts and devtools.ts updated accordingly: ReactNativeStyleAttributes deps/param renamed to nativeStyleEditorValidAttributes: string[], with the Object.keys(...) call removed from fuseboxConnection.ts since the caller now passes the name list directly.

Testing

  • pnpm --filter @rozenite/web typecheck (both tsconfig.lib.json and tsconfig.react-native.json)
  • pnpm --filter @rozenite/web lint
  • pnpm vitest --run packages/web — 12 tests passed

…tstrap

Vendors setUpFuseboxReactDevToolsDispatcher and flattenStyle locally (both
fully self-contained), and replaces the ReactNativeStyleAttributes import
with just the list of attribute names it's actually used for
(Object.keys(...) in fuseboxConnection.ts), avoiding the private
process*/featureflags modules that table pulls in. Avoids breakage under
React Native's Strict TypeScript API, which blocks deep imports into
Libraries/* and src/private/*.

Claude-Session: https://claude.ai/code/session_01JaNGs52mExzVBMFbjLgWgo
@V3RON
V3RON merged commit e179e49 into main Aug 13, 2026
4 checks passed
@V3RON
V3RON deleted the fix/web-devtools-private-api branch August 13, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(web): remove private react-native imports in Fusebox DevTools bootstrap

1 participant