Skip to content

refactor: vendor used typescript ast utils from @schematics/angular #18155

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

Conversation

devversion
Copy link
Member

Instead of directly accessing utility functions from @schematics/angular, we should
vendor the AST utils we need. This is necessary because @schematics/angular vendors
TypeScript, and this causes a type mismatch if we try to pass in ts.Node's which are
created from the TypeScript version available to @angular/cdk/schematics.

Using the vendored TS version from @schematics/angular is not an
option as it complicates our setup, gives us less control, and will
be hard to consistently enforce in the schematic code. We tried
to do this with the version agnostic typescript code, but it
had downsides in terms of type safety and convenience.

Note: Marked as P2 as it is needed to unblock angular/angular#33717

Instead of directly accessing utility functions from `@schematics/angular`, we should
vendor the AST utils we need. This is necessary because `@schematics/angular` vendors
TypeScript, and this causes a type mismatch if we try to pass in `ts.Node`'s which are
created from the TypeScript version available to `@angular/cdk/schematics`.

Using the vendored TS version from `@schematics/angular` is not an
option as it complicates our setup, gives us less control, and will
be hard to consistently enforce in the schematic code. We tried
to do this with the `version agnostic typescript` code, but it
had downsides in terms of type safety and convenience.
@devversion devversion added P2 The issue is important to a large percentage of users, with a workaround pr: merge safe target: patch This PR is targeted for the next patch release labels Jan 11, 2020
@devversion devversion requested review from jelbourn and a team as code owners January 11, 2020 17:17
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 11, 2020
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jan 13, 2020
@jelbourn jelbourn merged commit 8aa38ac into angular:master Jan 13, 2020
yifange pushed a commit to yifange/components that referenced this pull request Jan 30, 2020
…ar (angular#18155)

Instead of directly accessing utility functions from `@schematics/angular`, we should
vendor the AST utils we need. This is necessary because `@schematics/angular` vendors
TypeScript, and this causes a type mismatch if we try to pass in `ts.Node`'s which are
created from the TypeScript version available to `@angular/cdk/schematics`.

Using the vendored TS version from `@schematics/angular` is not an
option as it complicates our setup, gives us less control, and will
be hard to consistently enforce in the schematic code. We tried
to do this with the `version agnostic typescript` code, but it
had downsides in terms of type safety and convenience.
@angular-automatic-lock-bot
Copy link

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 Feb 13, 2020
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 cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants