Allow readonly array typings for the preprocessor - #70002
Open
alxhub wants to merge 2 commits into
Open
Conversation
mattrbeck
approved these changes
Jul 29, 2026
alxhub
force-pushed
the
type-safety-for-ngp
branch
4 times, most recently
from
July 29, 2026 23:11
6557911 to
e3c8260
Compare
Member
|
Is this good to merge? |
When components pass arrays or readonly tuples to decorator metadata fields (such as ), typechecking generated decorator reflection metadata causes a TS2322 type mismatch error because previously only accepted mutable . This change updates to accept , allowing arrays and readonly tuples to be assigned without TypeScript compilation errors.
When reflection metadata is emitted via setClassMetadata, passing readonly arrays or const tuples for the decorators parameter causes TypeScript type checking errors because setClassMetadata previously expected decorators to be a mutable any[] or null. This change updates the setClassMetadata type signature to accept decorators as readonly any[] or null and casts the parameter internally when mutating the class metadata property.
alxhub
force-pushed
the
type-safety-for-ngp
branch
from
August 4, 2026 16:00
e3c8260 to
e74d5e2
Compare
Member
Author
|
Caretaker: presubmit is "green" |
Contributor
|
This probably needs a rebase for the github actions scan to pass. |
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.
Adjust the Angular APIs in a few places to only require
readonlyarrays. This allows us to avoid a@ts-ignorein cases when the preprocessor needs to call these APIs.