-
Notifications
You must be signed in to change notification settings - Fork 5
perf: make encoding-browser 2x smaller #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0262d1d to
66517e7
Compare
b365aec to
46605a1
Compare
66517e7 to
d83b644
Compare
There was a problem hiding this 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 refactors the browser-focused encoding entrypoints to reduce bundle size, mainly by relocating/rewriting encoding label normalization utilities and adjusting tests to target encoding-browser.
Changes:
- Consolidate
normalizeEncoding/labelToName/E_ENCODINGintofallback/encoding.jsand slim downfallback/encoding.api.js. - Rework
encoding-browser.browser.jsto rely more on nativeTextDecoderbehavior and implement lightweight label normalization. - Add a dedicated
tests/encoding/browser.test.jssuite and update vendor mock to importencoding-browser.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| whatwg.js | Update imports to source normalizeEncoding/E_ENCODING from fallback/encoding.js. |
| tests/vendor/whatwg-encoding/whatwg-encoding-mock.js | Switch mock to use @exodus/bytes/encoding-browser.js. |
| tests/encoding/generic.test.js | Minor cleanup in string coercion test (removes redundant line). |
| tests/encoding/browser.test.js | New test coverage targeting encoding-browser behavior (BOM, legacyHookDecode, coercion). |
| fallback/encoding.js | Move/define normalizeEncoding, labelToName, and E_ENCODING here. |
| fallback/encoding.api.js | Remove label/normalization helpers (now only BufferSource helpers + BOM detection). |
| encoding-browser.browser.js | Implement lightweight normalizeEncoding/labelToName and simplify legacyHookDecode using native TextDecoder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.