refactor(ivy): Move instructions back to ɵɵ (#30546)
There is an encoding issue with using delta `Δ`, where the browser will attempt to detect the file encoding if the character set is not explicitly declared on a `<script/>` tag, and Chrome will find the `Δ` character and decide it is window-1252 encoding, which misinterprets the `Δ` character to be some other character that is not a valid JS identifier character So back to the frog eyes we go. ``` __ /ɵɵ\ ( -- ) - I am ineffable. I am forever. _/ \_ / \ / \ == == == ``` PR Close #30546
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
import '../util/ng_dev_mode';
|
||||
|
||||
import {ChangeDetectionStrategy} from '../change_detection/constants';
|
||||
import {NG_INJECTABLE_DEF, ΔdefineInjectable} from '../di/interface/defs';
|
||||
import {NG_INJECTABLE_DEF, ɵɵdefineInjectable} from '../di/interface/defs';
|
||||
import {Mutable, Type} from '../interface/type';
|
||||
import {NgModuleDef} from '../metadata/ng_module';
|
||||
import {SchemaMetadata} from '../metadata/schema';
|
||||
@ -19,7 +19,7 @@ import {stringify} from '../util/stringify';
|
||||
|
||||
import {EMPTY_ARRAY, EMPTY_OBJ} from './empty';
|
||||
import {NG_BASE_DEF, NG_COMPONENT_DEF, NG_DIRECTIVE_DEF, NG_MODULE_DEF, NG_PIPE_DEF} from './fields';
|
||||
import {ComponentDef, ComponentDefFeature, ComponentTemplate, ComponentType, ContentQueriesFunction, DirectiveDef, DirectiveDefFeature, DirectiveType, DirectiveTypesOrFactory, FactoryFn, HostBindingsFunction, PipeDef, PipeType, PipeTypesOrFactory, ViewQueriesFunction, ΔBaseDef} from './interfaces/definition';
|
||||
import {ComponentDef, ComponentDefFeature, ComponentTemplate, ComponentType, ContentQueriesFunction, DirectiveDef, DirectiveDefFeature, DirectiveType, DirectiveTypesOrFactory, FactoryFn, HostBindingsFunction, PipeDef, PipeType, PipeTypesOrFactory, ViewQueriesFunction, ɵɵBaseDef} from './interfaces/definition';
|
||||
// while SelectorFlags is unused here, it's required so that types don't get resolved lazily
|
||||
// see: https://github.com/Microsoft/web-build-tools/issues/1050
|
||||
import {CssSelectorList, SelectorFlags} from './interfaces/projection';
|
||||
@ -42,7 +42,7 @@ let _renderCompCount = 0;
|
||||
* ```
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ΔdefineComponent<T>(componentDefinition: {
|
||||
export function ɵɵdefineComponent<T>(componentDefinition: {
|
||||
/**
|
||||
* Directive type, needed to configure the injector.
|
||||
*/
|
||||
@ -309,7 +309,7 @@ export function ΔdefineComponent<T>(componentDefinition: {
|
||||
// be retrieved through the node injector, so this isn't a problem.
|
||||
if (!type.hasOwnProperty(NG_INJECTABLE_DEF)) {
|
||||
(type as any)[NG_INJECTABLE_DEF] =
|
||||
ΔdefineInjectable<T>({factory: componentDefinition.factory as() => T});
|
||||
ɵɵdefineInjectable<T>({factory: componentDefinition.factory as() => T});
|
||||
}
|
||||
}) as never;
|
||||
|
||||
@ -319,7 +319,7 @@ export function ΔdefineComponent<T>(componentDefinition: {
|
||||
/**
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ΔsetComponentScope(
|
||||
export function ɵɵsetComponentScope(
|
||||
type: ComponentType<any>, directives: Type<any>[], pipes: Type<any>[]): void {
|
||||
const def = (type.ngComponentDef as ComponentDef<any>);
|
||||
def.directiveDefs = () => directives.map(extractDirectiveDef);
|
||||
@ -346,7 +346,7 @@ export function extractPipeDef(type: PipeType<any>): PipeDef<any> {
|
||||
/**
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ΔdefineNgModule<T>(def: {
|
||||
export function ɵɵdefineNgModule<T>(def: {
|
||||
/** Token representing the module. Used by DI. */
|
||||
type: T;
|
||||
|
||||
@ -394,7 +394,7 @@ export function ΔdefineNgModule<T>(def: {
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ΔsetNgModuleScope(type: any, scope: {
|
||||
export function ɵɵsetNgModuleScope(type: any, scope: {
|
||||
/** List of components, directives, and pipes declared by this module. */
|
||||
declarations?: Type<any>[] | (() => Type<any>[]);
|
||||
|
||||
@ -498,7 +498,7 @@ function invertObject<T>(
|
||||
* # Example
|
||||
* ```ts
|
||||
* class ShouldBeInherited {
|
||||
* static ngBaseDef = ΔdefineBase({
|
||||
* static ngBaseDef = ɵɵdefineBase({
|
||||
* ...
|
||||
* })
|
||||
* }
|
||||
@ -508,7 +508,7 @@ function invertObject<T>(
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ΔdefineBase<T>(baseDefinition: {
|
||||
export function ɵɵdefineBase<T>(baseDefinition: {
|
||||
/**
|
||||
* A map of input names.
|
||||
*
|
||||
@ -581,7 +581,7 @@ export function ΔdefineBase<T>(baseDefinition: {
|
||||
* Function executed by the parent template to allow children to apply host bindings.
|
||||
*/
|
||||
hostBindings?: HostBindingsFunction<T>;
|
||||
}): ΔBaseDef<T> {
|
||||
}): ɵɵBaseDef<T> {
|
||||
const declaredInputs: {[P in keyof T]: string} = {} as any;
|
||||
return {
|
||||
inputs: invertObject<T>(baseDefinition.inputs as any, declaredInputs),
|
||||
@ -601,7 +601,7 @@ export function ΔdefineBase<T>(baseDefinition: {
|
||||
* class MyDirective {
|
||||
* // Generated by Angular Template Compiler
|
||||
* // [Symbol] syntax will not be supported by TypeScript until v2.7
|
||||
* static ngDirectiveDef = ΔdefineDirective({
|
||||
* static ngDirectiveDef = ɵɵdefineDirective({
|
||||
* ...
|
||||
* });
|
||||
* }
|
||||
@ -609,7 +609,7 @@ export function ΔdefineBase<T>(baseDefinition: {
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export const ΔdefineDirective = ΔdefineComponent as any as<T>(directiveDefinition: {
|
||||
export const ɵɵdefineDirective = ɵɵdefineComponent as any as<T>(directiveDefinition: {
|
||||
/**
|
||||
* Directive type, needed to configure the injector.
|
||||
*/
|
||||
@ -727,7 +727,7 @@ export const ΔdefineDirective = ΔdefineComponent as any as<T>(directiveDefinit
|
||||
*
|
||||
* @codeGenApi
|
||||
*/
|
||||
export function ΔdefinePipe<T>(pipeDef: {
|
||||
export function ɵɵdefinePipe<T>(pipeDef: {
|
||||
/** Name of the pipe. Used for matching pipes in template to pipe defs. */
|
||||
name: string,
|
||||
|
||||
@ -766,7 +766,7 @@ export function getPipeDef<T>(type: any): PipeDef<T>|null {
|
||||
return (type as any)[NG_PIPE_DEF] || null;
|
||||
}
|
||||
|
||||
export function getBaseDef<T>(type: any): ΔBaseDef<T>|null {
|
||||
export function getBaseDef<T>(type: any): ɵɵBaseDef<T>|null {
|
||||
return (type as any)[NG_BASE_DEF] || null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user