Skip to content

feat(native): add text-encoding to replacements - #1275

Open
maksimgm wants to merge 2 commits into
e18e:mainfrom
maksimgm:feat/text-encoding
Open

maksimgm wants to merge 2 commits into
e18e:mainfrom
maksimgm:feat/text-encoding

Conversation

@maksimgm

Copy link
Copy Markdown
Contributor

🔗 Linked issue

resolves #1256

📚 Description

maps text-encoding to the existing TextEncoder.encode and TextDecoder, like encode-utf8 and text-decoding. checked against text-encoding@0.7: encoding and decoding utf-8 matched the natives, and so did a legacy windows-1252 decode.

Comment thread manifests/native.json Outdated
"text-encoding": {
"type": "module",
"moduleName": "text-encoding",
"replacements": ["TextEncoder.encode", "TextDecoder"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't really do this. replacements are equivalent.

by having these two here, you're saying TextEncoder.encode and TextDecoder do the same job, i.e. the user is meant to pick one of the two.

if there isn't a common feature the two share, just link TextEncoder.encode

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they do share one though, both are the encoding api (same text-encoding web feature). i'll make it a single EncodingAPI entry linking mdn's encoding api page, like ClipboardAPI and streams in preferred. can switch to just TextEncoder.encode if you'd rather

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.

[Replacement]: text-encoding

2 participants