Skip to content

Commit bf4a1c1

Browse files
authored
feat: remove expo metro config and --expo command (#65)
* Remove Expo 36 test app * remove expo-metro.config and --expo command * update docs * bump version
1 parent ec59236 commit bf4a1c1

31 files changed

+25
-9752
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ Make sure [npx](https://github.com/npm/npx) is installed and run the following c
1616

1717
`npx react-native-bundle-visualizer`
1818

19-
And when using Expo SDK 40 or lower. Learn more: [Expo extensions](http://expo.fyi/expo-extension-migration).
20-
21-
`npx react-native-bundle-visualizer --expo managed`
22-
2319
### Or install as a dev-dependency
2420

2521
```sh
@@ -45,7 +41,6 @@ All command-line arguments are optional. By default a production build will be c
4541
| Option | Description | Example |
4642
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- |
4743
| `platform` | Platform to build (default is **ios**) | `--platform ios` |
48-
| `expo` | (Deprecated in SDK 41+) Expo target, **managed** or **bare**. Ensures that the project is bundled with expo settings and that `.expo.*` extensions are used. | `--expo bare` |
4944
| `dev` | Dev or production build (default is **false**) | `--dev false` |
5045
| `entry-file` | Entry-file (when omitted tries to auto-resolve it) | `--entry-file ./index.ios.js` |
5146
| `bundle-output` | Output bundle-file (default is **tmp**) | `--bundle-output ./myapp.bundle` |
@@ -56,11 +51,15 @@ All command-line arguments are optional. By default a production build will be c
5651

5752
[smeo]: https://github.com/danvk/source-map-explorer#options
5853

59-
## Usage with older react-native versions and the Haul bundler
54+
> The `--expo` command is no longer needed for Expo SDK 41 or higher; and has been removed. Use [react-native-bundle-visualizer@2](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v2) when targetting Expo SDK 40 or lower.
6055
61-
As of `react-native-bundle-visualizer` version 2.x, the direct output of the [Metro bundler](https://github.com/facebook/metro) is visualized using the [source-map-explorer](https://github.com/danvk/source-map-explorer).
56+
## Version compatibility
6257

63-
Prior to version 2, the Haul bundler was used which used Webpack. If you are having problems visualizing the output for older react-native versions, or you want to explicitly use the Haul bundler, [please check out the V1 documentation](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v1).
58+
| Version | Comments |
59+
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
60+
| 3.x | Compatible with React-Native CLI bootstrapped projects and Expo SDK 41 or higher. |
61+
| [2.x](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v2) | Compatible with React-Native CLI bootstrapped projects and Expo SDK 40 or earlier. |
62+
| [1.x](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v1) | Uses the [Haul bundler](https://github.com/callstack/haul) instead instead of the Metro output. |
6463

6564
## License
6665

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-bundle-visualizer",
3-
"version": "2.3.0",
3+
"version": "3.0.0",
44
"description": "See what's inside your react-native bundle",
55
"author": "IjzerenHein <[email protected]>",
66
"keywords": [
@@ -21,7 +21,6 @@
2121
"src"
2222
],
2323
"dependencies": {
24-
"@expo/metro-config": "0.1.15",
2524
"chalk": "^4.1.2",
2625
"execa": "^5.1.1",
2726
"fs-extra": "^10.0.0",
@@ -34,8 +33,7 @@
3433
"test:rn": "yarn test:rn:61 && yarn test:rn:64",
3534
"test:rn:61": "cd test/RN61 && yarn install && npx ../.. && cd ../..",
3635
"test:rn:64": "cd test/RN64 && yarn install && npx ../.. && cd ../..",
37-
"test:expo": "yarn test:expo:36 && yarn test:expo:42",
38-
"test:expo:36": "cd test/Expo36 && yarn install && npx ../.. --expo managed && cd ../..",
36+
"test:expo": "yarn test:expo:42",
3937
"test:expo:42": "cd test/Expo42 && yarn install && npx ../.. && cd ../.."
4038
}
4139
}

src/expo-metro.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/react-native-bundle-visualizer.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const tmpDir = path.join(baseDir, getAppName());
4141
const outDir = path.join(tmpDir, 'output');
4242
const entryFile = argv['entry-file'] || getEntryPoint();
4343
const platform = argv.platform || 'ios';
44-
const expoTarget = argv.expo || '';
44+
const expoTargetDeprecated = argv.expo || '';
4545
const dev = argv.dev || false;
4646
const verbose = argv.verbose || false;
4747
const resetCache = argv['reset-cache'] || false;
@@ -82,10 +82,14 @@ if (resetCache) {
8282
commands.push('--reset-cache');
8383
commands.push(resetCache);
8484
}
85-
if (expoTarget) {
86-
process.env.EXPO_TARGET = expoTarget;
87-
commands.push('--config');
88-
commands.push(path.join(__dirname, 'expo-metro.config.js'));
85+
86+
// Warn about `--expo` deprecation
87+
if (expoTargetDeprecated) {
88+
console.error(
89+
chalk.red.bold(
90+
'The "--expo" command is no longer needed for Expo SDK 41 or higher. When using Expo SDK 40 or lower, please use `react-native-bundle-visualizer@2`.'
91+
)
92+
);
8993
}
9094

9195
const bundlePromise = execa('./node_modules/.bin/react-native', commands);

test/Expo36/.expo-shared/assets.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/Expo36/.gitignore

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/Expo36/App.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

test/Expo36/__tests__/App-test.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

test/Expo36/__tests__/__snapshots__/App-test.js.snap

Lines changed: 0 additions & 22 deletions
This file was deleted.

test/Expo36/app.json

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)