Skip to content

perf(server): lazy load range-parser#6423

Merged
chenjiahan merged 2 commits intomainfrom
range_parser_1024
Oct 24, 2025
Merged

perf(server): lazy load range-parser#6423
chenjiahan merged 2 commits intomainfrom
range_parser_1024

Conversation

@chenjiahan
Copy link
Member

Summary

Use dynamic import for range-parser to defer loading until needed (it's not used in most cases).

Checklist

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

Copilot AI review requested due to automatic review settings October 24, 2025 02:21
@netlify
Copy link

netlify bot commented Oct 24, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 510bed3
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68fae8f4354dd900080724bb
😎 Deploy Preview https://deploy-preview-6423--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: 59 (🔴 down 24 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 the server's assets middleware by converting the range-parser import from static to dynamic loading, deferring the module load until it's actually needed for range request parsing.

Key Changes:

  • Converted parseRangeHeaders to an async function that dynamically imports range-parser
  • Updated the function call site to use await when invoking parseRangeHeaders

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

@chenjiahan chenjiahan merged commit 5cb1c9e into main Oct 24, 2025
14 of 17 checks passed
@chenjiahan chenjiahan deleted the range_parser_1024 branch October 24, 2025 03:11
@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