-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Replace leftover modules with exports in tests #58627
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
Closed
Closed
Conversation
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
Currently the `getPotentialImportsFor` only accepts a `ClassDeclaration` as the context for generating an import, but that's not necessary because it doesn't require any class-specific information. These changes expand it to any `Node` so that it can be used when generating imports in testing declarations.
devversion
approved these changes
Nov 13, 2024
In angular#57684 the standalone migration was changed so that it replaces any leftover modules with their `exports`, in an attempt to preserve more working code. These changes expand that logic to also cover tests since it's somewhat common internally to only import a component's module without having any references to the component. Note that tests are a bit of a special case, because we don't have access to the template type checker, so instead we copy over all of the `exports` of that module.
23200bb
to
ba570cf
Compare
thePunderWoman
pushed a commit
that referenced
this pull request
Nov 13, 2024
Currently the `getPotentialImportsFor` only accepts a `ClassDeclaration` as the context for generating an import, but that's not necessary because it doesn't require any class-specific information. These changes expand it to any `Node` so that it can be used when generating imports in testing declarations. PR Close #58627
thePunderWoman
pushed a commit
that referenced
this pull request
Nov 13, 2024
#58627) In #57684 the standalone migration was changed so that it replaces any leftover modules with their `exports`, in an attempt to preserve more working code. These changes expand that logic to also cover tests since it's somewhat common internally to only import a component's module without having any references to the component. Note that tests are a bit of a special case, because we don't have access to the template type checker, so instead we copy over all of the `exports` of that module. PR Close #58627
thePunderWoman
pushed a commit
that referenced
this pull request
Nov 13, 2024
#58627) In #57684 the standalone migration was changed so that it replaces any leftover modules with their `exports`, in an attempt to preserve more working code. These changes expand that logic to also cover tests since it's somewhat common internally to only import a component's module without having any references to the component. Note that tests are a bit of a special case, because we don't have access to the template type checker, so instead we copy over all of the `exports` of that module. PR Close #58627
This PR was merged into the repository by commit 89256e6. The changes were merged into the following branches: main, 19.0.x |
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. |
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: migrations
Issues related to `ng update` migrations
target: rc
This PR is targeted for the next release-candidate
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.
Includes the following changes in an attempt to keep more tests working in the standalone migration:
refactor(compiler-cli): broaden type of getPotentialImportsFor
Currently the
getPotentialImportsFor
only accepts aClassDeclaration
as the context for generating an import, but that's not necessary because it doesn't require any class-specific information. These changes expand it to anyNode
so that it can be used when generating imports in testing declarations.fix(migrations): replace removed NgModules in tests with their exports
In #57684 the standalone migration was changed so that it replaces any leftover modules with their
exports
, in an attempt to preserve more working code. These changes expand that logic to also cover tests since it's somewhat common internally to only import a component's module without having any references to the component.Note that tests are a bit of a special case, because we don't have access to the template type checker, so instead we copy over all of the
exports
of that module.