-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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): enable dts bundling for Ivy packages #42728
Conversation
goldens/public-api/common/common.md
Outdated
@@ -262,7 +262,7 @@ export class KeyValuePipe implements PipeTransform { | |||
} | |||
|
|||
// @public | |||
export class Location { | |||
class Location_2 { |
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.
API extractor renames these to avoid clashes with globals variables.
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
Can you clarify the last commit message a bit? I found it a bit confusing.
Currently it says:
fix(compiler-cli): support reflecting local modules
With the recent change to enable Ivy DTS bundling, will convert local namespace imports to local modules such as the below;
```ts
declare namespace i1 {
export {
RouterOutletContract,
RouterOutlet
}
}
export declare class RouterModule {
constructor(guard: any, router: Router);
static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet...]>;
}
```
With this change we amend `reflectTypeEntityToDeclaration` to support this.
I believe that these "local modules" are what used to be called "internal modules" and are actually now referred to simply as "namespaces". This is compared to "external modules" which are now referred to as just "modules". See https://www.typescriptlang.org/docs/handbook/namespaces.html.
I think it would be helpful to explain the background motivation for this change. I.e that when the definition of a type is in a bundled d.ts file, then what were originally namespaced imports become namespace declarations within this file. And therefore this commit adds support for reflecting types that are defined in such namespace declarations.
@petebacondarwin, commit message updated. |
Perfect! Thanks. |
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. Worth capturing here that 56bd21d has been implemented to allow for this update to happen (due to the new alias exports being generated)
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! Thanks!
Reviewed-for: public-api, bazel, dev-infra
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 🍪
We can now allow Renovate to manage this dependency.
It is now possible to bundle DTS files of Ivy libraries since the blocker microsoft/rushstack#1029 has been addressed upstream.
DTS bundling, will cause originally namespaced imports become namespace declarations within the same file. Example: Before bundling ```ts import * as i1 from './router'; export declare class RouterModule { constructor(guard: any, router: Router); static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet...]>; } ``` After bundling ``` declare namespace i1 { export { RouterOutletContract, RouterOutlet } } export declare class RouterModule { constructor(guard: any, router: Router); static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet...]>; } ``` And therefore this commit adds support for reflecting types that are defined in such namespace declarations. Closes #42064
Caretaker: I am unable to remove the unnecessary reviews. |
It is now possible to bundle DTS files of Ivy libraries since the blocker microsoft/rushstack#1029 has been addressed upstream. PR Close #42728
DTS bundling, will cause originally namespaced imports become namespace declarations within the same file. Example: Before bundling ```ts import * as i1 from './router'; export declare class RouterModule { constructor(guard: any, router: Router); static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet...]>; } ``` After bundling ``` declare namespace i1 { export { RouterOutletContract, RouterOutlet } } export declare class RouterModule { constructor(guard: any, router: Router); static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet...]>; } ``` And therefore this commit adds support for reflecting types that are defined in such namespace declarations. Closes #42064 PR Close #42728
We can now allow Renovate to manage this dependency. PR Close #42728
It is now possible to bundle DTS files of Ivy libraries since the blocker microsoft/rushstack#1029 has been addressed upstream. PR Close #42728
DTS bundling, will cause originally namespaced imports become namespace declarations within the same file. Example: Before bundling ```ts import * as i1 from './router'; export declare class RouterModule { constructor(guard: any, router: Router); static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet...]>; } ``` After bundling ``` declare namespace i1 { export { RouterOutletContract, RouterOutlet } } export declare class RouterModule { constructor(guard: any, router: Router); static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet...]>; } ``` And therefore this commit adds support for reflecting types that are defined in such namespace declarations. Closes #42064 PR Close #42728
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. |
It is now possible to bundle DTS files of Ivy libraries since the blocker microsoft/rushstack#1029 has been addressed upstream.