Skip to content

perf: make encoding-browser 2x smaller#59

Closed
ChALkeR wants to merge 1 commit intomainfrom
chalker/badges/1
Closed

perf: make encoding-browser 2x smaller#59
ChALkeR wants to merge 1 commit intomainfrom
chalker/badges/1

Conversation

@ChALkeR
Copy link
Collaborator

@ChALkeR ChALkeR commented Feb 9, 2026

No description provided.

Copy link

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 aims to reduce the bundle size of the browser-targeted encoding entrypoint (@exodus/bytes/encoding-browser.js) by relying more on native browser TextDecoder behavior and by consolidating encoding-label utilities into fewer modules.

Changes:

  • Consolidates normalizeEncoding, labelToName, and E_ENCODING into fallback/encoding.js and strips them out of fallback/encoding.api.js.
  • Reworks encoding-browser.browser.js to avoid importing the full labels dataset and instead normalize/validate via native TextDecoder.
  • Updates vendor mocks and adds a new browser-focused test suite for encoding-browser.

Reviewed changes

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

Show a summary per file
File Description
whatwg.js Switches to importing encoding helpers from ./fallback/encoding.js (consolidated module).
tests/vendor/whatwg-encoding/whatwg-encoding-mock.js Uses @exodus/bytes/encoding-browser.js instead of the full encoding.js entrypoint.
tests/encoding/browser.test.js Adds browser-specific coverage for native TextDecoder/TextEncoder behavior and hooks.
fallback/encoding.js Becomes the home for normalizeEncoding, labelToName, and E_ENCODING (previously in encoding.api.js).
fallback/encoding.api.js Reduced to fromSource and getBOMEncoding only.
encoding-browser.browser.js Implements lightweight browser normalization/hooks intended to reduce bundle size.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ChALkeR ChALkeR force-pushed the chalker/badges/1 branch 4 times, most recently from d01d362 to db95c66 Compare February 9, 2026 13:16
@ChALkeR ChALkeR force-pushed the main branch 2 times, most recently from 8dec88e to ade8115 Compare February 9, 2026 13:29
@ChALkeR ChALkeR closed this Feb 9, 2026
@ChALkeR ChALkeR deleted the chalker/badges/1 branch February 9, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants