-
-
Notifications
You must be signed in to change notification settings - Fork 576
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
feat: lazy compilation #5915
feat: lazy compilation #5915
Conversation
!canary |
0.5.5-canary-58c4cad-20240311091247 |
46b706d
to
3dfa608
Compare
!canary |
62fc0a8
to
ab14a08
Compare
!canary |
0.5.6-canary-7b27ac8-20240311132614 |
1281a4f
to
dcd4782
Compare
!canary |
0.5.7-canary-dcd4782-20240312094134 |
8522340
to
bc14fb8
Compare
Test Compatibility Diff
Unpassed tests6 🔴 Stats chunkGroups: TODO |
bc14fb8
to
fcec5af
Compare
fcec5af
to
9e2ce60
Compare
!canary |
0.5.7-canary-9e2ce60-20240320055406 |
9e2ce60
to
6154ea7
Compare
✅ Deploy Preview for rspack canceled.
|
6154ea7
to
55c2e87
Compare
we can try it on rspress and see the performance gain, cc @chenjiahan |
55c2e87
to
c2949ea
Compare
d8fe4a5
to
4a6c62e
Compare
@Timeless0911 can you try to enable lazy compilation in Rspress and give some feedbacks? ❤️ |
2a1c9c7
to
14bc877
Compare
14bc877
to
fa8e500
Compare
Sync some context for public, now two issues have been discovered yet
@JSerFeng is tracking on it. |
rsbuild has its own entry for hmr runtime, and that entry has been lazy compiled because of lazyCompilation, so the hmr didn't work as expected because its runtime has not been injected.
After fixing some other bugs that causing the performance issue, the build time decreased from 4 seconds to 1 seconds |
rsbuild could encapsulate this part of the logic and put rsbuild's own entry into
|
Summary
What is lazy compilation ?
The easiest mental model would be:
Imagine some code that you may not use at the first run, for example, when you click a button, load another page, if you don't click that button at all when you develop other stuff, that page is useless, so we don't need to build it. We build it once we do execute the click.
We try to make entries and dynamic imports as split point, for example, consider:
When we compile A, we make B just an empty file, pretend user never write any code in it.
Once we access B, which means we do need to build B, we fill B with its original content, pretend that user write content immediately
Require Documentation?