-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Several inject migration fixes #58393
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
…they are not combined in the internal migration When the internal mode for the `inject` migration is enabled, we find properties without initializers, we add their initializers and we prepend the `inject` calls before them. The remaining properties that couldn't be combined are left in place. This appears to break some internal cases. These changes work around the issue by hoisting all the non-combined members above the `inject()` calls. This should be safe, because they don't have initializers and as such can't have dependencies.
…super call in some cases Fixes an issue where the `inject` migration was generating and attempting to insert code after a `super` call, but the string buffering implementation was dropping it if the statement right after the `super` call was deleted as a result of the migration.
…ation properties initialized to identifiers Fixes that when the `inject` migration in internal mode was starting to visit the nodes one level down from the root when considering whether an expression contains local references. This lead it to skip over top-level identifiers and migrate some code incorrectly.
…s before super call Fixes that if a class has a `super` call, the `inject` migration would always insert the generated variable before it, even if there's other code before the `super` call.
devversion
approved these changes
Oct 28, 2024
This PR was merged into the repository by commit 4434f3c. The changes were merged into the following branches: main, 19.0.x |
alxhub
pushed a commit
that referenced
this pull request
Oct 28, 2024
…they are not combined in the internal migration (#58393) When the internal mode for the `inject` migration is enabled, we find properties without initializers, we add their initializers and we prepend the `inject` calls before them. The remaining properties that couldn't be combined are left in place. This appears to break some internal cases. These changes work around the issue by hoisting all the non-combined members above the `inject()` calls. This should be safe, because they don't have initializers and as such can't have dependencies. PR Close #58393
alxhub
pushed a commit
that referenced
this pull request
Oct 28, 2024
…super call in some cases (#58393) Fixes an issue where the `inject` migration was generating and attempting to insert code after a `super` call, but the string buffering implementation was dropping it if the statement right after the `super` call was deleted as a result of the migration. PR Close #58393
alxhub
pushed a commit
that referenced
this pull request
Oct 28, 2024
…ation properties initialized to identifiers (#58393) Fixes that when the `inject` migration in internal mode was starting to visit the nodes one level down from the root when considering whether an expression contains local references. This lead it to skip over top-level identifiers and migrate some code incorrectly. PR Close #58393
alxhub
pushed a commit
that referenced
this pull request
Oct 28, 2024
…super call in some cases (#58393) Fixes an issue where the `inject` migration was generating and attempting to insert code after a `super` call, but the string buffering implementation was dropping it if the statement right after the `super` call was deleted as a result of the migration. PR Close #58393
alxhub
pushed a commit
that referenced
this pull request
Oct 28, 2024
…ation properties initialized to identifiers (#58393) Fixes that when the `inject` migration in internal mode was starting to visit the nodes one level down from the root when considering whether an expression contains local references. This lead it to skip over top-level identifiers and migrate some code incorrectly. PR Close #58393
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 that fix issues raised during internal tests of the
inject
migration:refactor(migrations): hoist uninitialized members to top of class if they are not combined in the internal migration
When the internal mode for the
inject
migration is enabled, we find properties without initializers, we add their initializers and we prepend theinject
calls before them. The remaining properties that couldn't be combined are left in place. This appears to break some internal cases.These changes work around the issue by hoisting all the non-combined members above the
inject()
calls. This should be safe, because they don't have initializers and as such can't have dependencies.fix(migrations): inject migration not inserting generated code after super call in some cases
Fixes an issue where the
inject
migration was generating and attempting to insert code after asuper
call, but the string buffering implementation was dropping it if the statement right after thesuper
call was deleted as a result of the migration.refactor(migrations): inject migration internal mode incorrectly migration properties initialized to identifiers
Fixes that when the
inject
migration in internal mode was starting to visit the nodes one level down from the root when considering whether an expression contains local references. This lead it to skip over top-level identifiers and migrate some code incorrectly.fix(migrations): inject migration always inserting generated variables before super call
Fixes that if a class has a
super
call, theinject
migration would always insert the generated variable before it, even if there's other code before thesuper
call.