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 |
||
|---|---|---|
| .circleci | ||
| .devcontainer | ||
| .github | ||
| .husky | ||
| .ng-dev | ||
| .vscode | ||
| .yarn | ||
| aio | ||
| docs | ||
| goldens | ||
| integration | ||
| modules | ||
| packages | ||
| scripts | ||
| third_party | ||
| tools | ||
| .bazelignore | ||
| .bazelrc | ||
| .bazelversion | ||
| .clang-format | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmessage | ||
| .mailmap | ||
| .npmrc | ||
| .nvmrc | ||
| .prettierrc | ||
| .pullapprove.yml | ||
| .yarnrc | ||
| browser-providers.conf.js | ||
| BUILD.bazel | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| gulpfile.js | ||
| karma-js.conf.js | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| renovate.json | ||
| test-events.js | ||
| test-main.js | ||
| tsconfig-tslint.json | ||
| tslint.json | ||
| WORKSPACE | ||
| yarn.lock | ||
| yarn.lock.readme.md | ||
Angular - The modern web developer's platform.
Angular is a development platform for building mobile and desktop web applications
using Typescript/JavaScript and other languages.
Contributing Guidelines
·
Submit an Issue
·
Blog
Documentation
Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.
Advanced
Development Setup
Prerequisites
- Install Node.js which includes Node Package Manager
Setting Up a Project
Install the Angular CLI globally:
npm install -g @angular/cli
Create workspace:
ng new [PROJECT NAME]
Run the application:
cd [PROJECT NAME]
ng serve
Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.
Quickstart
Ecosystem
Changelog
Learn about the latest improvements.
Upgrading
Check out our upgrade guide to find out the best way to upgrade your project.
Contributing
Contributing Guidelines
Read through our contributing guidelines to learn about our submission process, coding rules and more.
Want to Help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.
Code of Conduct
Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.
Community
Join the conversation and help the community.
Love Angular? Give our repo a star ⭐ ⬆️.