Skip to content

Commit c8b0dcb

Browse files
rubennortefacebook-github-bot
authored andcommitted
Expose renderer through unstable internals
Summary: Expose the renderer proxy as `Renderer` from `react-native/unstable-internals-do-not-use`. Generated Codegen modules can be emitted into consumer packages and need a package entry point for dispatching renderer commands without deep imports. Changelog: [Internal] Differential Revision: D120991150
1 parent 9da1bac commit c8b0dcb

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎packages/react-native/src/unstable-internals-do-not-use.d.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,9 @@ interface PressabilityDebugViewProps {
212212
export const PressabilityDebugView: React.ComponentType<PressabilityDebugViewProps>;
213213

214214
// #endregion
215+
// #region Renderer
216+
217+
/** Renderer APIs used by generated Codegen modules. */
218+
export * as Renderer from '../types_generated/Libraries/ReactNative/RendererImplementation';
219+
220+
// #endregion

‎packages/react-native/src/unstable-internals-do-not-use.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import typeof NativeRedBox from '../Libraries/NativeModules/specs/NativeRedBox';
4747
import typeof NativeSourceCode from '../Libraries/NativeModules/specs/NativeSourceCode';
4848
import typeof {PressabilityDebugView} from '../Libraries/Pressability/PressabilityDebug';
4949
import typeof AppContainer from '../Libraries/ReactNative/AppContainer';
50+
import typeof * as Renderer from '../Libraries/ReactNative/RendererProxy';
5051
import typeof {customDirectEventTypes} from '../Libraries/Renderer/shims/ReactNativeViewConfigRegistry';
5152
import typeof DevLoadingView from '../Libraries/Utilities/DevLoadingView';
5253
import typeof HMRClient from '../Libraries/Utilities/HMRClient';
@@ -86,4 +87,9 @@ module.exports = {
8687
return require('../Libraries/Pressability/PressabilityDebug')
8788
.PressabilityDebugView;
8889
},
90+
// Generated Codegen modules can be emitted outside this package, so they
91+
// cannot use package-relative imports to access the renderer.
92+
get Renderer(): Renderer {
93+
return require('../Libraries/ReactNative/RendererProxy');
94+
},
8995
};

‎packages/react-native/src/unstable-internals-do-not-use.js.flow‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ export {default as NativeExceptionsManager} from '../Libraries/Core/NativeExcept
2424
export {default as NativeRedBox} from '../Libraries/NativeModules/specs/NativeRedBox';
2525
export {default as NativeSourceCode} from '../Libraries/NativeModules/specs/NativeSourceCode';
2626
export {PressabilityDebugView} from '../Libraries/Pressability/PressabilityDebug';
27+
export * as Renderer from '../Libraries/ReactNative/RendererProxy';

0 commit comments

Comments
 (0)