-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
fix(bazel): do not use manifest paths for generated imports within compilation unit #35841
fix(bazel): do not use manifest paths for generated imports within compilation unit #35841
Conversation
36ba941
to
fe1fe4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This code is much too complicated. We will be able to replace this with ts_library with angular as a plugin in the future once we can drop
ViewEngine support.
Yep. Totally agreed. And yes! I'm waiting for that to happen. The current system is too complicated. I tried to improve this by adding comments. Also the fact that we rely on summaries, but not on metadata files, makes ngc-wrapped even more complicated. |
fe1fe4b
to
38df841
Compare
38df841
to
531cc12
Compare
531cc12
to
3d6ecfb
Compare
…mpilation unit Currently, the `ng_module` rule incorrectly uses manifest paths for generated imports from the Angular compiler. This breaks packaging as prodmode output (i.e. `esnext`) is copied in various targets (`es5` and `es2015`) to the npm package output. e.g. imports are generated like: _node_modules/my-pkg/es2015/imports/public-api.js_ ```ts import * as i1 from "angular/packages/bazel/test/ng_package/example/imports/second"; ``` while it should be actually: ```ts import * as i1 from "./second"; ``` The imports can, and should be relative so that the files are self-contained and do not rely on custom module resolution.
3d6ecfb
to
36a09a2
Compare
…mpilation unit (#35841) Currently, the `ng_module` rule incorrectly uses manifest paths for generated imports from the Angular compiler. This breaks packaging as prodmode output (i.e. `esnext`) is copied in various targets (`es5` and `es2015`) to the npm package output. e.g. imports are generated like: _node_modules/my-pkg/es2015/imports/public-api.js_ ```ts import * as i1 from "angular/packages/bazel/test/ng_package/example/imports/second"; ``` while it should be actually: ```ts import * as i1 from "./second"; ``` The imports can, and should be relative so that the files are self-contained and do not rely on custom module resolution. PR Close #35841
…mpilation unit (#35841) Currently, the `ng_module` rule incorrectly uses manifest paths for generated imports from the Angular compiler. This breaks packaging as prodmode output (i.e. `esnext`) is copied in various targets (`es5` and `es2015`) to the npm package output. e.g. imports are generated like: _node_modules/my-pkg/es2015/imports/public-api.js_ ```ts import * as i1 from "angular/packages/bazel/test/ng_package/example/imports/second"; ``` while it should be actually: ```ts import * as i1 from "./second"; ``` The imports can, and should be relative so that the files are self-contained and do not rely on custom module resolution. PR Close #35841
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently, the
ng_module
rule incorrectly uses manifest paths forgenerated imports from the Angular compiler.
This breaks packaging as prodmode output (i.e.
esnext
) is copied invarious targets (
es5
andes2015
) to the npm package output. Example:node_modules/my-pkg/es2015/imports/public-api.js
The above import is invalid in NPM and leaks information about the source project
structure. The import should be relative:
The imports can, and should be relative so that the files of the same compilation unit are self-contained and do not rely on custom module resolution.