feat(js): add schema-based per-field nullable support for xlang#3100
Merged
chaokunyang merged 6 commits intoapache:mainfrom Jan 4, 2026
Merged
feat(js): add schema-based per-field nullable support for xlang#3100chaokunyang merged 6 commits intoapache:mainfrom
chaokunyang merged 6 commits intoapache:mainfrom
Conversation
Contributor
Author
|
Hi @chaokunyang |
Collaborator
|
@theharsh999 Could you add some tests for this? you can take #3104 as reference |
Contributor
Author
|
Added schema-consistent nullable tests following #3104 as reference. |
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.
Why?
JavaScript xlang schema-based struct serialization currently treats all fields as nullable and always writes a per-field null flag.
This introduces unnecessary overhead when a field is known to be non-nullable by schema design.
What does this PR do?
nullablesupport for JS xlang struct serialization.nullable: falseis explicitly specified:nullorundefined(includes field name).StructTypeInfofield schema typing to allownullable?: boolean.null.nullablekeep existing behavior.Related issues
#3007
Does this PR introduce any user-facing change?
Yes.
This PR introduces an opt-in schema-level configuration (
nullable: false) for JS xlang serialization.Existing schemas are unaffected unless
nullable: falseis explicitly set.Benchmark
This change is opt-in and only affects schema-based fields explicitly marked as
nullable: false.No performance regression is expected for existing schemas.