Skip to content

Commit

Permalink
Build react-dom in builds/facebook-fbsource (#30711)
Browse files Browse the repository at this point in the history
## Summary

Builds `react-dom` for React Native so that it also populates the
`builds/facebook-fbsource` branch.

**NOTE:** For Meta employees, D61354219 is the internal integration.

## How did you test this change?

```
$ yarn build
…
$ ls build/facebook-react-native/react-dom/cjs
ReactDOM-dev.js       ReactDOM-prod.js      ReactDOM-profiling.js
```
  • Loading branch information
yungsters authored Sep 18, 2024
1 parent 09d8283 commit e72127a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/runtime_commit_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ jobs:
mv build/react-native/shims/ $BASE_FOLDER/react-native-github/Libraries/Renderer/
mv build/facebook-react-native/scheduler/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/scheduler/
mv build/facebook-react-native/react/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/react/
mv build/facebook-react-native/react/dom/ $BASE_FOLDER/RKJSModules/vendor/react/react-dom/
mv build/facebook-react-native/react-is/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/react-is/
mv build/facebook-react-native/react-test-renderer/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/react-test-renderer/
Expand Down
48 changes: 47 additions & 1 deletion scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const bundles = [
wrapWithModuleBoundaries: true,
externals: ['react'],
},

/******* React DOM Client *******/
{
bundleTypes: [NODE_DEV, NODE_PROD],
Expand All @@ -204,7 +205,8 @@ const bundles = [
wrapWithModuleBoundaries: true,
externals: ['react', 'react-dom'],
},
/******* React DOM FB *******/

/******* React DOM (www) *******/
{
bundleTypes: [FB_WWW_DEV, FB_WWW_PROD, FB_WWW_PROFILING],
moduleType: RENDERER,
Expand All @@ -215,6 +217,50 @@ const bundles = [
externals: ['react'],
},

/******* React DOM (fbsource) *******/
{
bundleTypes: [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING],
moduleType: RENDERER,
entry: 'react-dom',
global: 'ReactDOM',
minifyWithProdErrorCodes: true,
wrapWithModuleBoundaries: false,
externals: ['react', 'ReactNativeInternalFeatureFlags'],
},

/******* React DOM Client (fbsource) *******/
{
bundleTypes: [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING],
moduleType: RENDERER,
entry: 'react-dom/client',
global: 'ReactDOMClient',
minifyWithProdErrorCodes: true,
wrapWithModuleBoundaries: false,
externals: ['react', 'react-dom', 'ReactNativeInternalFeatureFlags'],
},

/******* React DOM Profiling (fbsource) *******/
{
bundleTypes: [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING],
moduleType: RENDERER,
entry: 'react-dom/profiling',
global: 'ReactDOMProfiling',
minifyWithProdErrorCodes: true,
wrapWithModuleBoundaries: true,
externals: ['react', 'react-dom', 'ReactNativeInternalFeatureFlags'],
},

/******* React DOM Test Utils (fbsource) *******/
{
moduleType: RENDERER_UTILS,
bundleTypes: [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING],
entry: 'react-dom/test-utils',
global: 'ReactDOMTestUtils',
minifyWithProdErrorCodes: false,
wrapWithModuleBoundaries: false,
externals: ['react', 'react-dom', 'ReactNativeInternalFeatureFlags'],
},

/******* React DOM React Server *******/
{
bundleTypes: [NODE_DEV, NODE_PROD],
Expand Down
1 change: 1 addition & 0 deletions scripts/rollup/packaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function getBundleOutputPath(bundle, bundleType, filename, packageName) {
switch (packageName) {
case 'scheduler':
case 'react':
case 'react-dom':
case 'react-is':
case 'react-test-renderer':
return `build/facebook-react-native/${packageName}/cjs/${filename}`;
Expand Down

0 comments on commit e72127a

Please sign in to comment.