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): ensure that partially compiled queries can handle forward references #44113
Closed
petebacondarwin
wants to merge
2
commits into
angular:master
from
petebacondarwin:linker-content-children-query-forward-ref-issue
Closed
fix(compiler): ensure that partially compiled queries can handle forward references #44113
petebacondarwin
wants to merge
2
commits into
angular:master
from
petebacondarwin:linker-content-children-query-forward-ref-issue
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
7b5e12c
to
949fca5
JoostK
reviewed
Nov 8, 2021
JoostK
reviewed
Nov 8, 2021
...est_cases/r3_compiler_compliance/components_and_directives/queries/view_query_forward_ref.js
Outdated
Show resolved
Hide resolved
..._cases/r3_compiler_compliance/components_and_directives/queries/content_query_forward_ref.js
Outdated
Show resolved
Hide resolved
This interface will be used in other situations so this change renames it to be more general as `MaybeForwardRefExpression`.
42c0b3d
to
53a6df1
53a6df1
to
9b9d0de
9b9d0de
to
e03badd
e03badd
to
14b69b2
…ard references When a partially compiled component or directive is "linked" in JIT mode, the body of its declaration is evaluated by the JavaScript runtime. If a class is referenced in a query (e.g. `ViewQuery` or `ContentQuery`) but its definition is later in the file, then the reference must be wrapped in a `forwardRef()` call. Previously, query predicates were not wrapped correctly in partial declarations causing the code to crash at runtime. In AOT mode, this code is never evaluated but instead transformed as part of the build, so this bug did not become apparent until Angular Material started running JIT mode tests on its distributable output. This change fixes this problem by noting when queries are wrapped in `forwardRef()` calls and ensuring that this gets passed through to partial compilation declarations and then suitably stripped during linking. See angular/components#23882 and angular/components#23907
f40e02c
to
c0ad276
alxhub
approved these changes
Nov 10, 2021
|
This PR was merged into the repository by commit 393efa5. |
atscott
added a commit
that referenced
this issue
Nov 10, 2021
…ard references (#44113) When a partially compiled component or directive is "linked" in JIT mode, the body of its declaration is evaluated by the JavaScript runtime. If a class is referenced in a query (e.g. `ViewQuery` or `ContentQuery`) but its definition is later in the file, then the reference must be wrapped in a `forwardRef()` call. Previously, query predicates were not wrapped correctly in partial declarations causing the code to crash at runtime. In AOT mode, this code is never evaluated but instead transformed as part of the build, so this bug did not become apparent until Angular Material started running JIT mode tests on its distributable output. This change fixes this problem by noting when queries are wrapped in `forwardRef()` calls and ensuring that this gets passed through to partial compilation declarations and then suitably stripped during linking. See angular/components#23882 and angular/components#23907 PR Close #44113
atscott
added a commit
that referenced
this issue
Nov 10, 2021
…ard references (#44113) When a partially compiled component or directive is "linked" in JIT mode, the body of its declaration is evaluated by the JavaScript runtime. If a class is referenced in a query (e.g. `ViewQuery` or `ContentQuery`) but its definition is later in the file, then the reference must be wrapped in a `forwardRef()` call. Previously, query predicates were not wrapped correctly in partial declarations causing the code to crash at runtime. In AOT mode, this code is never evaluated but instead transformed as part of the build, so this bug did not become apparent until Angular Material started running JIT mode tests on its distributable output. This change fixes this problem by noting when queries are wrapped in `forwardRef()` calls and ensuring that this gets passed through to partial compilation declarations and then suitably stripped during linking. See angular/components#23882 and angular/components#23907 PR Close #44113
devversion
added a commit
to devversion/material2
that referenced
this issue
Nov 11, 2021
…lation output We updated to Angular v13.0.1 which fixes the partial compilation output for `forwardRef` usages in queries. The fixed partial compilation output will ensure that Angular CDK/Material works with JIT linking at runtime, as done in e.g. Jest. Fix upstream: angular/angular#44113. We will add some testing for the JIT linker to the `angular/components` repository with: angular#23882. That should help ensuring JIT linking does not regress. Fixes angular#23907.
devversion
added a commit
to devversion/material2
that referenced
this issue
Nov 11, 2021
…lation output Updates to Angular v13.0.1 which fixes the partial compilation output for `forwardRef` usages in queries. The fixed partial compilation output will ensure that Angular CDK/Material works with JIT linking at runtime, as done in e.g. Jest. Fix upstream: angular/angular#44113. We will add some testing for the JIT linker to the `angular/components` repository with: angular#23882. That should help ensuring JIT linking does not regress. Fixes angular#23907.
amysorto
pushed a commit
to angular/components
that referenced
this issue
Nov 11, 2021
…lation output (#23951) Updates to Angular v13.0.1 which fixes the partial compilation output for `forwardRef` usages in queries. The fixed partial compilation output will ensure that Angular CDK/Material works with JIT linking at runtime, as done in e.g. Jest. Fix upstream: angular/angular#44113. We will add some testing for the JIT linker to the `angular/components` repository with: #23882. That should help ensuring JIT linking does not regress. Fixes #23907.
amysorto
added a commit
to angular/components
that referenced
this issue
Nov 11, 2021
…lation output (#23951) Updates to Angular v13.0.1 which fixes the partial compilation output for `forwardRef` usages in queries. The fixed partial compilation output will ensure that Angular CDK/Material works with JIT linking at runtime, as done in e.g. Jest. Fix upstream: angular/angular#44113. We will add some testing for the JIT linker to the `angular/components` repository with: #23882. That should help ensuring JIT linking does not regress. Fixes #23907. (cherry picked from commit 8cb0f12)
crisbeto
added a commit
to crisbeto/material.angular.io
that referenced
this issue
Nov 19, 2021
We're currently locked into version 13.0.0 which has a problem with queries using `forwardRef` which affects several places in the docs like the navigation between docs and API examples. These changes update to 13.0.1 which contains angular/angular#44113 in order to resolve the issue.
crisbeto
added a commit
to angular/material.angular.io
that referenced
this issue
Nov 19, 2021
We're currently locked into version 13.0.0 which has a problem with queries using `forwardRef` which affects several places in the docs like the navigation between docs and API examples. These changes update to 13.0.1 which contains angular/angular#44113 in order to resolve the issue.
|
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. |
dimakuba
added a commit
to dimakuba/angular
that referenced
this issue
Dec 28, 2021
angular#44113) This interface will be used in other situations so this change renames it to be more general as `MaybeForwardRefExpression`. PR Close angular#44113
dimakuba
added a commit
to dimakuba/angular
that referenced
this issue
Dec 28, 2021
…ard references (angular#44113) When a partially compiled component or directive is "linked" in JIT mode, the body of its declaration is evaluated by the JavaScript runtime. If a class is referenced in a query (e.g. `ViewQuery` or `ContentQuery`) but its definition is later in the file, then the reference must be wrapped in a `forwardRef()` call. Previously, query predicates were not wrapped correctly in partial declarations causing the code to crash at runtime. In AOT mode, this code is never evaluated but instead transformed as part of the build, so this bug did not become apparent until Angular Material started running JIT mode tests on its distributable output. This change fixes this problem by noting when queries are wrapped in `forwardRef()` calls and ensuring that this gets passed through to partial compilation declarations and then suitably stripped during linking. See angular/components#23882 and angular/components#23907 PR Close angular#44113
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.




When a partially compiled component or directive is "linked" in JIT mode, the body
of its declaration is evaluated by the JavaScript runtime. If a class is referenced
in a query (e.g.
ViewQueryorContentQuery) but its definition is later in thefile, then the reference must be wrapped in a
forwardRef()call.Previously, query predicates were not wrapped correctly in partial declarations
causing the code to crash at runtime. In AOT mode, this code is never evaluated
but instead transformed as part of the build, so this bug did not become apparent
until Angular Material started running JIT mode tests on its distributable output.
This change fixes this problem by noting when queries are wrapped in
forwardRef()calls and ensuring that this gets passed through to partial compilation declarations
and then suitably stripped during linking.
See angular/components#23882 and angular/components#23907
Unfortunately, any libraries that were published before this gets merged will potentially have the problem going forward, if they have forwardRefs in their query definitions. The resolution it to simply build and release a new version. With that in mind, it might be worth landing this in 12.2.x LTS as well.
The text was updated successfully, but these errors were encountered: