New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(compiler-cli): evaluate const tuple types statically #48091
Closed
Closed
Conversation
This file contains 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
For standalone components it may be beneficial to group multiple declarations into a single array, that can then be imported all at once in `Component.imports`. If this array is declared within a library, however, would the AOT compiler need to extract the contents of the array from the declaration file. This requires that the array is constructed using an `as const` cast, which results in a readonly tuple declaration in the generated .d.ts file of the library: ```ts export declare const DECLARATIONS: readonly [typeof StandaloneDir]; ``` The partial evaluator logic did not support this syntax, so this pattern was not functional when a library is involved. This commit adds the necessary logic in the static interpreter to evaluate this type at compile time. Closes angular#48089
JoostK
added
area: compiler
Issues related to `ngc`, Angular's template compiler
cross-cutting: standalone
Issues related to the NgModule-less world
labels
Nov 16, 2022
JoostK
added
action: review
The PR is still awaiting reviews from at least one requested reviewer
target: patch
This PR is targeted for the next patch release
labels
Nov 16, 2022
Caretaker Note: Please ignore the |
ChanduMdp
added
the
merge: caretaker note
Alert the caretaker performing the merge to check the PR for an out of normal action needed or note
label
Nov 17, 2022
atscott
approved these changes
Dec 7, 2022
atscott
added
action: merge
The PR is ready for merge by the caretaker
and removed
action: review
The PR is still awaiting reviews from at least one requested reviewer
labels
Dec 7, 2022
This PR was merged into the repository by commit a6849f2. |
AndrewKushnir
pushed a commit
that referenced
this pull request
Dec 7, 2022
For standalone components it may be beneficial to group multiple declarations into a single array, that can then be imported all at once in `Component.imports`. If this array is declared within a library, however, would the AOT compiler need to extract the contents of the array from the declaration file. This requires that the array is constructed using an `as const` cast, which results in a readonly tuple declaration in the generated .d.ts file of the library: ```ts export declare const DECLARATIONS: readonly [typeof StandaloneDir]; ``` The partial evaluator logic did not support this syntax, so this pattern was not functional when a library is involved. This commit adds the necessary logic in the static interpreter to evaluate this type at compile time. Closes #48089 PR Close #48091
crapStone
pushed a commit
to Calciumdibromid/CaBr2
that referenced
this pull request
Dec 23, 2022
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular/animations](https://github.com/angular/angular) | dependencies | patch | [`15.0.2` -> `15.0.4`](https://renovatebot.com/diffs/npm/@angular%2fanimations/15.0.2/15.0.4) | | [@angular/common](https://github.com/angular/angular) | dependencies | patch | [`15.0.2` -> `15.0.4`](https://renovatebot.com/diffs/npm/@angular%2fcommon/15.0.2/15.0.4) | | [@angular/compiler](https://github.com/angular/angular) | dependencies | patch | [`15.0.2` -> `15.0.4`](https://renovatebot.com/diffs/npm/@angular%2fcompiler/15.0.2/15.0.4) | | [@angular/compiler-cli](https://github.com/angular/angular/tree/main/packages/compiler-cli) ([source](https://github.com/angular/angular)) | devDependencies | patch | [`15.0.2` -> `15.0.4`](https://renovatebot.com/diffs/npm/@angular%2fcompiler-cli/15.0.2/15.0.4) | | [@angular/core](https://github.com/angular/angular) | dependencies | patch | [`15.0.2` -> `15.0.4`](https://renovatebot.com/diffs/npm/@angular%2fcore/15.0.2/15.0.4) | | [@angular/forms](https://github.com/angular/angular) | dependencies | patch | [`15.0.2` -> `15.0.4`](https://renovatebot.com/diffs/npm/@angular%2fforms/15.0.2/15.0.4) | | [@angular/platform-browser](https://github.com/angular/angular) | dependencies | patch | [`15.0.2` -> `15.0.4`](https://renovatebot.com/diffs/npm/@angular%2fplatform-browser/15.0.2/15.0.4) | | [@angular/platform-browser-dynamic](https://github.com/angular/angular) | dependencies | patch | [`15.0.2` -> `15.0.4`](https://renovatebot.com/diffs/npm/@angular%2fplatform-browser-dynamic/15.0.2/15.0.4) | --- ### Release Notes <details> <summary>angular/angular</summary> ### [`v15.0.4`](https://github.com/angular/angular/blob/HEAD/CHANGELOG.md#​1504-2022-12-14) [Compare Source](angular/angular@15.0.3...15.0.4) ##### animations | Commit | Type | Description | | -- | -- | -- | | [6c1064c72f](angular/angular@6c1064c) | fix | fix incorrect handling of camel-case css properties ([#​48436](angular/angular#48436)) | ##### common | Commit | Type | Description | | -- | -- | -- | | [f30d18a942](angular/angular@f30d18a) | fix | Fix TestBed.overrideProvider type to include multi ([#​48424](angular/angular#48424)) | ##### compiler-cli | Commit | Type | Description | | -- | -- | -- | | [b55d2dab5d](angular/angular@b55d2da) | fix | evaluate const tuple types statically ([#​48091](angular/angular#48091)) | #### Special Thanks Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, BrowserPerson, Jens, Jessica Janiuk, Joey Perrott, JoostK, Konstantin Kharitonov, Lukas Matta, Piotr Kowalski, Virginia Dooley, Yannick Baron, dario-piotrowicz, lsst25, piyush132000 and why520crazy <!-- CHANGELOG SPLIT MARKER --> ### [`v15.0.3`](https://github.com/angular/angular/blob/HEAD/CHANGELOG.md#​1503-2022-12-07) [Compare Source](angular/angular@15.0.2...15.0.3) ##### common | Commit | Type | Description | | -- | -- | -- | | [50b1c2bf52](angular/angular@50b1c2b) | fix | Don't generate srcsets with very large sources ([#​47997](angular/angular#47997)) | | [bf44dc234a](angular/angular@bf44dc2) | fix | Update `Location` to support base href containing `origin` ([#​48327](angular/angular#48327)) | ##### compiler | Commit | Type | Description | | -- | -- | -- | | [9a5d84249a](angular/angular@9a5d842) | fix | make sure selectors inside container queries are correctly scoped ([#​48353](angular/angular#48353)) | ##### compiler-cli | Commit | Type | Description | | -- | -- | -- | | [167bc0d163](angular/angular@167bc0d) | fix | Produce diagnostic rather than crash when using invalid hostDirective ([#​48314](angular/angular#48314)) | ##### core | Commit | Type | Description | | -- | -- | -- | | [e4dcaa513e](angular/angular@e4dcaa5) | fix | unable to inject ChangeDetectorRef inside host directives ([#​48355](angular/angular#48355)) | #### Special Thanks Alan Agius, Alex Castle, Andrew Kushnir, Andrew Scott, Bob Watson, Derek Cormier, Joey Perrott, Konstantin Kharitonov, Kristiyan Kostadinov, Paul Gschwendtner, Pawel Kozlowski, dario-piotrowicz and piyush132000 <!-- CHANGELOG SPLIT MARKER --> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43MC4wIiwidXBkYXRlZEluVmVyIjoiMzQuNzAuNCJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1684 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
trekladyone
pushed a commit
to trekladyone/angular
that referenced
this pull request
Feb 1, 2023
For standalone components it may be beneficial to group multiple declarations into a single array, that can then be imported all at once in `Component.imports`. If this array is declared within a library, however, would the AOT compiler need to extract the contents of the array from the declaration file. This requires that the array is constructed using an `as const` cast, which results in a readonly tuple declaration in the generated .d.ts file of the library: ```ts export declare const DECLARATIONS: readonly [typeof StandaloneDir]; ``` The partial evaluator logic did not support this syntax, so this pattern was not functional when a library is involved. This commit adds the necessary logic in the static interpreter to evaluate this type at compile time. Closes angular#48089 PR Close angular#48091
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
action: merge
The PR is ready for merge by the caretaker
area: compiler
Issues related to `ngc`, Angular's template compiler
cross-cutting: standalone
Issues related to the NgModule-less world
merge: caretaker note
Alert the caretaker performing the merge to check the PR for an out of normal action needed or note
target: patch
This PR is targeted for the next patch release
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.
For standalone components it may be beneficial to group multiple declarations into a single array, that can then be imported all at once in
Component.imports
. If this array is declared within a library, however, would the AOT compiler need to extract the contents of the array from the declaration file. This requires that the array is constructed using anas const
cast, which results in a readonly tuple declaration in the generated .d.ts file of the library:The partial evaluator logic did not support this syntax, so this pattern was not functional when a library is involved. This commit adds the necessary logic in the static interpreter to evaluate this type at compile time.
Closes #48089