refactor(ivy): make return value of define(Component|Directive|Pipe|Injector|Injectable) private (#23371)
Ivy definition looks something like this: ``` class MyService { static ngInjectableDef = defineInjectable({ … }); } ``` Here the argument to `defineInjectable` is well known public contract which needs to be honored in backward compatible way between versions. The type of the return value of `defineInjectable` on the other hand is private and can change shape drastically between versions without effecting backwards compatibility of libraries publish to NPM. To our users it is effectively an `OpaqueToken`. By prefixing the type with `ɵ` we are communicating the the outside world that the value is not public API and is subject to change without backward compatibility. PR Close #23371
This commit is contained in:

committed by
Igor Minar

parent
f4017ce5e3
commit
2c09b707ce
@ -8,7 +8,7 @@
|
||||
|
||||
import {LifecycleHooksFeature, createComponentRef, getHostElement, getRenderedText, renderComponent, whenRendered} from './component';
|
||||
import {NgOnChangesFeature, PublicFeature, defineComponent, defineDirective, definePipe} from './definition';
|
||||
import {ComponentDef, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveType, PipeDef} from './interfaces/definition';
|
||||
import {ComponentTemplate, ComponentType, DirectiveDefFlags, DirectiveType, ɵComponentDef, ɵDirectiveDef, ɵPipeDef} from './interfaces/definition';
|
||||
|
||||
export {QUERY_READ_CONTAINER_REF, QUERY_READ_ELEMENT_REF, QUERY_READ_FROM_NODE, QUERY_READ_TEMPLATE_REF, directiveInject, injectAttribute, injectChangeDetectorRef, injectElementRef, injectTemplateRef, injectViewContainerRef} from './di';
|
||||
export {RenderFlags} from './interfaces/definition';
|
||||
@ -103,15 +103,15 @@ export {
|
||||
// clang-format on
|
||||
|
||||
export {
|
||||
ComponentDef,
|
||||
ɵComponentDef,
|
||||
ComponentTemplate,
|
||||
ComponentType,
|
||||
DirectiveDef,
|
||||
ɵDirectiveDef,
|
||||
DirectiveDefFlags,
|
||||
DirectiveType,
|
||||
NgOnChangesFeature,
|
||||
PublicFeature,
|
||||
PipeDef,
|
||||
ɵPipeDef,
|
||||
LifecycleHooksFeature,
|
||||
defineComponent,
|
||||
defineDirective,
|
||||
|
Reference in New Issue
Block a user