Repository navigation
Conversation
…tadata
In ngtsc, signal query class metadata and JIT decorators spread the user's options object literal verbatim (`{ ...options, isSignal: true }`), preserving explicit options like `descendants: false` or `debugName` and avoiding extra keys when no options argument was passed.
Previously, ngp reconstructed the options object from parsed `readSpan` and `descendants` fields. That emitted a spurious `descendants: true` on bare `contentChild('x')` calls (where no options argument was provided) and dropped `descendants: false` when explicitly passed.
Record the raw `options_span` on `QueryMetadata` in `ng-analyze` and spread it via `LiteralMapSpreadAssignment` in `buildPropDecoratorsExpr` (and JIT decorator synthesis) so ngp matches ngtsc.
JeanMeche
requested review from
crisbeto and
mattrbeck
and removed request for
crisbeto
October 18, 2026 17:27
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.
Summary
optionsSpanonQueryMetadatainng-analyzewhen a signal query call (viewChild,viewChildren,contentChild,contentChildren) passes a second argument.{ ...<options>, isSignal: true }inbuildPropDecoratorsExpr(viaLiteralMapSpreadAssignment) and in JIT decorator synthesis, matchingngtsc'smemberMetadataFromSignalQueryandqueryFunctionsTransforms.readSpan/descendants:contentChild('el')with no options argument no longer emits a spuriousdescendants: trueinsetClassMetadata/ JIT.contentChildren('el', { descendants: false })andcontentChild('el', { descendants: false })now preservedescendants: falseinstead of dropping it.This was detected when working on #71343.
Test Plan
options_spaninpackages/compiler-cli/preprocessor/ng-analyze/src/analyzer/queries.rs.//packages/compiler-cli/preprocessor/test:test).//packages/compiler-cli/preprocessor/ng-analyze:test,//packages/compiler-cli/preprocessor/test:test,//packages/compiler-cli/preprocessor/test:typecheck_goldens_test,//packages/compiler-cli/test/compliance/full:full_ngp,//packages/compiler-cli/test/compliance/local:local_ngp,//packages/compiler-cli/test/compliance/declaration-only:declaration-only_ngp, and//packages/compiler-cli/test/ngtsc:ngtsc_ngp.