Skip to content

Commit

Permalink
we no longer need getModulesRunBeforeMainModule
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 committed Aug 9, 2023
1 parent d1c75b6 commit 02c7c5d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
12 changes: 0 additions & 12 deletions incubator/@react-native-webapis/battery-status/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,6 @@ index 69ebd557..a012b7f5 100644
],
},
],
diff --git a/packages/test-app/metro.config.js b/packages/test-app/metro.config.js
index 7c0dcfc2..df0f8b0d 100644
--- a/packages/test-app/metro.config.js
+++ b/packages/test-app/metro.config.js
@@ -33,4 +33,7 @@ module.exports = makeMetroConfig({
blacklistRE: blockList,
blockList,
},
+ serializer: {
+ getModulesRunBeforeMainModule: require("@rnx-kit/polyfills").default,
+ },
});
diff --git a/packages/test-app/src/App.native.tsx b/packages/test-app/src/App.native.tsx
index 599634a9..a9b493ab 100644
--- a/packages/test-app/src/App.native.tsx
Expand Down
16 changes: 1 addition & 15 deletions incubator/polyfills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,7 @@ npm add --save-dev @rnx-kit/polyfills
};
```

2. Configure Metro to use a custom `getModulesRunBeforeMainModule`:

```diff
// metro.config.js
const { makeMetroConfig } = require("@rnx-kit/metro-config");
const { getPreludeModules } = require("@rnx-kit/polyfills");

module.exports = makeMetroConfig({
+ serializer: {
+ getModulesRunBeforeMainModule: getPreludeModules,
+ },
});
```

3. In your `index.js` (or `index.ts`), add the following comment:
2. In your `index.js` (or `index.ts`), add the following comment:

```
// @react-native-webapis
Expand Down

0 comments on commit 02c7c5d

Please sign in to comment.