Skip to content

fix(lazyCompilation): use { entries: false } for better DX#2286

Closed
SoonIter wants to merge 1 commit intomainfrom
syt/lazyCompilation-default-value
Closed

fix(lazyCompilation): use { entries: false } for better DX#2286
SoonIter wants to merge 1 commit intomainfrom
syt/lazyCompilation-default-value

Conversation

@SoonIter
Copy link
Member

@SoonIter SoonIter commented Jun 16, 2025

Summary

Rspress actually has only one entry, so there is no need for lazy loading. It is the necessary path for rendering.

Currently, we have adopted lazyLoading, which will only load CSS when the developer first opens the page, resulting in a poor experience (large CLS).

This PR may lead to degradation in benchmark data, but these are necessary.

before

image

after

This result is actually faster than before because some work has already been done during the time the user opens the browser.

image

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Jun 16, 2025

Deploy Preview for rspress ready!

Name Link
🔨 Latest commit a249676
🔍 Latest deploy log https://app.netlify.com/projects/rspress/deploys/684fdc9c8c10b800084be8ab
😎 Deploy Preview https://deploy-preview-2286--rspress.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71 (🔴 down 25 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (🟢 up 9 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jun 16, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit a249676
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/684fdc9c538d7300084645a7
😎 Deploy Preview https://deploy-preview-2286--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@SoonIter SoonIter force-pushed the syt/lazyCompilation-default-value branch from 6a2f3b1 to a249676 Compare June 16, 2025 08:58
@SoonIter SoonIter requested a review from Timeless0911 June 16, 2025 09:02
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be the default behavior of Rsbuild's dev.lazyCompilation: true? (set entries: false when there is only one entry)

@SoonIter
Copy link
Member Author

SoonIter commented Jun 16, 2025

Maybe this should be the default behavior of Rsbuild's dev.lazyCompilation: true? (set entries: false when there is only one entry)

  1. For MPA, entries: true is very useful, (maybe the number of entries is larger than 5)

  2. For SPA, entries: false is acceptable

@JSerFeng what's your opinion

@SoonIter
Copy link
Member Author

Maybe this should be the default behavior of Rsbuild's dev.lazyCompilation: true? (set entries: false when there is only one entry)

LGTM

{
  entries: Object.keys(source.entries).length > 1
}

@chenjiahan
Copy link
Member

Rsbuild PR: web-infra-dev/rsbuild#5431

@JSerFeng
Copy link

For SPA, entries: false is acceptable

I agree, entries: false is almost useless for SPA

@JounQin JounQin deleted the syt/lazyCompilation-default-value branch June 26, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants