Skip to content

build: remove ngcc postinstall patch in favor of separate script #18355

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

Merged

Conversation

devversion
Copy link
Member

Currently we always patch ngcc as part of a postinstall patch. This is
because Ngcc does not overwrite the main field of processed packages.

Though, since we want to run nodejs_binary/nodejs_test targets with
Ivy, we need to either have custom module resolution, or just need to
update the package.json files to point to the NGCC processed bundles.

Implementing a custom module resolution for each of these target seems
rather incovenient and less reliable. Instead, we just ensure the
package.json files point to the right files.

Currently we achieve this by patching ngcc to always update the main
property. This patch is prone to upstream ngcc changes, so we move it
into a separate script that just runs after ngcc, and updates the
package.json files. The benfit of this is that ngcc doesn't need to
be patched, and upstream ngcc changes are not likely breaking the
components repo unit test (as seen in:
https://circleci.com/gh/angular/angular/608106).

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 31, 2020
@devversion devversion marked this pull request as ready for review January 31, 2020 17:06
@devversion devversion requested review from jelbourn and a team as code owners January 31, 2020 17:06
@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 31, 2020
@devversion
Copy link
Member Author

devversion commented Jan 31, 2020

Marking as P2 since it is needed for a framework PR that is blocked on this. angular/angular#35079

petebacondarwin added a commit to petebacondarwin/angular that referenced this pull request Jan 31, 2020
Disabling this job until the fix at
angular/components#18355 or similar lands.
mhevery pushed a commit to angular/angular that referenced this pull request Feb 1, 2020
Disabling this job until the fix at
angular/components#18355 or similar lands.

PR Close #35079
mhevery pushed a commit to angular/angular that referenced this pull request Feb 1, 2020
Disabling this job until the fix at
angular/components#18355 or similar lands.

PR Close #35079
Copy link
Contributor

@Splaktar Splaktar left a comment

Choose a reason for hiding this comment

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

LGTM

Currently we always patch `ngcc` as part of a postinstall patch. This is
because Ngcc does not overwrite the `main` field of processed packages.

Though, since we want to run `nodejs_binary`/`nodejs_test` targets with
Ivy, we need to either have custom module resolution, or just need to
update the `package.json` files to point to the NGCC processed bundles.

Implementing a custom module resolution for each of these target seems
rather incovenient and less reliable. Instead, we just ensure the
`package.json` files point to the right files.

Currently we achieve this by patching ngcc to always update the `main`
property. This patch is prone to upstream ngcc changes, so we move it
into a separate script that just runs _after_ ngcc, and updates the
`package.json` files. The benfit of this is that `ngcc` doesn't need to
be patched, and upstream ngcc changes are not likely breaking the
components repo unit test (as seen in:
https://circleci.com/gh/angular/angular/608106).
@devversion devversion force-pushed the build/more-reliable-ngcc-field-update branch from 405c9e1 to 34f4d91 Compare February 1, 2020 18:24
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 the action: merge The PR is ready for merge by the caretaker label Feb 3, 2020
@jelbourn jelbourn merged commit 2ec7254 into angular:master Feb 3, 2020
mmalerba pushed a commit that referenced this pull request Feb 5, 2020
)

Currently we always patch `ngcc` as part of a postinstall patch. This is
because Ngcc does not overwrite the `main` field of processed packages.

Though, since we want to run `nodejs_binary`/`nodejs_test` targets with
Ivy, we need to either have custom module resolution, or just need to
update the `package.json` files to point to the NGCC processed bundles.

Implementing a custom module resolution for each of these target seems
rather incovenient and less reliable. Instead, we just ensure the
`package.json` files point to the right files.

Currently we achieve this by patching ngcc to always update the `main`
property. This patch is prone to upstream ngcc changes, so we move it
into a separate script that just runs _after_ ngcc, and updates the
`package.json` files. The benfit of this is that `ngcc` doesn't need to
be patched, and upstream ngcc changes are not likely breaking the
components repo unit test (as seen in:
https://circleci.com/gh/angular/angular/608106).
yifange pushed a commit to yifange/components that referenced this pull request Feb 6, 2020
…ular#18355)

Currently we always patch `ngcc` as part of a postinstall patch. This is
because Ngcc does not overwrite the `main` field of processed packages.

Though, since we want to run `nodejs_binary`/`nodejs_test` targets with
Ivy, we need to either have custom module resolution, or just need to
update the `package.json` files to point to the NGCC processed bundles.

Implementing a custom module resolution for each of these target seems
rather incovenient and less reliable. Instead, we just ensure the
`package.json` files point to the right files.

Currently we achieve this by patching ngcc to always update the `main`
property. This patch is prone to upstream ngcc changes, so we move it
into a separate script that just runs _after_ ngcc, and updates the
`package.json` files. The benfit of this is that `ngcc` doesn't need to
be patched, and upstream ngcc changes are not likely breaking the
components repo unit test (as seen in:
https://circleci.com/gh/angular/angular/608106).
@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 Mar 5, 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.

6 participants