Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.57.0] Metro in React Native 0.57.0 slower than older ? #21138

Closed
Winglonelion opened this issue Sep 17, 2018 · 4 comments
Closed

[0.57.0] Metro in React Native 0.57.0 slower than older ? #21138

Winglonelion opened this issue Sep 17, 2018 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Winglonelion
Copy link

Winglonelion commented Sep 17, 2018

Maybe it is not a bug. But it happen clarify after my Project upgraded to RN 0.57.0. And i think it need some confirm from community to ensure what happen.

Environment

Run react-native info in your terminal and paste its contents here.

    System:
      OS: macOS Sierra 10.12.6
      CPU: x64 Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz
      Memory: 24.88 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
      Yarn: 1.9.4 - ~/.nvm/versions/node/v8.10.0/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v8.10.0/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.2, macOS 10.13, tvOS 11.2, watchOS 4.2
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 9.2/9C40b - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.0 => 16.5.0 
      react-native: 0.56.0 => 0.57.0 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

The Problems: As above, after upgraded my Project to RN 0.57.0 with babel 7.0.0. When debugging, my Metro server bundling progress spent x10 time to resolve same files and assets than 0.56.0. (30s -> 5 - 7 mins)

It made a large death time in my developing. Anyone met same issues ?

Release build worked fine. It just a problem with Metro Server.

Additional: Because RN devtool and debug server not compatable with RN 0.57.0, so i removed it from dev dependencies. You can see more here: #21054

Reproducible Demo.

I'm not sure. But it happen with this dependencies and configs:

packages.json:

  "dependencies": {
    "react-native": "0.57.0",
    "react": "16.5.0",
}
"devDependencies": {
    "@babel/cli": "7.0.0",
    "@babel/core": "7.0.0",
    "@babel/plugin-proposal-decorators": "7.0.0",
    "@babel/preset-flow": "7.0.0",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "9.0.0-beta.2",
    "babel-jest": "23.6.0",
    "babel-plugin-module-resolver": "3.1.1",
    "babel-plugin-transform-remove-console": "6.9.4",
    "enzyme": "3.6.0",
    "eslint": "5.1.0",
    "eslint-config-airbnb": "17.1.0",
    "eslint-import-resolver-babel-module": "5.0.0-beta.1",
    "eslint-plugin-import": "2.14.0",
    "eslint-plugin-jsx-a11y": "6.1.1",
    "eslint-plugin-react": "7.11.0",
    "eslint-plugin-react-native": "3.3.0",
    "flow-bin": "0.78.0",
    "jest": "23.6.0",
    "jest-util": "23.4.0",
    "metro-react-native-babel-preset": "0.45.2",
    "prettier-eslint": "8.8.2",
    "react-dom": "16.5.0",
    "react-test-renderer": "16.5.0",
    "redux-devtools-extension": "2.13.5",
    "redux-mock-store": "1.5.3",
    "remote-redux-devtools": "0.5.13"
  },

.babelrc:

{
    "presets": [
        "@babel/preset-flow",
        "module:metro-react-native-babel-preset"
    ],
    "env": {
        "production": {
            "plugins": [
                "transform-remove-console"
            ]
        }
    },
    "plugins": [
        [
            "@babel/plugin-proposal-decorators",
            {
                "legacy": true
            }
        ],
        [
            "module-resolver",
            {
                "cwd": "babelrc",
                "alias": {
                    "@js": "./js",
                    "@images": "./images",
                    "underscore": "lodash"
                },
                "extensions": [
                    ".android.js",
                    ".ios.js",
                    ".js"
                ]
            }
        ]
    ],
    "retainLines": true
}
@Winglonelion Winglonelion changed the title Metro in React Native slower than elder ? [0.57.0] Metro in React Native 0.57.0 slower than older ? Sep 17, 2018
@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@Winglonelion
Copy link
Author

Winglonelion commented Sep 17, 2018

@react-native-bot i added it (Environment). I think you need to smarter :)

@mjmasn
Copy link
Contributor

mjmasn commented Sep 17, 2018

@Winglonelion I guess it just looks for the React Native Environment Info header, you didn't copy the full output...

But yep, metro seems much slower (like 5x - 10x slower for first build) since upgrading.

  React Native Environment Info:
    System:
      OS: Linux 4.15 Ubuntu 16.04.5 LTS (Xenial Xerus)
      CPU: x64 Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
      Memory: 1.43 GB / 15.54 GB
      Shell: 4.3.48 - /bin/bash
    Binaries:
      Node: 8.11.0 - ~/.nvm/versions/node/v8.11.0/bin/node
      Yarn: 1.9.4 - /usr/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      Android SDK:
        Build Tools: 23.0.1, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3
        API Levels: 16, 19, 22, 23, 26, 27, 28
    IDEs:
      Android Studio: 3.1 AI-173.4907809
    npmPackages:
      react: ^16.5.0 => 16.5.1 
      react-native: 0.57.0 => 0.57.0 
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

@kelset
Copy link
Contributor

kelset commented Sep 17, 2018

This is not a react-native issue, so I don't see why we should keep this open.

If you think that something in Metro is now slower I recommend you open a dedicated issue on that project repo.

@kelset kelset closed this as completed Sep 17, 2018
@facebook facebook locked as off-topic and limited conversation to collaborators Sep 17, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants