-
Notifications
You must be signed in to change notification settings - Fork 167
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
speed up development env with swc-loader and hmr #3458
speed up development env with swc-loader and hmr #3458
Conversation
0259489
to
6318620
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3458 +/- ##
==========================================
- Coverage 85.66% 85.64% -0.03%
==========================================
Files 1347 1347
Lines 30680 30670 -10
Branches 8550 8550
==========================================
- Hits 26282 26266 -16
- Misses 4398 4404 +6 see 11 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Start up is faster I haven't seen any issues. /lgtm (now if only we could get it to stop faster on a cntrl-c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, hot reload is amazing. Loading is a lot faster.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks amazing, can't wait to get it merged and use it.
@christianvogt I did notice one weird thing - when I pass MEASURE=true
, hot reloading isn't working and in fact the server appears to break after a change. After making a code change it never reloads, and then if I reload the page I get a blank white screen with this console error:
Without MEASURE
set, everything works great. Do we care about that? If we do want to fix it maybe that can be a followup PR.
@mturley yes i guess I forgot to mention that. React refresh doesn't work with |
Ah got it. No worries then, I don't see a problem with merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real good stuff.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DaoDaoNoCode, mturley The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
With this change, startup of dev server is faster and provides hot module reloading without full page refresh.
ts-loader
withswc-loader
but only for dev mode.ReactRefreshWebpackPlugin
for fast hot module reloading.ForkTsCheckerWebpackPlugin
to fork type checking to a separate thread.To measure startup times use:
MEASURE=true npm run start:dev:ext
.Start up times for frontend
npm run start:dev:ext
Prior to any changes: