Skip to content
New issue

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

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

Already on GitHub? # to your account

Refresh time is too slow in expo react-native project after upgrade #983

Closed
elitenas opened this issue Feb 16, 2023 · 14 comments · Fixed by #1033
Closed

Refresh time is too slow in expo react-native project after upgrade #983

elitenas opened this issue Feb 16, 2023 · 14 comments · Fixed by #1033
Assignees
Labels

Comments

@elitenas
Copy link

I'm submitting a bug report

Webpack Version:
1.10.x/2.x

Babel Core Version:
7.20.12

Babel Loader Version:
8.3.0

Please tell us about your environment:
OSX 10.x / Linux / Windows 10: OSX 13.2

Current behavior: Watch refresh time is too slow after upgrading from 8.2.5 to 8.30 in react-native expo project

Expected/desired behavior: Once i make an edit on a file, the refresh should be within 5 seconds but it takes 45 secs

@elitenas
Copy link
Author

elitenas commented Feb 16, 2023

@nicolo-ribaudo please help with this as you made changes for 8.3.0

@liuxingbaoyu
Copy link
Member

Can you provide a repo to reproduce it?

@elitenas
Copy link
Author

@liuxingbaoyu thanks for the response. Here is a repro project: https://drive.google.com/file/d/1lYluHiGl4UVnp9bbPjcIOid09NnbYifX/view?usp=sharing

It takes 30 seconds for a simple text change to apply. With babel-loader 8.2.5 or below, takes 2-3 seconds max.

@JLHwung
Copy link
Contributor

JLHwung commented Feb 21, 2023

@elitenas Thanks. I have downloaded the repro and will take a look.

@JLHwung
Copy link
Contributor

JLHwung commented Feb 21, 2023

@elitenas Can you attach the specific reproduction steps?

Here is mine:

npm i
npm run web
# Manually edit src/screens/Authentication/#.tsx
# Observe http://localhost:19006/

The page reload is instant, less than 3 seconds consistently.

@elitenas
Copy link
Author

elitenas commented Feb 21, 2023

@JLHwung My repro steps were similar.

  1. npm install
  2. npm start
  3. press w
  4. make a change to login page

The only thing i would point out is make sure you are on npm > 8.3.x. I am not in front of my my work laptop but I believe we are on 8.19.2. Otherwise the overrides object in package.json is ignored if you are on npm below that.

Let me know if this doesn't work. I had another developer reproduce this well. So i can double check.

Expo by default doesn't use babel-loader 8.3.0 yet

@JLHwung
Copy link
Contributor

JLHwung commented Feb 21, 2023

Let me know if this doesn't work.

$ npm -v
9.4.0
$ npm ls babel-loader
my-app@1.0.0 /path/to/my-app
└─┬ @expo/webpack-config@18.0.1
  └── babel-loader@8.3.0 overridden
$ cat node_modules/babel-loader/package.json | grep version
  "version": "8.3.0",
    "preversion": "yarn run test",

Expo by default doesn't use babel-loader 8.3.0 yet

Yes I am aware of that. I also tried bumping @expo/webpack-config to 8.0.1, hotloading is still instant.

@liuxingbaoyu
Copy link
Member

It takes about 10s for my test, and I will downgrade the loader for testing.

By the way, it is recommended to update webpack, because repro does not work by default in the new version of node.

@elitenas
Copy link
Author

Just tried on a brand new laptop and it takes around 10 seconds. Keep in mind this is a barebone project. In our main project its taking 45 seconds.

@JLHwung
Copy link
Contributor

JLHwung commented Feb 21, 2023

@liuxingbaoyu @elitenas Okay, maybe this issue is platform dependent. I am on arm64.

@liuxingbaoyu
Copy link
Member

liuxingbaoyu commented Feb 21, 2023

I can confirm the problem.

@liuxingbaoyu @elitenas Okay, maybe this issue is platform dependent. I am on arm64.

Yeah, it's possible.

I use windows, I will try to fix it.

@liuxingbaoyu
Copy link
Member

liuxingbaoyu commented Feb 21, 2023

Changes brought by #971.
Since externalDependencies has a value, caching is disabled.
The fix seems to be to check if they are up to date?

image

@elitenas
Copy link
Author

Haven't tested yet but this seems about right. I wasn't able to reproduce the slowness in babel-loader 9.1.2 after upgrading to expo 48

@elitenas
Copy link
Author

@liuxingbaoyu any update on this for 8.x.x?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
3 participants