Skip to content

[TS] Implement TextEncoder/TextDecoder with native code#3800

Merged
coolreader18 merged 3 commits intomasterfrom
noa/native-js-utf8
Dec 4, 2025
Merged

[TS] Implement TextEncoder/TextDecoder with native code#3800
coolreader18 merged 3 commits intomasterfrom
noa/native-js-utf8

Conversation

@coolreader18
Copy link
Collaborator

Description of Changes

This implements (a subset of) the TextEncoder/TextDecoder web APIs using native functions to do the actual Uint8Array <-> String conversion. This should be a good bit faster than the fast-text-encoding package.

Expected complexity level and risk

2 - this introduces new kinds of JS code and host calls to the v8 host, but they're pretty well encapsulated.

Testing

  • All TS modules make use of these already for encoding/decoding strings in BSATN - the fast-text-encoding polyfill we pull in only takes effect if the classes don't already exist, so the smoketests passing means it works.

@coolreader18 coolreader18 requested a review from Centril December 4, 2025 18:27
@coolreader18 coolreader18 added this pull request to the merge queue Dec 4, 2025
@coolreader18
Copy link
Collaborator Author

coolreader18 commented Dec 4, 2025

Internal tests are only due to this branch not being based on latest master.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 4, 2025
@coolreader18 coolreader18 added this pull request to the merge queue Dec 4, 2025
Merged via the queue into master with commit c2b8c7f Dec 4, 2025
25 of 26 checks passed
@coolreader18 coolreader18 deleted the noa/native-js-utf8 branch December 4, 2025 22:15
github-merge-queue bot pushed a commit that referenced this pull request Feb 12, 2026
# Description of Changes

Hasn't been needed in months (since #3800), it'd be nice to get it in to
2.0 if possible.

# Expected complexity level and risk

1

# Testing

- [x] Builds successfully
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->
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.

2 participants