Skip to content

refactor(assets-middleware): remove unused utility functions#6411

Merged
chenjiahan merged 1 commit intomainfrom
asset_middleware_cleanup_1023
Oct 23, 2025
Merged

refactor(assets-middleware): remove unused utility functions#6411
chenjiahan merged 1 commit intomainfrom
asset_middleware_cleanup_1023

Conversation

@chenjiahan
Copy link
Member

Summary

Remove memorize and escapeHtml utilities from the assets middleware as they don't really need to be used.

The content are fixed error messages and do not need to be escaped.

Checklist

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

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

netlify bot commented Oct 23, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit dc27b0e
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68f99539fdb8bc00098ee50d
😎 Deploy Preview https://deploy-preview-6411--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: 53 (🔴 down 9 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 removes two unused utility functions (memorize and escapeHtml) from the assets middleware to simplify the codebase. The change is based on the observation that error messages are fixed content that don't require HTML escaping.

Key changes:

  • Removed the memorize wrapper from parseRangeHeaders function
  • Removed HTML escaping from error message rendering
  • Deleted two utility files that are no longer needed

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/core/src/server/assets-middleware/middleware.ts Removed imports and usage of memorize and escapeHtml utilities
packages/core/src/server/assets-middleware/memorize.ts Deleted memoization utility file
packages/core/src/server/assets-middleware/escapeHtml.ts Deleted HTML escaping utility file

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

@chenjiahan chenjiahan merged commit 76d81b8 into main Oct 23, 2025
12 checks passed
@chenjiahan chenjiahan deleted the asset_middleware_cleanup_1023 branch October 23, 2025 02:48
@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