-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
ENA-118 Replace text-encoding polyfill with much smaller library, saving 500KB #6899
ENA-118 Replace text-encoding polyfill with much smaller library, saving 500KB #6899
Conversation
Test failures seem to be the result of a ChromeDriver version mismatch |
7175e39
to
e59b316
Compare
To be super clear, this way of providing encoding functions is only needed on legacy Edge, right? Does that include basically all known pre-chromium versions of Edge? |
Added "accessibility" label because reducing download size (for both app and website) is meaningful for improving access when data is slow or expensive |
@benjiwheeler Yep, this library is used by all Legacy (non-Chromium) Edge - and by ONLY the Legacy Edge (at least for supported environments). |
Just a reminder that in order to actually remove this huge dependency from the bundle, you'll need to remove it from all the other packages too. |
…xt-encoding ENA-118 Replace text-encoding polyfill with much smaller library, saving 500KB
🎉 This PR is included in version 4.0.37 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@cwillisf Since this PR was first opened, I came across https://www.npmjs.com/package/fast-text-encoding, which seems to be far more popular and faster. I can create another PR for that if you want. You could also consider dropping the polyfill entirely--the only browser which does not support |
Yeah - I think removing it entirely is the right answer. Honestly, I merged this because it's relatively self-contained, and wanted to send a signal that I'm trying to make at least some small amount of progress 😅 |
Resolves
Proposed Changes
This PR replaces the
text-encoding
package withfastestsmallesttextencoderdecoder
.Reason for Changes
The
text-encoding
package has been deprecated by its maintainer, and also adds 500KB of encoding data for non-UTF-8 text. Because we're only using it to encode UTF-8, that 500KB is entirely unnecessary.Test Coverage
Must be tested manually.
Here, the
TextEncoder
API is used to encode assets for the default project. To test this, create a new default project in Legacy Edge, the only browser without nativeTextEncoder
support.Browser Coverage
Check the OS/browser combinations tested (At least 2)
Mac
Windows
Linux
Chromebook
iPad
Android Tablet