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
@ -6,12 +6,13 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {InjectableDef, defineInjectable} from '../../di/defs';
|
||||
import {defineInjectable, ɵInjectableDef} from '../../di/defs';
|
||||
import {Optional, SkipSelf} from '../../di/metadata';
|
||||
import {StaticProvider} from '../../di/provider';
|
||||
import {DefaultIterableDifferFactory} from '../differs/default_iterable_differ';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A type describing supported iterable types.
|
||||
*
|
||||
@ -137,7 +138,7 @@ export interface IterableDifferFactory {
|
||||
*
|
||||
*/
|
||||
export class IterableDiffers {
|
||||
static ngInjectableDef: InjectableDef<IterableDiffers> = defineInjectable({
|
||||
static ngInjectableDef: ɵInjectableDef<IterableDiffers> = defineInjectable({
|
||||
providedIn: 'root',
|
||||
factory: () => new IterableDiffers([new DefaultIterableDifferFactory()])
|
||||
});
|
||||
|
Reference in New Issue
Block a user