Repository navigation
refractor(core/compiler): hide internal types from generated code - #41119
petebacondarwin wants to merge 4 commits into
Conversation
5b63af6 to
e21501d
Compare
531a18a to
5f6faff
Compare
5f6faff to
7e7040f
Compare
57e7c91 to
68916e4
Compare
66511e3 to
485d849
Compare
There was a problem hiding this comment.
This one is interesting. The CtorDependency type isn't exported, nor should it be. Maybe @codeGenApi is more appropriate?
We should at some point include all types that govern the partial compilation output in golden files, in which case this type should be included, but the type itself shouldn't be publicly exported.
There was a problem hiding this comment.
So I would leave the @publicApi jsdoc tag on it. This tag really only indicates that it should appear in a golden file.
(The doc-gen doesn't care about it AFAIK.)
There was a problem hiding this comment.
I believe only exported types end up in the golden file, the @publicApi marker alone is not sufficient (notice how this PR doesn't update the goldens for @angular/core, whereas CtorDependency wasn't previously public)
There was a problem hiding this comment.
Yes, two hurdles must be overcome I believe: it must be exported from the barrel and marked with @publicApi.
The terminology use in the comments did not match the actual types being referred to.
…ias to `unknown` These types are only used in the generated typings files to provide information to the Angular compiler in order that it can compile code in downstream libraries and applications. This commit aliases these types to `unknown` to avoid exposing the previous alias types such as `ɵɵDirectiveDef`, which are internal to the compiler.
Th `ɵɵFactoryDef` type will appear in published libraries, via their typings files, to describe what type dependencies a DI factory has. The parameters on this type are used by tooling such as the Language Service to understand the DI dependencies of the class being created by the factory. This commit moves the type to the `public_definitions.ts` file alongside the other types that have a similar role, and it renames it to `ɵɵFactoryDeclaration` to align it with the other declaration types such as `ɵɵDirectiveDeclaration` and so on.
…orDef` in compiled output The `ɵɵInjectorDef` interface is internal and should not be published publicly as part of libraries. This commit updates the compiler to render an opaque type, `ɵɵInjectorDeclaration`, for this instead, which appears in the typings for compiled libraries.
2c8419b to
e9543b3
Compare
…ias to `unknown` (#41119) These types are only used in the generated typings files to provide information to the Angular compiler in order that it can compile code in downstream libraries and applications. This commit aliases these types to `unknown` to avoid exposing the previous alias types such as `ɵɵDirectiveDef`, which are internal to the compiler. PR Close #41119
Th `ɵɵFactoryDef` type will appear in published libraries, via their typings files, to describe what type dependencies a DI factory has. The parameters on this type are used by tooling such as the Language Service to understand the DI dependencies of the class being created by the factory. This commit moves the type to the `public_definitions.ts` file alongside the other types that have a similar role, and it renames it to `ɵɵFactoryDeclaration` to align it with the other declaration types such as `ɵɵDirectiveDeclaration` and so on. PR Close #41119
…orDef` in compiled output (#41119) The `ɵɵInjectorDef` interface is internal and should not be published publicly as part of libraries. This commit updates the compiler to render an opaque type, `ɵɵInjectorDeclaration`, for this instead, which appears in the typings for compiled libraries. PR Close #41119
The terminology use in the comments did not match the actual types being referred to. PR Close angular#41119
…ias to `unknown` (angular#41119) These types are only used in the generated typings files to provide information to the Angular compiler in order that it can compile code in downstream libraries and applications. This commit aliases these types to `unknown` to avoid exposing the previous alias types such as `ɵɵDirectiveDef`, which are internal to the compiler. PR Close angular#41119
…lar#41119) Th `ɵɵFactoryDef` type will appear in published libraries, via their typings files, to describe what type dependencies a DI factory has. The parameters on this type are used by tooling such as the Language Service to understand the DI dependencies of the class being created by the factory. This commit moves the type to the `public_definitions.ts` file alongside the other types that have a similar role, and it renames it to `ɵɵFactoryDeclaration` to align it with the other declaration types such as `ɵɵDirectiveDeclaration` and so on. PR Close angular#41119
…orDef` in compiled output (angular#41119) The `ɵɵInjectorDef` interface is internal and should not be published publicly as part of libraries. This commit updates the compiler to render an opaque type, `ɵɵInjectorDeclaration`, for this instead, which appears in the typings for compiled libraries. PR Close angular#41119
…claration` The other similar interfaces were renamed in angular#41119, but this one was left since it had existed before Ivy. It looks like the interface was never actually exposed on npm so it is safe to rename this one too.
…claration` The other similar interfaces were renamed in angular#41119, but this one was left since it had existed before Ivy. It looks like the interface was never actually exposed on npm so it is safe to rename this one too.
|
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. |
Fixes #40676
This PR is marked as
majorbecause the names of typings that appear in libraries compiled by ngcc have changed. This is not a breaking change for general developing (building and testing applications and libraries) but could affect 3rd party tooling who might have been relying upon these types generated by ngcc. By putting this commit in a major release (i.e. the forthcoming 12.0.0) it gives them time and warning to update the tooling to handle the change if necessary.This PR sits on top of #41080 so you only need to review from docs(core): fix typos in interface docs onwards.