-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix: use w3c decoder #90
Conversation
769d7a6
to
7f1b802
Compare
7f1b802
to
df04bc8
Compare
b4a seems like a Buffer polyfill, I made |
Thanks taking a look tmw. We use b4a everywhere so pretty happy with that |
;-; |
Where are you getting 20 kb from? text-decoder is <4kb |
This needs a fallback to envs where TextDecoder doesnt exist, but honestly saving 4kb but adding the code that also supports the fallback doesn't seem worth the complexity to me |
Ah let me re-review, i got confused by the comment, b4a is pulled in by textdecoder |
Moved here holepunchto/text-decoder#2 |
that is a private org |
I personally struggled to find such envs, I think some very niche stuff like goja doesn't support it, and some smart TV's from 2010's, that's about it tho? I used streamx because of how tiny it was compared to stream, this change kinda nullifies that |
Open now, was private by mistake |
We use it on phones where its not there. Dont think 1kb matters personally. |
ah that makes sense. yeah, I still don't like the fact that I'm importing packages and functionality which I won't be using, would be nice if this was in a separate class that extended readable/writable, rather than the main one so at least its tree-shakeable, or so I'd like to say, but I'm not sure if CJS would allow that |
uses W3C text decoder which is built in to most JS environments such as node.js, web, bun etc
reduces dependency size by some 20-ish KB