mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Currently when `ngc-wrapped` runs in external/consumer workspaces, like in the Angular Components project, the `ngc-wrapped` binary relies on the linker due to the patched module resolution in `rules_nodejs` no longer being default. The reliance on the linker of `rules_nodejs` is problematic for workers as the required `node_modules` are not re-linked for every build. This was previously not an issue before the APF v13 changes because the `compiler-cli` module was loaded only once through an import statement. As of APF v13, the compiler-cli module is loaded dynamically for every build. This dynamic import can then break as the worker does not initially load the compiler-cli module when becoming online. Instead, the module is loaded on the first build where the node modules might not be linked properly anymore (due to e.g. other targets running at the same time). We fix thi issue by doing the following things: 1. Enabling the patched module resolution for consumer/external workspaces. This would match how we use ngc-wrapped inside FW as well. 2. Caching the compiler CLI module. Instead of re-fetching the module through dynamic imports for every build (in a worker), we should use the cached version. This is semantically the same as with APF v12 where a single import statement at file top-level was used. Technically, NodeJS should cache the module, but it doesn't hurt directly caching it as the module resolution will be patched by `rules_nodejs` and could perform unnecessary tasks. PR Close #43690 |
||
|---|---|---|
| .. | ||
| animations | ||
| bazel | ||
| benchpress | ||
| common | ||
| compiler | ||
| compiler-cli | ||
| core | ||
| docs | ||
| elements | ||
| examples | ||
| forms | ||
| language-service | ||
| localize | ||
| misc/angular-in-memory-web-api | ||
| platform-browser | ||
| platform-browser-dynamic | ||
| platform-server | ||
| private/testing | ||
| router | ||
| service-worker | ||
| upgrade | ||
| zone.js | ||
| BUILD.bazel | ||
| circular-deps-test.conf.js | ||
| empty.ts | ||
| goog.d.ts | ||
| license-banner.txt | ||
| README.md | ||
| system.d.ts | ||
| tsconfig-build.json | ||
| tsconfig-legacy-saucelabs.json | ||
| tsconfig-test.json | ||
| tsconfig-tsec-base.json | ||
| tsconfig.json | ||
| tsec-exemption.json | ||
| types.d.ts | ||
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT