Skip to content

Switch schematics to common import manager - #57096

Closed
crisbeto wants to merge 3 commits into
angular:mainfrom
crisbeto:schematics-import-manager
Closed

crisbeto wants to merge 3 commits into
angular:mainfrom
crisbeto:schematics-import-manager

Conversation

@crisbeto

Copy link
Copy Markdown
Member

Includes the following changes which allow us to delete one import manager implementation in favor of a common one.

refactor(compiler-cli): add alias option to the import manager

Updates the import manager to allow for a specific alias to be passed in. This is a prerequisite for switching schematics to the new import manager.

Note that passing in an alias disables identifier conflict resolution in order to avoid rewriting the alias that was passed in explicitly. For now this is fine since we have a very narrow use case for it, but we may want to revisit it in the future.

refactor(compiler-cli): import manager not picking up some options

Fixes that the ImportManager wasn't picking up some of its configuration options.

refactor(migrations): use common import manager for schematics

Updates the schematics to reuse the common ImportManager, instead of having to maintain a separate one.

@crisbeto crisbeto 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 Jul 23, 2024
@crisbeto
crisbeto requested a review from devversion July 23, 2024 12:47
@angular-robot angular-robot Bot added the area: migrations Issues related to `ng update`/`ng generate` migrations label Jul 23, 2024
@ngbot ngbot Bot added this to the Backlog milestone Jul 23, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can imagine this being inside the ImportManager as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, I was thinking this logic feels more specific to the schematic portion 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to have this in the ImportManager too, but it's also fairly basic.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Maybe it can be a set of common helpers in the import manager directory.

@devversion devversion left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! finally 😄 🎉

Comment thread packages/compiler-cli/src/ngtsc/translator/test/import_manager_spec.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, I was thinking this logic feels more specific to the schematic portion 😄

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Maybe it can be a set of common helpers in the import manager directory.

@crisbeto
crisbeto force-pushed the schematics-import-manager branch from ebb7058 to 39bde3b Compare July 23, 2024 16:22
crisbeto added 3 commits July 23, 2024 18:39
Updates the import manager to allow for a specific alias to be passed in. This is a prerequisite for switching schematics to the new import manager.

Note that passing in an alias disables identifier conflict resolution in order to avoid rewriting the alias that was passed in explicitly. For now this is fine since we have a very narrow use case for it, but we may want to revisit it in the future.
Fixes that the `ImportManager` wasn't picking up some of its configuration options.
Updates the schematics to reuse the common `ImportManager`, instead of having to maintain a separate one.
@crisbeto
crisbeto force-pushed the schematics-import-manager branch from 39bde3b to 4d7bf17 Compare July 23, 2024 16:39
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed 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 Jul 23, 2024
@atscott

atscott commented Jul 23, 2024

Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit bb977e0.

The changes were merged into the following branches: main

@atscott atscott closed this in 6cbcef2 Jul 23, 2024
atscott pushed a commit that referenced this pull request Jul 23, 2024
…57096)

Fixes that the `ImportManager` wasn't picking up some of its configuration options.

PR Close #57096
atscott pushed a commit that referenced this pull request Jul 23, 2024
Updates the schematics to reuse the common `ImportManager`, instead of having to maintain a separate one.

PR Close #57096
vladboisa pushed a commit to vladboisa/angular that referenced this pull request Jul 29, 2024
…ar#57096)

Updates the import manager to allow for a specific alias to be passed in. This is a prerequisite for switching schematics to the new import manager.

Note that passing in an alias disables identifier conflict resolution in order to avoid rewriting the alias that was passed in explicitly. For now this is fine since we have a very narrow use case for it, but we may want to revisit it in the future.

PR Close angular#57096
vladboisa pushed a commit to vladboisa/angular that referenced this pull request Jul 29, 2024
…ngular#57096)

Fixes that the `ImportManager` wasn't picking up some of its configuration options.

PR Close angular#57096
vladboisa pushed a commit to vladboisa/angular that referenced this pull request Jul 29, 2024
…ar#57096)

Updates the schematics to reuse the common `ImportManager`, instead of having to maintain a separate one.

PR Close angular#57096
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Aug 23, 2024
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`/`ng generate` migrations target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants