Skip to content

Commit

Permalink
feat: remove expo metro config and --expo command (#65)
Browse files Browse the repository at this point in the history
* Remove Expo 36 test app

* remove expo-metro.config and --expo command

* update docs

* bump version
  • Loading branch information
IjzerenHein committed Aug 23, 2021
1 parent ec59236 commit bf4a1c1
Show file tree
Hide file tree
Showing 31 changed files with 25 additions and 9,752 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Make sure [npx](https://github.com/npm/npx) is installed and run the following c

`npx react-native-bundle-visualizer`

And when using Expo SDK 40 or lower. Learn more: [Expo extensions](http://expo.fyi/expo-extension-migration).

`npx react-native-bundle-visualizer --expo managed`

### Or install as a dev-dependency

```sh
Expand All @@ -45,7 +41,6 @@ All command-line arguments are optional. By default a production build will be c
| Option | Description | Example |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- |
| `platform` | Platform to build (default is **ios**) | `--platform ios` |
| `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` |
| `dev` | Dev or production build (default is **false**) | `--dev false` |
| `entry-file` | Entry-file (when omitted tries to auto-resolve it) | `--entry-file ./index.ios.js` |
| `bundle-output` | Output bundle-file (default is **tmp**) | `--bundle-output ./myapp.bundle` |
Expand All @@ -56,11 +51,15 @@ All command-line arguments are optional. By default a production build will be c

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

## Usage with older react-native versions and the Haul bundler
> 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.
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).
## Version compatibility

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).
| Version | Comments |
| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 3.x | Compatible with React-Native CLI bootstrapped projects and Expo SDK 41 or higher. |
| [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. |
| [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. |

## License

Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-bundle-visualizer",
"version": "2.3.0",
"version": "3.0.0",
"description": "See what's inside your react-native bundle",
"author": "IjzerenHein <hrutjes@gmail.com>",
"keywords": [
Expand All @@ -21,7 +21,6 @@
"src"
],
"dependencies": {
"@expo/metro-config": "0.1.15",
"chalk": "^4.1.2",
"execa": "^5.1.1",
"fs-extra": "^10.0.0",
Expand All @@ -34,8 +33,7 @@
"test:rn": "yarn test:rn:61 && yarn test:rn:64",
"test:rn:61": "cd test/RN61 && yarn install && npx ../.. && cd ../..",
"test:rn:64": "cd test/RN64 && yarn install && npx ../.. && cd ../..",
"test:expo": "yarn test:expo:36 && yarn test:expo:42",
"test:expo:36": "cd test/Expo36 && yarn install && npx ../.. --expo managed && cd ../..",
"test:expo": "yarn test:expo:42",
"test:expo:42": "cd test/Expo42 && yarn install && npx ../.. && cd ../.."
}
}
3 changes: 0 additions & 3 deletions src/expo-metro.config.js

This file was deleted.

14 changes: 9 additions & 5 deletions src/react-native-bundle-visualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const tmpDir = path.join(baseDir, getAppName());
const outDir = path.join(tmpDir, 'output');
const entryFile = argv['entry-file'] || getEntryPoint();
const platform = argv.platform || 'ios';
const expoTarget = argv.expo || '';
const expoTargetDeprecated = argv.expo || '';
const dev = argv.dev || false;
const verbose = argv.verbose || false;
const resetCache = argv['reset-cache'] || false;
Expand Down Expand Up @@ -82,10 +82,14 @@ if (resetCache) {
commands.push('--reset-cache');
commands.push(resetCache);
}
if (expoTarget) {
process.env.EXPO_TARGET = expoTarget;
commands.push('--config');
commands.push(path.join(__dirname, 'expo-metro.config.js'));

// Warn about `--expo` deprecation
if (expoTargetDeprecated) {
console.error(
chalk.red.bold(
'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`.'
)
);
}

const bundlePromise = execa('./node_modules/.bin/react-native', commands);
Expand Down
6 changes: 0 additions & 6 deletions test/Expo36/.expo-shared/assets.json

This file was deleted.

14 changes: 0 additions & 14 deletions test/Expo36/.gitignore

This file was deleted.

62 changes: 0 additions & 62 deletions test/Expo36/App.js

This file was deleted.

29 changes: 0 additions & 29 deletions test/Expo36/__tests__/App-test.js

This file was deleted.

22 changes: 0 additions & 22 deletions test/Expo36/__tests__/__snapshots__/App-test.js.snap

This file was deleted.

30 changes: 0 additions & 30 deletions test/Expo36/app.json

This file was deleted.

Binary file removed test/Expo36/assets/fonts/SpaceMono-Regular.ttf
Binary file not shown.
Binary file removed test/Expo36/assets/images/icon.png
Binary file not shown.
Binary file removed test/Expo36/assets/images/robot-dev.png
Binary file not shown.
Binary file removed test/Expo36/assets/images/robot-prod.png
Binary file not shown.
Binary file removed test/Expo36/assets/images/splash.png
Binary file not shown.
6 changes: 0 additions & 6 deletions test/Expo36/babel.config.js

This file was deleted.

8 changes: 0 additions & 8 deletions test/Expo36/components/StyledText.js

This file was deleted.

15 changes: 0 additions & 15 deletions test/Expo36/components/TabBarIcon.js

This file was deleted.

10 changes: 0 additions & 10 deletions test/Expo36/components/__tests__/StyledText-test.js

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions test/Expo36/constants/Colors.js

This file was deleted.

12 changes: 0 additions & 12 deletions test/Expo36/constants/Layout.js

This file was deleted.

12 changes: 0 additions & 12 deletions test/Expo36/navigation/AppNavigator.js

This file was deleted.

13 changes: 0 additions & 13 deletions test/Expo36/navigation/AppNavigator.web.js

This file was deleted.

Loading

0 comments on commit bf4a1c1

Please sign in to comment.