Skip to content

refactor(schematics): do not depend on parse5 twice #13594

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

  • As we've already moved the ng-update foundation to the CDK, and therefore introduced an optionalDependency on parse5 for the CDK, we should also move the last parse5 call from @angular/material to the @angular/cdk. This way we don't depend on parse5 for both packages + we can re-use the abstract utility function within the CDK schematics if we need them.

  • The parse5 runtime check is actually not working because NodeJS would throw already if we just require("parse5"). Since we marked parse5 as a dependency and the default NodeJS module not found message is clear enough, we can remove this check from the ng-add command as well.

* As we've already moved the ng-update foundation to the CDK, and therefore introduced an `optionalDependency` on `parse5` for the CDK, we should also move the last `parse5` call from `@angular/material` to the `@angular/cdk`. This way we don't depend on `parse5` for both packages + we can re-use the abstract utility function within the CDK schematics if we need them.

* The `parse5` runtime check is actually not working because NodeJS would throw already if we just `require("parse5")`. Since we marked `parse5` as a dependency and the default NodeJS `module not found` message is clear enough, we can remove this check from the `ng-add` command as well.
@devversion devversion added pr: merge safe target: major This PR is targeted for the next major release labels Oct 12, 2018
@devversion devversion requested a review from jelbourn as a code owner October 12, 2018 19:36
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 12, 2018
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 Oct 12, 2018
@andrewseguin andrewseguin merged commit 3ee9b47 into angular:master Oct 15, 2018
roboshoes pushed a commit to roboshoes/material2 that referenced this pull request Oct 23, 2018
* As we've already moved the ng-update foundation to the CDK, and therefore introduced an `optionalDependency` on `parse5` for the CDK, we should also move the last `parse5` call from `@angular/material` to the `@angular/cdk`. This way we don't depend on `parse5` for both packages + we can re-use the abstract utility function within the CDK schematics if we need them.

* The `parse5` runtime check is actually not working because NodeJS would throw already if we just `require("parse5")`. Since we marked `parse5` as a dependency and the default NodeJS `module not found` message is clear enough, we can remove this check from the `ng-add` command as well.
@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 Sep 9, 2019
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 target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants