Sync JSON web decoders#1028
Merged
Merged
Conversation
In preparation for adding conditional imports to be able to use different encoding/decoding implementation based on the platform, this PR creates an "internal" library and exports some of the important types for encoding/decoding like `FieldInfo`, `PbFieldType` (renamed as `PbFieldTypeInternal`). This syncs some of cl/613649886.
Contributor
Author
|
@devoncarew PTAL. |
devoncarew
approved these changes
Jul 24, 2025
devoncarew
left a comment
Contributor
There was a problem hiding this comment.
I have a few comments; but given:
This syncs the web JSON decoder used internally.
I think we can consider the code reviewed. I think my only blocking comment is that we should update the CI here to test against the vm, dart2js, and dart2wasm.
Contributor
Author
|
@devoncarew PTAL. We should merge #1031 first, then rebase and merge this one. |
devoncarew
approved these changes
Jul 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This syncs the web JSON decoder used internally.
The new decoder uses
js_interopinstead of the Dart standard library toimprove performance when compiled to JS.
Benchmarks
master, JS:
PR, JS:
Wasm and VM benchmarks don't change as they keep using the old implementation.
The new implementation is slower with Wasm as it does more JS interop, so we keep using the old one.