Skip to content
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

replace StringDecoder with TextDecoder #316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JohnGu9
Copy link

@JohnGu9 JohnGu9 commented Nov 28, 2023

Recently I get in trouble with iconv-lite and vite bundler and find out vite silently remove StringDecoder polyfill.

Without StringDecoder, iconv-lite doesn't work any more. So I try to replace StringDecoder with TextDecoder. TextDecoder is a standard es module and be available since node 11.

But the code is not completely move to TextDecoder. hex/base64/binary will depend on Buffer. And if TextDecoder is not available, it will be fallback to StringDecoder.

I don't know whether it's ok to move to TextDecoder. There are some performance difference between TextDecoder and StringDecoder.

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.

None yet

1 participant