angular/packages/compiler-cli/ngcc
Paul Gschwendtner 23118ef3d8 refactor(compiler-cli): fix ngcc cluster workers incorrectly being marked as busy with ESM (#43431)
Ngcc relies on cluster for distributing work. The master controller
sends messages to the workers as soon as the worker becomes `online`.
The online event is sent as part of the NodeJS cluster logic itself.

This does not work well because technically `online` could emit before the
worker started listening (this seems to be case now with ESM as the
imports are loaded in a way where `online` emits too early; before the
worker actually listens for messages).

We fix this by explicitly notifying the master when the worker
is ready for retrieving IPC messages/or tasks. This is more safe
anyway as it's not clearly specified when `online` emits.

PR Close #43431
2021-10-01 18:28:46 +00:00
..
src refactor(compiler-cli): fix ngcc cluster workers incorrectly being marked as busy with ESM (#43431) 2021-10-01 18:28:46 +00:00
test refactor(compiler-cli): fix ngcc cluster workers incorrectly being marked as busy with ESM (#43431) 2021-10-01 18:28:46 +00:00
BUILD.bazel refactor(compiler-cli): do not use __filename or __dirname global for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
index.ts refactor(compiler-cli): do not use __filename or __dirname global for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
main-ngcc.ts refactor: setup bundling for @angular/compiler-cli package (#43431) 2021-10-01 18:28:42 +00:00
README.md refactor(ivy): move ngcc into a higher level folder (#29092) 2019-03-20 14:45:54 -04:00

Angular Compatibility Compiler (ngcc)

This compiler will convert node_modules compiled with ngc, into node_modules which appear to have been compiled with ngtsc.

This conversion will allow such "legacy" packages to be used by the Ivy rendering engine.

Building

The project is built using Bazel:

yarn bazel build //packages/compiler-cli/ngcc

Unit Testing

The unit tests are built and run using Bazel:

yarn bazel test //packages/compiler-cli/ngcc/test

Integration Testing

There are tests that check the behavior of the overall executable:

yarn bazel test //packages/compiler-cli/ngcc/test:integration