Skip to content

perf: lazy load open module to improve startup time#6407

Merged
chenjiahan merged 1 commit intomainfrom
lazy_load_open_1022
Oct 22, 2025
Merged

perf: lazy load open module to improve startup time#6407
chenjiahan merged 1 commit intomainfrom
lazy_load_open_1022

Conversation

@chenjiahan
Copy link
Member

Summary

The open package is only used when the dev --open flag is passed. Lazy loading this module can improve startup time.

Checklist

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

Copilot AI review requested due to automatic review settings October 22, 2025 09:53
@netlify
Copy link

netlify bot commented Oct 22, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 018c2a8
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68f8a9aad1d70a00081c480f
😎 Deploy Preview https://deploy-preview-6407--rsbuild.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: 58 (🔴 down 12 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes startup performance by lazy loading the open module only when the dev --open flag is used, rather than importing it at module initialization time.

Key Changes:

  • Moved the open module import from top-level to within the openBrowser function using dynamic import

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chenjiahan chenjiahan merged commit ba4aeb1 into main Oct 22, 2025
12 checks passed
@chenjiahan chenjiahan deleted the lazy_load_open_1022 branch October 22, 2025 10:04
@chenjiahan chenjiahan mentioned this pull request Oct 30, 2025
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.

1 participant