Skip to content
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

refactor: remove abstract directive selector workaround #17476

Conversation

devversion
Copy link
Member

@devversion devversion commented Oct 23, 2019

Since we updated the minimum required Angular version, and
updated to Angular ^9.0.0-0, we can remove the workaround
for abstract directives. Previously we wanted to keep them
with a selector regardless of the installed version, because
we thought that we want to support ^8.0.0 of Angular.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 23, 2019
@devversion devversion force-pushed the refactor/remove-abstract-directive-workaround branch 3 times, most recently from bf0cf31 to ec6253c Compare October 23, 2019 08:32
@devversion
Copy link
Member Author

Removing this workaround unveiled two issues:

  1. Abstract directives do not work properly in ngtsc type checking.
    Fix: fix(ivy): support abstract directives in template type checking angular#33131
  2. Abstract directives behave differently between Ivy and View Engine.
    Potential fix: fix(compiler): do not throw when using abstract directive from other compilation unit angular#33347

@devversion devversion added the blocked This issue is blocked by some external factor, such as a prerequisite PR label Oct 23, 2019
@devversion
Copy link
Member Author

I think both of these things could be considered blockers for v9. So it might be worth prioritizing them in framework. cc. @jelbourn

@devversion devversion force-pushed the refactor/remove-abstract-directive-workaround branch from ec6253c to 540be42 Compare November 1, 2019 09:47
@devversion devversion added target: patch This PR is targeted for the next patch release and removed blocked This issue is blocked by some external factor, such as a prerequisite PR labels Nov 6, 2019
@devversion devversion added this to the 9.0.0 milestone Nov 6, 2019
@devversion devversion marked this pull request as ready for review November 6, 2019 10:35
@devversion devversion force-pushed the refactor/remove-abstract-directive-workaround branch from 540be42 to df88799 Compare November 6, 2019 10:36
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM. Also I think that you can remove some extra logic from the coercion types lint rule which looks for do-no-use- in the selector to determine whether a directive is abstract.

Since we updated the minimum required Angular version, and
updated to Angular v9.0.0-0, we can remove the workaround
for abstract directives. Previously we wanted to keep them
with a selector regardless of the installed version, because
we thought that we want to support ^8.0.0 of Angular.
@devversion devversion force-pushed the refactor/remove-abstract-directive-workaround branch from df88799 to db0d8b1 Compare November 6, 2019 11:53
@devversion devversion requested a review from a team as a code owner November 6, 2019 11:53
@devversion devversion added the action: merge The PR is ready for merge by the caretaker label Nov 6, 2019
}) :
null;
const selectorText =
selectorProp != null && ts.isStringLiteralLike(selectorProp.initializer) ?
Copy link
Member

Choose a reason for hiding this comment

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

We probably don't need to look at the selector's text, just that the property is defined. I think the compiler will throw if the selector is invalid as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

One could still set the selector to undefined, so I thought I'll cover that.

@mmalerba mmalerba merged commit 440b1b7 into angular:master Nov 8, 2019
@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 Dec 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: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants