Skip to content

Conversation

@leosvelperez
Copy link
Contributor

@leosvelperez leosvelperez commented Apr 27, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

The Angular Compatibility Compiler is removed in Angular 16 and therefore, ngcc is no longer available in users' workspaces. In some setups, ngcc is invoked in the postinstall script of the package.json. When updating Angular, in scenarios where postinstall is run (e.g. Nx migrations), this throws an error before a migration can remove the ngcc invocation. This makes the update process to be more complicated.

What is the new behavior?

ngcc is available as a no-op operation. When invoked, it will warn, providing details about removing ngcc. It gives some context at the tool level to folks who haven't caught up with news that ngcc was removed.

Note: In Angular 17, this will be removed.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

I chose to inline some slightly modified functionality from chalk for the colors in the console. I did that to avoid adding an extra dependency for this. I'm open to adding the dependency instead or implementing a different way to get colors in the console in a cross-platform way if preferred.

@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Apr 27, 2023
@leosvelperez leosvelperez marked this pull request as ready for review April 27, 2023 13:57
@pullapprove pullapprove bot requested a review from JoostK April 27, 2023 13:57
@leosvelperez leosvelperez changed the title feat(compiler-cli): add a no-op ngcc with a warning feat(compiler-cli): add back ngcc as a no-op with a warning Apr 27, 2023
@pkozlowski-opensource pkozlowski-opensource added action: review The PR is still awaiting reviews from at least one requested reviewer area: compiler Issues related to `ngc`, Angular's template compiler labels Apr 27, 2023
@ngbot ngbot bot added this to the Backlog milestone Apr 27, 2023
Copy link
Member

@JoostK JoostK left a comment

Choose a reason for hiding this comment

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

Thanks! Could you please change this to a refactor commit, as the current feat commit cannot be landed for 16.0-rc

@JoostK JoostK added the target: rc This PR is targeted for the next release-candidate label Apr 27, 2023
This commit adds back `ngcc` as a no-op operation. When invoked it will warn providing details about removing `ngcc`.

In Angular 17, this will be removed.
@leosvelperez leosvelperez force-pushed the feature/ngcc-warning branch from 44a89f2 to b3c1cda Compare April 27, 2023 18:09
@angular-robot angular-robot bot removed the detected: feature PR contains a feature commit label Apr 27, 2023
@leosvelperez leosvelperez requested review from JoostK and dgp1130 April 27, 2023 18:09
@leosvelperez leosvelperez changed the title feat(compiler-cli): add back ngcc as a no-op with a warning refactor(compiler-cli): add back ngcc as a no-op with a warning Apr 27, 2023
Copy link
Member

@JoostK JoostK left a comment

Choose a reason for hiding this comment

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

LGTM

@JoostK JoostK added action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 27, 2023
@JoostK
Copy link
Member

JoostK commented Apr 27, 2023

This shouldn't have any impact on g3, but let's run a presubmit regardless to know there's no sync conflicts.

Copy link
Contributor

@dgp1130 dgp1130 left a comment

Choose a reason for hiding this comment

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

Message looks good to me, I agree we shouldn't add a dependency for terminal coloring just for this so your solution looks fine.

@JoostK JoostK modified the milestones: Backlog, v16-final Apr 27, 2023
@pkozlowski-opensource pkozlowski-opensource added merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: presubmit The PR is in need of a google3 presubmit labels Apr 28, 2023
@pkozlowski-opensource
Copy link
Member

caretaker note: none of the files in this PR impacts G3, no need to run presubmit

@pkozlowski-opensource
Copy link
Member

This PR was merged into the repository by commit cfab3ad.

pkozlowski-opensource pushed a commit that referenced this pull request Apr 28, 2023
This commit adds back `ngcc` as a no-op operation. When invoked it will warn providing details about removing `ngcc`.

In Angular 17, this will be removed.

PR Close #50045
sr5434 pushed a commit to sr5434/angular that referenced this pull request May 3, 2023
…lar#50045)

This commit adds back `ngcc` as a no-op operation. When invoked it will warn providing details about removing `ngcc`.

In Angular 17, this will be removed.

PR Close angular#50045
@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 May 29, 2023
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: compiler Issues related to `ngc`, Angular's template compiler merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants