refactor(ivy): use ɵɵ instead of Δ for now (#29850)
The `Δ` caused issue with other infrastructure, and we are temporarily changing it to `ɵɵ`. This commit also patches ts_api_guardian_test and AIO to understand `ɵɵ`. PR Close #29850
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
|
||||
|
||||
// API files are typescript
|
||||
readTypeScriptModules.basePath = API_SOURCE_PATH;
|
||||
readTypeScriptModules.ignoreExportsMatching = [/^[_Δ]|^VERSION$/];
|
||||
readTypeScriptModules.ignoreExportsMatching = [/^_|^ɵɵ|^VERSION$/];
|
||||
readTypeScriptModules.hidePrivateMembers = true;
|
||||
|
||||
// NOTE: This list should be in sync with tools/public_api_guard/BUILD.bazel
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ We explicitly don't consider the following to be our public API surface:
|
||||
|
||||
- any file/import paths within our package except for the `/`, `/testing` and `/bundles/*` and other documented package entry-points.
|
||||
- constructors of injectable classes (services and directives) - please use DI to obtain instances of these classes
|
||||
- any class members or symbols marked as `private`, or prefixed with underscore (`_`), [barred latin o](https://en.wikipedia.org/wiki/%C6%9F) (`ɵ`), and [greek delta](https://en.wikipedia.org/wiki/Delta_(letter)) (`Δ`).
|
||||
- any class members or symbols marked as `private`, or prefixed with underscore (`_`), [barred latin o](https://en.wikipedia.org/wiki/%C6%9F) (`ɵ`), and [double barred latin o](https://en.wikipedia.org/wiki/%C6%9F) (`ɵɵ`).
|
||||
- extending any of our classes unless the support for this is specifically documented in the API docs
|
||||
- the contents and API surface of the code generated by Angular's compiler (with one notable exception: the existence and name of `NgModuleFactory` instances exported from generated code is guaranteed)
|
||||
|
||||
|
||||
@@ -40,25 +40,25 @@ if [[ $? != 0 ]]; then exit 1; fi
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
|
||||
# Did it compile @angular/core/ApplicationModule correctly?
|
||||
grep "ApplicationModule.ngModuleDef = ΔdefineNgModule" node_modules/@angular/core/fesm2015/core.js
|
||||
grep "ApplicationModule.ngModuleDef = ɵɵdefineNgModule" node_modules/@angular/core/fesm2015/core.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
grep "ApplicationModule.ngModuleDef = ΔdefineNgModule" node_modules/@angular/core/fesm5/core.js
|
||||
grep "ApplicationModule.ngModuleDef = ɵɵdefineNgModule" node_modules/@angular/core/fesm5/core.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
grep "ApplicationModule.ngModuleDef = ɵngcc0.ΔdefineNgModule" node_modules/@angular/core/esm2015/src/application_module.js
|
||||
grep "ApplicationModule.ngModuleDef = ɵngcc0.ɵɵdefineNgModule" node_modules/@angular/core/esm2015/src/application_module.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
grep "ApplicationModule.ngModuleDef = ɵngcc0.ΔdefineNgModule" node_modules/@angular/core/esm5/src/application_module.js
|
||||
grep "ApplicationModule.ngModuleDef = ɵngcc0.ɵɵdefineNgModule" node_modules/@angular/core/esm5/src/application_module.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
|
||||
# Did it transform @angular/core typing files correctly?
|
||||
grep "import [*] as ɵngcc0 from './src/r3_symbols';" node_modules/@angular/core/core.d.ts
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
grep "static ngInjectorDef: ɵngcc0.ΔInjectorDef<ApplicationModule>;" node_modules/@angular/core/core.d.ts
|
||||
grep "static ngInjectorDef: ɵngcc0.ɵɵInjectorDef<ApplicationModule>;" node_modules/@angular/core/core.d.ts
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
|
||||
# Did it generate a base factory call for synthesized constructors correctly?
|
||||
grep "const ɵMatTable_BaseFactory = ɵngcc0.ΔgetInheritedFactory(MatTable);" node_modules/@angular/material/esm2015/table.js
|
||||
grep "const ɵMatTable_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm2015/table.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
grep "const ɵMatTable_BaseFactory = ɵngcc0.ΔgetInheritedFactory(MatTable);" node_modules/@angular/material/esm5/table.es5.js
|
||||
grep "const ɵMatTable_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm5/table.es5.js
|
||||
if [[ $? != 0 ]]; then exit 1; fi
|
||||
|
||||
# Can it be safely run again (as a noop)?
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ɵRenderFlags, ɵrenderComponent as renderComponent, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔdefineComponent, ΔelementEnd, ΔelementStart, ΔelementStyleProp, ΔelementStyling, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation1, Δtext, ΔtextBinding} from '@angular/core';
|
||||
import {ɵRenderFlags, ɵrenderComponent as renderComponent, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdefineComponent, ɵɵelementEnd, ɵɵelementStart, ɵɵelementStyleProp, ɵɵelementStyling, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵtext, ɵɵtextBinding} from '@angular/core';
|
||||
|
||||
import {bindAction, profile} from '../../util';
|
||||
import {createDom, destroyDom, detectChanges} from '../render3/tree';
|
||||
@@ -18,7 +18,7 @@ export class TreeFunction {
|
||||
data: TreeNode = emptyTree;
|
||||
|
||||
/** @nocollapse */
|
||||
static ngComponentDef = ΔdefineComponent({
|
||||
static ngComponentDef = ɵɵdefineComponent({
|
||||
type: TreeFunction,
|
||||
selectors: [['tree']],
|
||||
consts: 5,
|
||||
@@ -35,38 +35,38 @@ export class TreeFunction {
|
||||
const c1 = ['background-color'];
|
||||
export function TreeTpl(rf: ɵRenderFlags, ctx: TreeNode) {
|
||||
if (rf & ɵRenderFlags.Create) {
|
||||
ΔelementStart(0, 'tree');
|
||||
ɵɵelementStart(0, 'tree');
|
||||
{
|
||||
ΔelementStart(1, 'span');
|
||||
ΔelementStyling(null, c1);
|
||||
{ Δtext(2); }
|
||||
ΔelementEnd();
|
||||
Δcontainer(3);
|
||||
Δcontainer(4);
|
||||
ɵɵelementStart(1, 'span');
|
||||
ɵɵelementStyling(null, c1);
|
||||
{ ɵɵtext(2); }
|
||||
ɵɵelementEnd();
|
||||
ɵɵcontainer(3);
|
||||
ɵɵcontainer(4);
|
||||
}
|
||||
ΔelementEnd();
|
||||
ɵɵelementEnd();
|
||||
}
|
||||
if (rf & ɵRenderFlags.Update) {
|
||||
ΔelementStyleProp(1, 0, ctx.depth % 2 ? '' : 'grey');
|
||||
ΔtextBinding(2, Δinterpolation1(' ', ctx.value, ' '));
|
||||
ΔcontainerRefreshStart(3);
|
||||
ɵɵelementStyleProp(1, 0, ctx.depth % 2 ? '' : 'grey');
|
||||
ɵɵtextBinding(2, ɵɵinterpolation1(' ', ctx.value, ' '));
|
||||
ɵɵcontainerRefreshStart(3);
|
||||
{
|
||||
if (ctx.left != null) {
|
||||
let rf0 = ΔembeddedViewStart(0, 5, 1);
|
||||
let rf0 = ɵɵembeddedViewStart(0, 5, 1);
|
||||
{ TreeTpl(rf0, ctx.left); }
|
||||
ΔembeddedViewEnd();
|
||||
ɵɵembeddedViewEnd();
|
||||
}
|
||||
}
|
||||
ΔcontainerRefreshEnd();
|
||||
ΔcontainerRefreshStart(4);
|
||||
ɵɵcontainerRefreshEnd();
|
||||
ɵɵcontainerRefreshStart(4);
|
||||
{
|
||||
if (ctx.right != null) {
|
||||
let rf0 = ΔembeddedViewStart(0, 5, 1);
|
||||
let rf0 = ɵɵembeddedViewStart(0, 5, 1);
|
||||
{ TreeTpl(rf0, ctx.right); }
|
||||
ΔembeddedViewEnd();
|
||||
ɵɵembeddedViewEnd();
|
||||
}
|
||||
}
|
||||
ΔcontainerRefreshEnd();
|
||||
ɵɵcontainerRefreshEnd();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ΔdefineDirective, ΔelementHostStyling, ΔelementHostStylingApply, ΔelementHostStylingMap} from '@angular/core';
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ɵɵdefineDirective, ɵɵelementHostStyling, ɵɵelementHostStylingApply, ɵɵelementHostStylingMap} from '@angular/core';
|
||||
|
||||
import {NgClassImpl, NgClassImplProvider} from './ng_class_impl';
|
||||
|
||||
@@ -29,17 +29,17 @@ export const ngClassDirectiveDef__PRE_R3__ = undefined;
|
||||
// used when the VE is not present (note the directive will
|
||||
// never be instantiated normally because it is apart of a
|
||||
// base class)
|
||||
export const ngClassDirectiveDef__POST_R3__ = ΔdefineDirective({
|
||||
export const ngClassDirectiveDef__POST_R3__ = ɵɵdefineDirective({
|
||||
type: function() {} as any,
|
||||
selectors: null as any,
|
||||
factory: () => {},
|
||||
hostBindings: function(rf: ɵRenderFlags, ctx: any, elIndex: number) {
|
||||
if (rf & ɵRenderFlags.Create) {
|
||||
ΔelementHostStyling();
|
||||
ɵɵelementHostStyling();
|
||||
}
|
||||
if (rf & ɵRenderFlags.Update) {
|
||||
ΔelementHostStylingMap(ctx.getValue());
|
||||
ΔelementHostStylingApply();
|
||||
ɵɵelementHostStylingMap(ctx.getValue());
|
||||
ɵɵelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ΔdefineDirective, ΔelementHostStyling, ΔelementHostStylingApply, ΔelementHostStylingMap} from '@angular/core';
|
||||
import {Directive, DoCheck, Input, ɵRenderFlags, ɵɵdefineDirective, ɵɵelementHostStyling, ɵɵelementHostStylingApply, ɵɵelementHostStylingMap} from '@angular/core';
|
||||
|
||||
import {NgStyleImpl, NgStyleImplProvider} from './ng_style_impl';
|
||||
|
||||
@@ -29,17 +29,17 @@ export const ngStyleDirectiveDef__PRE_R3__ = undefined;
|
||||
// used when the VE is not present (note the directive will
|
||||
// never be instantiated normally because it is apart of a
|
||||
// base class)
|
||||
export const ngStyleDirectiveDef__POST_R3__ = ΔdefineDirective({
|
||||
export const ngStyleDirectiveDef__POST_R3__ = ɵɵdefineDirective({
|
||||
type: function() {} as any,
|
||||
selectors: null as any,
|
||||
factory: () => {},
|
||||
hostBindings: function(rf: ɵRenderFlags, ctx: any, elIndex: number) {
|
||||
if (rf & ɵRenderFlags.Create) {
|
||||
ΔelementHostStyling();
|
||||
ɵɵelementHostStyling();
|
||||
}
|
||||
if (rf & ɵRenderFlags.Update) {
|
||||
ΔelementHostStylingMap(null, ctx.getValue());
|
||||
ΔelementHostStylingApply();
|
||||
ɵɵelementHostStylingMap(null, ctx.getValue());
|
||||
ɵɵelementHostStylingApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ErrorHandler, ΔdefineInjectable, Δinject} from '@angular/core';
|
||||
import {ErrorHandler, ɵɵdefineInjectable, ɵɵinject} from '@angular/core';
|
||||
|
||||
import {DOCUMENT} from './dom_tokens';
|
||||
|
||||
@@ -21,9 +21,9 @@ export abstract class ViewportScroller {
|
||||
// De-sugared tree-shakable injection
|
||||
// See #23917
|
||||
/** @nocollapse */
|
||||
static ngInjectableDef = ΔdefineInjectable({
|
||||
static ngInjectableDef = ɵɵdefineInjectable({
|
||||
providedIn: 'root',
|
||||
factory: () => new BrowserViewportScroller(Δinject(DOCUMENT), window, Δinject(ErrorHandler))
|
||||
factory: () => new BrowserViewportScroller(ɵɵinject(DOCUMENT), window, ɵɵinject(ErrorHandler))
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -152,11 +152,11 @@ describe('Renderer', () => {
|
||||
const addDefinitionsSpy = renderer.addDefinitions as jasmine.Spy;
|
||||
expect(addDefinitionsSpy.calls.first().args[2])
|
||||
.toEqual(
|
||||
`A.ngComponentDef = ɵngcc0.ΔdefineComponent({ type: A, selectors: [["a"]], factory: function A_Factory(t) { return new (t || A)(); }, consts: 1, vars: 1, template: function A_Template(rf, ctx) { if (rf & 1) {
|
||||
ɵngcc0.Δtext(0);
|
||||
`A.ngComponentDef = ɵngcc0.ɵɵdefineComponent({ type: A, selectors: [["a"]], factory: function A_Factory(t) { return new (t || A)(); }, consts: 1, vars: 1, template: function A_Template(rf, ctx) { if (rf & 1) {
|
||||
ɵngcc0.ɵɵtext(0);
|
||||
} if (rf & 2) {
|
||||
ɵngcc0.Δselect(0);
|
||||
ɵngcc0.ΔtextBinding(0, ɵngcc0.Δinterpolation1("", ctx.person.name, ""));
|
||||
ɵngcc0.ɵɵselect(0);
|
||||
ɵngcc0.ɵɵtextBinding(0, ɵngcc0.ɵɵinterpolation1("", ctx.person.name, ""));
|
||||
} }, encapsulation: 2 });
|
||||
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
|
||||
type: Component,
|
||||
@@ -197,7 +197,7 @@ describe('Renderer', () => {
|
||||
}));
|
||||
expect(addDefinitionsSpy.calls.first().args[2])
|
||||
.toEqual(
|
||||
`A.ngDirectiveDef = ɵngcc0.ΔdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });
|
||||
`A.ngDirectiveDef = ɵngcc0.ɵɵdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });
|
||||
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
|
||||
type: Directive,
|
||||
args: [{ selector: '[a]' }]
|
||||
@@ -331,7 +331,7 @@ describe('Renderer', () => {
|
||||
const typingsFile = result.find(f => f.path === '/typings/file.d.ts') !;
|
||||
expect(typingsFile.contents)
|
||||
.toContain(
|
||||
'foo(x: number): number;\n static ngDirectiveDef: ɵngcc0.ΔDirectiveDefWithMeta');
|
||||
'foo(x: number): number;\n static ngDirectiveDef: ɵngcc0.ɵɵDirectiveDefWithMeta');
|
||||
});
|
||||
|
||||
it('should render imports into typings files', () => {
|
||||
|
||||
@@ -423,7 +423,7 @@ export class MetadataBundler {
|
||||
result[key] = this.convertFunction(moduleName, value);
|
||||
} else if (isMetadataSymbolicCallExpression(value)) {
|
||||
// Class members can also contain static members that call a function with module
|
||||
// references. e.g. "static ngInjectableDef = ΔdefineInjectable(..)". We also need to
|
||||
// references. e.g. "static ngInjectableDef = ɵɵdefineInjectable(..)". We also need to
|
||||
// convert these module references because otherwise these resolve to non-existent files.
|
||||
result[key] = this.convertValue(moduleName, value);
|
||||
} else {
|
||||
|
||||
@@ -48,15 +48,15 @@ export class NoopImportRewriter implements ImportRewriter {
|
||||
* which they're exported from r3_symbols.
|
||||
*/
|
||||
const CORE_SUPPORTED_SYMBOLS = new Map<string, string>([
|
||||
['ΔdefineInjectable', 'ΔdefineInjectable'],
|
||||
['ΔdefineInjector', 'ΔdefineInjector'],
|
||||
['ΔdefineNgModule', 'ΔdefineNgModule'],
|
||||
['ΔsetNgModuleScope', 'ΔsetNgModuleScope'],
|
||||
['Δinject', 'Δinject'],
|
||||
['ɵɵdefineInjectable', 'ɵɵdefineInjectable'],
|
||||
['ɵɵdefineInjector', 'ɵɵdefineInjector'],
|
||||
['ɵɵdefineNgModule', 'ɵɵdefineNgModule'],
|
||||
['ɵɵsetNgModuleScope', 'ɵɵsetNgModuleScope'],
|
||||
['ɵɵinject', 'ɵɵinject'],
|
||||
['ɵsetClassMetadata', 'setClassMetadata'],
|
||||
['ΔInjectableDef', 'ΔInjectableDef'],
|
||||
['ΔInjectorDef', 'ΔInjectorDef'],
|
||||
['ΔNgModuleDefWithMeta', 'ΔNgModuleDefWithMeta'],
|
||||
['ɵɵInjectableDef', 'ɵɵInjectableDef'],
|
||||
['ɵɵInjectorDef', 'ɵɵInjectorDef'],
|
||||
['ɵɵNgModuleDefWithMeta', 'ɵɵNgModuleDefWithMeta'],
|
||||
['ɵNgModuleFactory', 'NgModuleFactory'],
|
||||
]);
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ describe('mock_compiler', () => {
|
||||
expectEmit(
|
||||
result.source, `
|
||||
// TODO: this comment should not be taken into account
|
||||
$r3$.Δtext(0, "Hello!");
|
||||
$r3$.ɵɵtext(0, "Hello!");
|
||||
// TODO: this comment should not be taken into account
|
||||
`,
|
||||
'todo comments should be ignored');
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,13 +39,13 @@ describe('compiler compliance: bindings', () => {
|
||||
const template = `
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.Δtext(1);
|
||||
$i0$.ΔelementEnd();
|
||||
$i0$.ɵɵelementStart(0, "div");
|
||||
$i0$.ɵɵtext(1);
|
||||
$i0$.ɵɵelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.Δselect(1);
|
||||
$i0$.ΔtextBinding(1, $i0$.Δinterpolation1("Hello ", $ctx$.name, ""));
|
||||
$r3$.ɵɵselect(1);
|
||||
$i0$.ɵɵtextBinding(1, $i0$.ɵɵinterpolation1("Hello ", $ctx$.name, ""));
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
@@ -78,11 +78,11 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.Δelement(0, "a", $e0_attrs$);
|
||||
$i0$.ɵɵelement(0, "a", $e0_attrs$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "title", $i0$.Δbind($ctx$.title));
|
||||
$i0$.ɵɵselect(0);
|
||||
$i0$.ɵɵelementProperty(0, "title", $i0$.ɵɵbind($ctx$.title));
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
@@ -113,11 +113,11 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.Δelement(0, "a", $e0_attrs$);
|
||||
$i0$.ɵɵelement(0, "a", $e0_attrs$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "title", $i0$.Δinterpolation1("Hello ", $ctx$.name, ""));
|
||||
$i0$.ɵɵselect(0);
|
||||
$i0$.ɵɵelementProperty(0, "title", $i0$.ɵɵinterpolation1("Hello ", $ctx$.name, ""));
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
@@ -138,7 +138,7 @@ describe('compiler compliance: bindings', () => {
|
||||
}
|
||||
};
|
||||
const result = compile(files, angularFiles);
|
||||
expect(result.source).not.toContain('i0.ΔelementProperty');
|
||||
expect(result.source).not.toContain('i0.ɵɵelementProperty');
|
||||
});
|
||||
|
||||
it('should not remap property names whose names do not correspond to their attribute names',
|
||||
@@ -170,11 +170,11 @@ describe('compiler compliance: bindings', () => {
|
||||
|
||||
function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.Δelement(0, "label", _c0);
|
||||
$i0$.ɵɵelement(0, "label", _c0);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "for", $i0$.Δbind(ctx.forValue));
|
||||
$i0$.ɵɵselect(0);
|
||||
$i0$.ɵɵelementProperty(0, "for", $i0$.ɵɵbind(ctx.forValue));
|
||||
}
|
||||
}`;
|
||||
|
||||
@@ -204,16 +204,16 @@ describe('compiler compliance: bindings', () => {
|
||||
};
|
||||
|
||||
const HostBindingDirDeclaration = `
|
||||
HostBindingDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
HostBindingDir.ngDirectiveDef = $r3$.ɵɵdefineDirective({
|
||||
type: HostBindingDir,
|
||||
selectors: [["", "hostBindingDir", ""]],
|
||||
factory: function HostBindingDir_Factory(t) { return new (t || HostBindingDir)(); },
|
||||
hostBindings: function HostBindingDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔallocHostVars(1);
|
||||
$r3$.ɵɵallocHostVars(1);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ΔelementProperty(elIndex, "id", $r3$.Δbind(ctx.dirId), null, true);
|
||||
$r3$.ɵɵelementProperty(elIndex, "id", $r3$.ɵɵbind(ctx.dirId), null, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -251,16 +251,16 @@ describe('compiler compliance: bindings', () => {
|
||||
const HostBindingCompDeclaration = `
|
||||
const $ff$ = function ($v$) { return ["red", $v$]; };
|
||||
…
|
||||
HostBindingComp.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
HostBindingComp.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
type: HostBindingComp,
|
||||
selectors: [["host-binding-comp"]],
|
||||
factory: function HostBindingComp_Factory(t) { return new (t || HostBindingComp)(); },
|
||||
hostBindings: function HostBindingComp_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔallocHostVars(3);
|
||||
$r3$.ɵɵallocHostVars(3);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ΔelementProperty(elIndex, "id", $r3$.Δbind($r3$.ΔpureFunction1(1, $ff$, ctx.id)), null, true);
|
||||
$r3$.ɵɵelementProperty(elIndex, "id", $r3$.ɵɵbind($r3$.ɵɵpureFunction1(1, $ff$, ctx.id)), null, true);
|
||||
}
|
||||
},
|
||||
consts: 0,
|
||||
@@ -299,16 +299,16 @@ describe('compiler compliance: bindings', () => {
|
||||
};
|
||||
|
||||
const HostAttributeDirDeclaration = `
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ɵɵdefineDirective({
|
||||
type: HostAttributeDir,
|
||||
selectors: [["", "hostAttributeDir", ""]],
|
||||
factory: function HostAttributeDir_Factory(t) { return new (t || HostAttributeDir)(); },
|
||||
hostBindings: function HostAttributeDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔallocHostVars(1);
|
||||
$r3$.ɵɵallocHostVars(1);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ΔelementAttribute(elIndex, "required", $r3$.Δbind(ctx.required));
|
||||
$r3$.ɵɵelementAttribute(elIndex, "required", $r3$.ɵɵbind(ctx.required));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -344,13 +344,13 @@ describe('compiler compliance: bindings', () => {
|
||||
const HostAttributeDirDeclaration = `
|
||||
const $c0$ = ["aria-label", "label"];
|
||||
…
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ɵɵdefineDirective({
|
||||
type: HostAttributeDir,
|
||||
selectors: [["", "hostAttributeDir", ""]],
|
||||
factory: function HostAttributeDir_Factory(t) { return new (t || HostAttributeDir)(); },
|
||||
hostBindings: function HostAttributeDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔelementHostAttrs($c0$);
|
||||
$r3$.ɵɵelementHostAttrs($c0$);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -402,25 +402,25 @@ describe('compiler compliance: bindings', () => {
|
||||
const $c0$ = ["title", "hello there from component", ${AttributeMarker.Styles}, "opacity", "1"];
|
||||
const $c1$ = ["title", "hello there from directive", ${AttributeMarker.Classes}, "one", "two", ${AttributeMarker.Styles}, "width", "200px", "height", "500px"];
|
||||
…
|
||||
HostAttributeComp.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
HostAttributeComp.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
type: HostAttributeComp,
|
||||
selectors: [["my-host-attribute-component"]],
|
||||
factory: function HostAttributeComp_Factory(t) { return new (t || HostAttributeComp)(); },
|
||||
hostBindings: function HostAttributeComp_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔelementHostAttrs($c0$);
|
||||
$r3$.ɵɵelementHostAttrs($c0$);
|
||||
…
|
||||
}
|
||||
…
|
||||
}
|
||||
…
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ΔdefineDirective({
|
||||
HostAttributeDir.ngDirectiveDef = $r3$.ɵɵdefineDirective({
|
||||
type: HostAttributeDir,
|
||||
selectors: [["", "hostAttributeDir", ""]],
|
||||
factory: function HostAttributeDir_Factory(t) { return new (t || HostAttributeDir)(); },
|
||||
hostBindings: function HostAttributeDir_HostBindings(rf, ctx, elIndex) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔelementHostAttrs($c1$);
|
||||
$r3$.ɵɵelementHostAttrs($c1$);
|
||||
…
|
||||
}
|
||||
…
|
||||
@@ -466,19 +466,19 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ΔelementStart(0, "b", $_c0$, $_c1$);
|
||||
$i0$.ΔdisableBindings();
|
||||
$i0$.ΔelementStart(2, "i");
|
||||
$i0$.Δtext(3, "Hello {{ name }}!");
|
||||
$i0$.ΔelementEnd();
|
||||
$i0$.ΔenableBindings();
|
||||
$i0$.ΔelementEnd();
|
||||
$i0$.Δtext(4);
|
||||
$i0$.ɵɵelementStart(0, "b", $_c0$, $_c1$);
|
||||
$i0$.ɵɵdisableBindings();
|
||||
$i0$.ɵɵelementStart(2, "i");
|
||||
$i0$.ɵɵtext(3, "Hello {{ name }}!");
|
||||
$i0$.ɵɵelementEnd();
|
||||
$i0$.ɵɵenableBindings();
|
||||
$i0$.ɵɵelementEnd();
|
||||
$i0$.ɵɵtext(4);
|
||||
}
|
||||
if (rf & 2) {
|
||||
const $_r0$ = $i0$.Δreference(1);
|
||||
$r3$.Δselect(4);
|
||||
$i0$.ΔtextBinding(4, $i0$.Δinterpolation1(" ", $_r0$.id, " "));
|
||||
const $_r0$ = $i0$.ɵɵreference(1);
|
||||
$r3$.ɵɵselect(4);
|
||||
$i0$.ɵɵtextBinding(4, $i0$.ɵɵinterpolation1(" ", $_r0$.id, " "));
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -498,12 +498,12 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.ΔdisableBindings();
|
||||
$i0$.Δelement(1, "input", $_c0$);
|
||||
$i0$.Δtext(2, " {{ myInput.value }} ");
|
||||
$i0$.ΔenableBindings();
|
||||
$i0$.ΔelementEnd();
|
||||
$i0$.ɵɵelementStart(0, "div");
|
||||
$i0$.ɵɵdisableBindings();
|
||||
$i0$.ɵɵelement(1, "input", $_c0$);
|
||||
$i0$.ɵɵtext(2, " {{ myInput.value }} ");
|
||||
$i0$.ɵɵenableBindings();
|
||||
$i0$.ɵɵelementEnd();
|
||||
}
|
||||
`;
|
||||
const result = compile(files, angularFiles);
|
||||
@@ -522,11 +522,11 @@ describe('compiler compliance: bindings', () => {
|
||||
…
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.ΔdisableBindings();
|
||||
$i0$.Δelement(1, "div", $_c0$);
|
||||
$i0$.ΔenableBindings();
|
||||
$i0$.ΔelementEnd();
|
||||
$i0$.ɵɵelementStart(0, "div");
|
||||
$i0$.ɵɵdisableBindings();
|
||||
$i0$.ɵɵelement(1, "div", $_c0$);
|
||||
$i0$.ɵɵenableBindings();
|
||||
$i0$.ɵɵelementEnd();
|
||||
}
|
||||
`;
|
||||
const result = compile(files, angularFiles);
|
||||
@@ -541,7 +541,7 @@ describe('compiler compliance: bindings', () => {
|
||||
const template = `
|
||||
template:function MyComponent_Template(rf, $ctx$){
|
||||
if (rf & 1) {
|
||||
$i0$.Δelement(0, "div");
|
||||
$i0$.ɵɵelement(0, "div");
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -50,13 +50,13 @@ describe('compiler compliance: dependency injection', () => {
|
||||
const factory = `
|
||||
factory: function MyComponent_Factory(t) {
|
||||
return new (t || MyComponent)(
|
||||
$r3$.ΔinjectAttribute('name'),
|
||||
$r3$.ΔdirectiveInject(MyService),
|
||||
$r3$.ΔdirectiveInject(MyService, 1),
|
||||
$r3$.ΔdirectiveInject(MyService, 2),
|
||||
$r3$.ΔdirectiveInject(MyService, 4),
|
||||
$r3$.ΔdirectiveInject(MyService, 8),
|
||||
$r3$.ΔdirectiveInject(MyService, 10)
|
||||
$r3$.ɵɵinjectAttribute('name'),
|
||||
$r3$.ɵɵdirectiveInject(MyService),
|
||||
$r3$.ɵɵdirectiveInject(MyService, 1),
|
||||
$r3$.ɵɵdirectiveInject(MyService, 2),
|
||||
$r3$.ɵɵdirectiveInject(MyService, 4),
|
||||
$r3$.ɵɵdirectiveInject(MyService, 8),
|
||||
$r3$.ɵɵdirectiveInject(MyService, 10)
|
||||
);
|
||||
}`;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ describe('compiler compliance: directives', () => {
|
||||
|
||||
// MyComponent definition should be:
|
||||
const MyComponentDefinition = `
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [["my-component"]],
|
||||
factory: function MyComponent_Factory(t) { return new (t || MyComponent)(); },
|
||||
@@ -46,7 +46,7 @@ describe('compiler compliance: directives', () => {
|
||||
vars: 0,
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δelement(0, "div");
|
||||
$r3$.ɵɵelement(0, "div");
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@@ -84,7 +84,7 @@ describe('compiler compliance: directives', () => {
|
||||
|
||||
// MyComponent definition should be:
|
||||
const MyComponentDefinition = `
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [["my-component"]],
|
||||
factory: function MyComponent_Factory(t) { return new (t || MyComponent)(); },
|
||||
@@ -92,7 +92,7 @@ describe('compiler compliance: directives', () => {
|
||||
vars: 0,
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δelement(0, "div");
|
||||
$r3$.ɵɵelement(0, "div");
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
@@ -132,15 +132,15 @@ describe('compiler compliance: directives', () => {
|
||||
…
|
||||
const _c0 = [${AttributeMarker.Bindings}, "someDirective"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δelement(0, "div", _c0);
|
||||
$r3$.ɵɵelement(0, "div", _c0);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "someDirective", $r3$.Δbind(true));
|
||||
$r3$.ɵɵselect(0);
|
||||
$r3$.ɵɵelementProperty(0, "someDirective", $r3$.ɵɵbind(true));
|
||||
}
|
||||
},
|
||||
…
|
||||
@@ -187,15 +187,15 @@ describe('compiler compliance: directives', () => {
|
||||
const $_c0$ = ["directiveA", ""];
|
||||
function MyComponent_ng_template_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δtext(0, "Some content");
|
||||
$r3$.ɵɵtext(0, "Some content");
|
||||
}
|
||||
}
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δtemplate(0, MyComponent_ng_template_0_Template, 1, 0, "ng-template", $_c0$);
|
||||
$r3$.ɵɵtemplate(0, MyComponent_ng_template_0_Template, 1, 0, "ng-template", $_c0$);
|
||||
}
|
||||
},
|
||||
…
|
||||
@@ -241,21 +241,21 @@ describe('compiler compliance: directives', () => {
|
||||
const $_c1$ = ["directiveA", ""];
|
||||
function MyComponent_ng_container_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔelementContainerStart(0, $_c1$);
|
||||
$r3$.Δtext(1, "Some content");
|
||||
$r3$.ΔelementContainerEnd();
|
||||
$r3$.ɵɵelementContainerStart(0, $_c1$);
|
||||
$r3$.ɵɵtext(1, "Some content");
|
||||
$r3$.ɵɵelementContainerEnd();
|
||||
}
|
||||
}
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δtemplate(0, MyComponent_ng_container_0_Template, 2, 0, "ng-container", $_c0$);
|
||||
$r3$.ɵɵtemplate(0, MyComponent_ng_container_0_Template, 2, 0, "ng-container", $_c0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "ngIf", $r3$.Δbind(ctx.showing));
|
||||
$r3$.ɵɵselect(0);
|
||||
$r3$.ɵɵelementProperty(0, "ngIf", $r3$.ɵɵbind(ctx.showing));
|
||||
}
|
||||
},
|
||||
…
|
||||
@@ -295,15 +295,15 @@ describe('compiler compliance: directives', () => {
|
||||
…
|
||||
const $c0_a0$ = [${AttributeMarker.Bindings}, "someDirective"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δtemplate(0, MyComponent_ng_template_0_Template, 0, 0, "ng-template", $c0_a0$);
|
||||
$r3$.ɵɵtemplate(0, MyComponent_ng_template_0_Template, 0, 0, "ng-template", $c0_a0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.Δselect(0);
|
||||
$r3$.ΔelementProperty(0, "someDirective", $r3$.Δbind(true));
|
||||
$r3$.ɵɵselect(0);
|
||||
$r3$.ɵɵelementProperty(0, "someDirective", $r3$.ɵɵbind(true));
|
||||
}
|
||||
},
|
||||
…
|
||||
@@ -344,11 +344,11 @@ describe('compiler compliance: directives', () => {
|
||||
…
|
||||
const $c0_a0$ = [${AttributeMarker.Template}, "someDirective"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δtemplate(0, MyComponent_div_0_Template, 1, 0, "div", $c0_a0$);
|
||||
$r3$.ɵɵtemplate(0, MyComponent_div_0_Template, 1, 0, "div", $c0_a0$);
|
||||
}
|
||||
},
|
||||
…
|
||||
@@ -393,13 +393,13 @@ describe('compiler compliance: directives', () => {
|
||||
…
|
||||
const $c0_a0$ = [${AttributeMarker.Bindings}, "someDirective"];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔelementStart(0, "div", $c0_a0$);
|
||||
$r3$.Δlistener("someDirective", function MyComponent_Template_div_someDirective_0_listener($event) { return ctx.noop(); });
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.ɵɵelementStart(0, "div", $c0_a0$);
|
||||
$r3$.ɵɵlistener("someDirective", function MyComponent_Template_div_someDirective_0_listener($event) { return ctx.noop(); });
|
||||
$r3$.ɵɵelementEnd();
|
||||
}
|
||||
},
|
||||
…
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,7 +52,7 @@ describe('compiler compliance: listen()', () => {
|
||||
};
|
||||
|
||||
const componentDef = `
|
||||
MyComponent.ngComponentDef = IDENT.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = IDENT.ɵɵdefineComponent({
|
||||
…
|
||||
inputs:{
|
||||
componentInput: "componentInput",
|
||||
@@ -66,7 +66,7 @@ describe('compiler compliance: listen()', () => {
|
||||
});`;
|
||||
|
||||
const directiveDef = `
|
||||
MyDirective.ngDirectiveDef = IDENT.ΔdefineDirective({
|
||||
MyDirective.ngDirectiveDef = IDENT.ɵɵdefineDirective({
|
||||
…
|
||||
inputs:{
|
||||
directiveInput: "directiveInput",
|
||||
|
||||
@@ -45,12 +45,12 @@ describe('compiler compliance: listen()', () => {
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔelementStart(0, "div", $e0_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_Template_div_click_0_listener($event) {
|
||||
$r3$.ɵɵelementStart(0, "div", $e0_attrs$);
|
||||
$r3$.ɵɵlistener("click", function MyComponent_Template_div_click_0_listener($event) {
|
||||
ctx.onClick($event);
|
||||
return (1 == 2);
|
||||
});
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.ɵɵelementEnd();
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -91,11 +91,11 @@ describe('compiler compliance: listen()', () => {
|
||||
…
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.ΔelementStart(0, "my-app", $e0_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_Template_my_app_click_0_listener($event) {
|
||||
$r3$.ɵɵelementStart(0, "my-app", $e0_attrs$);
|
||||
$r3$.ɵɵlistener("click", function MyComponent_Template_my_app_click_0_listener($event) {
|
||||
return ctx.onClick($event);
|
||||
});
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.ɵɵelementEnd();
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -138,33 +138,33 @@ describe('compiler compliance: listen()', () => {
|
||||
|
||||
function MyComponent_div_0_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
const $s$ = $r3$.ΔgetCurrentView();
|
||||
$r3$.ΔelementStart(0, "div");
|
||||
$r3$.ΔelementStart(1, "div", $e_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_div_0_Template_div_click_1_listener($event) {
|
||||
$r3$.ΔrestoreView($s$);
|
||||
const $comp$ = $r3$.ΔnextContext();
|
||||
const $s$ = $r3$.ɵɵgetCurrentView();
|
||||
$r3$.ɵɵelementStart(0, "div");
|
||||
$r3$.ɵɵelementStart(1, "div", $e_attrs$);
|
||||
$r3$.ɵɵlistener("click", function MyComponent_div_0_Template_div_click_1_listener($event) {
|
||||
$r3$.ɵɵrestoreView($s$);
|
||||
const $comp$ = $r3$.ɵɵnextContext();
|
||||
return $comp$.onClick($comp$.foo);
|
||||
});
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.ΔelementStart(2, "button", $e_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_div_0_Template_button_click_2_listener($event) {
|
||||
$r3$.ΔrestoreView($s$);
|
||||
const $comp2$ = $r3$.ΔnextContext();
|
||||
$r3$.ɵɵelementEnd();
|
||||
$r3$.ɵɵelementStart(2, "button", $e_attrs$);
|
||||
$r3$.ɵɵlistener("click", function MyComponent_div_0_Template_button_click_2_listener($event) {
|
||||
$r3$.ɵɵrestoreView($s$);
|
||||
const $comp2$ = $r3$.ɵɵnextContext();
|
||||
return $comp2$.onClick2($comp2$.bar);
|
||||
});
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.ɵɵelementEnd();
|
||||
$r3$.ɵɵelementEnd();
|
||||
}
|
||||
}
|
||||
// ...
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$r3$.Δtemplate(0, MyComponent_div_0_Template, 3, 0, "div", $c0$);
|
||||
$r3$.ɵɵtemplate(0, MyComponent_div_0_Template, 3, 0, "div", $c0$);
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "ngIf", $i0$.Δbind(ctx.showing));
|
||||
$i0$.ɵɵselect(0);
|
||||
$i0$.ɵɵelementProperty(0, "ngIf", $i0$.ɵɵbind(ctx.showing));
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -199,7 +199,7 @@ describe('compiler compliance: listen()', () => {
|
||||
const $e0_attrs$ = [${AttributeMarker.Bindings}, "click"];
|
||||
const $e2_refs$ = ["user", ""];
|
||||
…
|
||||
MyComponent.ngComponentDef = $r3$.ΔdefineComponent({
|
||||
MyComponent.ngComponentDef = $r3$.ɵɵdefineComponent({
|
||||
type: MyComponent,
|
||||
selectors: [["my-component"]],
|
||||
factory: function MyComponent_Factory(t) { return new (t || MyComponent)(); },
|
||||
@@ -207,16 +207,16 @@ describe('compiler compliance: listen()', () => {
|
||||
vars: 0,
|
||||
template: function MyComponent_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
const $s$ = $r3$.ΔgetCurrentView();
|
||||
$r3$.ΔelementStart(0, "button", $e0_attrs$);
|
||||
$r3$.Δlistener("click", function MyComponent_Template_button_click_0_listener($event) {
|
||||
$r3$.ΔrestoreView($s$);
|
||||
const $user$ = $r3$.Δreference(3);
|
||||
const $s$ = $r3$.ɵɵgetCurrentView();
|
||||
$r3$.ɵɵelementStart(0, "button", $e0_attrs$);
|
||||
$r3$.ɵɵlistener("click", function MyComponent_Template_button_click_0_listener($event) {
|
||||
$r3$.ɵɵrestoreView($s$);
|
||||
const $user$ = $r3$.ɵɵreference(3);
|
||||
return ctx.onClick($user$.value);
|
||||
});
|
||||
$r3$.Δtext(1, "Save");
|
||||
$r3$.ΔelementEnd();
|
||||
$r3$.Δelement(2, "input", null, $e2_refs$);
|
||||
$r3$.ɵɵtext(1, "Save");
|
||||
$r3$.ɵɵelementEnd();
|
||||
$r3$.ɵɵelement(2, "input", null, $e2_refs$);
|
||||
}
|
||||
},
|
||||
encapsulation: 2
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('compiler compliance: providers', () => {
|
||||
const result = compile(files, angularFiles);
|
||||
expectEmit(
|
||||
result.source,
|
||||
'features: [i0.ΔProvidersFeature([GreeterEN, {provide: Greeter, useClass: GreeterEN}], [GreeterEN])],',
|
||||
'features: [i0.ɵɵProvidersFeature([GreeterEN, {provide: Greeter, useClass: GreeterEN}], [GreeterEN])],',
|
||||
'Incorrect features');
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ describe('compiler compliance: providers', () => {
|
||||
const result = compile(files, angularFiles);
|
||||
expectEmit(
|
||||
result.source,
|
||||
'features: [i0.ΔProvidersFeature([GreeterEN, {provide: Greeter, useClass: GreeterEN}])],',
|
||||
'features: [i0.ɵɵProvidersFeature([GreeterEN, {provide: Greeter, useClass: GreeterEN}])],',
|
||||
'Incorrect features');
|
||||
});
|
||||
|
||||
@@ -111,7 +111,7 @@ describe('compiler compliance: providers', () => {
|
||||
|
||||
const result = compile(files, angularFiles);
|
||||
expectEmit(
|
||||
result.source, 'features: [i0.ΔProvidersFeature([], [GreeterEN])],', 'Incorrect features');
|
||||
result.source, 'features: [i0.ɵɵProvidersFeature([], [GreeterEN])],', 'Incorrect features');
|
||||
});
|
||||
|
||||
it('should not emit the ProvidersFeature feature when no providers', () => {
|
||||
|
||||
@@ -113,7 +113,7 @@ describe('r3_view_compiler', () => {
|
||||
};
|
||||
|
||||
const bV_call =
|
||||
`$r3$.ΔinterpolationV([" ",ctx.list[0]," ",ctx.list[1]," ",ctx.list[2]," ",ctx.list[3],
|
||||
`$r3$.ɵɵinterpolationV([" ",ctx.list[0]," ",ctx.list[1]," ",ctx.list[2]," ",ctx.list[3],
|
||||
" ",ctx.list[4]," ",ctx.list[5]," ",ctx.list[6]," ",ctx.list[7]," ",ctx.list[8],
|
||||
" "])`;
|
||||
const result = compile(files, angularFiles);
|
||||
@@ -143,12 +143,12 @@ describe('r3_view_compiler', () => {
|
||||
const template = `
|
||||
template: function MyApp_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.Δelement(0, "div");
|
||||
$i0$.ɵɵelement(0, "div");
|
||||
}
|
||||
if (rf & 2) {
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "@attr", …);
|
||||
$i0$.ΔelementProperty(0, "@binding", …);
|
||||
$i0$.ɵɵselect(0);
|
||||
$i0$.ɵɵelementProperty(0, "@attr", …);
|
||||
$i0$.ɵɵelementProperty(0, "@binding", …);
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
@@ -176,10 +176,10 @@ describe('r3_view_compiler', () => {
|
||||
const template = `
|
||||
template: function MyApp_Template(rf, ctx) {
|
||||
if (rf & 1) {
|
||||
$i0$.ΔelementStart(0, "div");
|
||||
$i0$.ɵɵelementStart(0, "div");
|
||||
…
|
||||
$i0$.Δselect(0);
|
||||
$i0$.ΔelementProperty(0, "@mySelector", …);
|
||||
$i0$.ɵɵselect(0);
|
||||
$i0$.ɵɵelementProperty(0, "@mySelector", …);
|
||||
}
|
||||
}`;
|
||||
const result = compile(files, angularFiles);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2075,7 +2075,7 @@ describe('ngc transformer command-line', () => {
|
||||
})
|
||||
export class Service {}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef = .+\.ΔdefineInjectable\(/);
|
||||
expect(source).toMatch(/ngInjectableDef = .+\.ɵɵdefineInjectable\(/);
|
||||
expect(source).toMatch(/ngInjectableDef.*token: Service/);
|
||||
expect(source).toMatch(/ngInjectableDef.*providedIn: .+\.Module/);
|
||||
});
|
||||
@@ -2131,7 +2131,7 @@ describe('ngc transformer command-line', () => {
|
||||
})
|
||||
export class Service {}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\.Δinject\(Existing\)/);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\.ɵɵinject\(Existing\)/);
|
||||
});
|
||||
|
||||
it('compiles a useFactory InjectableDef with optional dep', () => {
|
||||
@@ -2151,7 +2151,7 @@ describe('ngc transformer command-line', () => {
|
||||
constructor(e: Existing|null) {}
|
||||
}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\(..\.Δinject\(Existing, 8\)/);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\(..\.ɵɵinject\(Existing, 8\)/);
|
||||
});
|
||||
|
||||
it('compiles a useFactory InjectableDef with skip-self dep', () => {
|
||||
@@ -2171,7 +2171,7 @@ describe('ngc transformer command-line', () => {
|
||||
constructor(e: Existing) {}
|
||||
}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\(..\.Δinject\(Existing, 4\)/);
|
||||
expect(source).toMatch(/ngInjectableDef.*return ..\(..\.ɵɵinject\(Existing, 4\)/);
|
||||
});
|
||||
|
||||
it('compiles a service that depends on a token', () => {
|
||||
@@ -2188,7 +2188,7 @@ describe('ngc transformer command-line', () => {
|
||||
constructor(@Inject(TOKEN) value: boolean) {}
|
||||
}
|
||||
`);
|
||||
expect(source).toMatch(/ngInjectableDef = .+\.ΔdefineInjectable\(/);
|
||||
expect(source).toMatch(/ngInjectableDef = .+\.ɵɵdefineInjectable\(/);
|
||||
expect(source).toMatch(/ngInjectableDef.*token: Service/);
|
||||
expect(source).toMatch(/ngInjectableDef.*providedIn: .+\.Module/);
|
||||
});
|
||||
@@ -2215,7 +2215,7 @@ describe('ngc transformer command-line', () => {
|
||||
constructor(@Inject(TOKEN) token: any) {}
|
||||
}
|
||||
`);
|
||||
expect(source).toMatch(/new Service\(i0\.Δinject\(exports\.TOKEN\)\);/);
|
||||
expect(source).toMatch(/new Service\(i0\.ɵɵinject\(exports\.TOKEN\)\);/);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ export function forwardRef<T>(fn: () => T): T {
|
||||
|
||||
export interface SimpleChanges { [propName: string]: any; }
|
||||
|
||||
export type ΔNgModuleDefWithMeta<ModuleT, DeclarationsT, ImportsT, ExportsT> = any;
|
||||
export type ΔDirectiveDefWithMeta<DirT, SelectorT, ExportAsT, InputsT, OutputsT, QueriesT> = any;
|
||||
export type ɵɵNgModuleDefWithMeta<ModuleT, DeclarationsT, ImportsT, ExportsT> = any;
|
||||
export type ɵɵDirectiveDefWithMeta<DirT, SelectorT, ExportAsT, InputsT, OutputsT, QueriesT> = any;
|
||||
|
||||
export enum ViewEncapsulation {
|
||||
Emulated = 0,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,15 +36,15 @@ describe('ngtsc module scopes', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain('i0.ɵɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
'/*@__PURE__*/ i0.ΔsetNgModuleScope(TestModule, { imports: [OtherModule] });');
|
||||
'/*@__PURE__*/ i0.ɵɵsetNgModuleScope(TestModule, { imports: [OtherModule] });');
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngModuleDef: i0.ΔNgModuleDefWithMeta<TestModule, never, [typeof OtherModule], never>');
|
||||
'static ngModuleDef: i0.ɵɵNgModuleDefWithMeta<TestModule, never, [typeof OtherModule], never>');
|
||||
});
|
||||
|
||||
it('should produce an error when an invalid class is imported', () => {
|
||||
@@ -98,15 +98,15 @@ describe('ngtsc module scopes', () => {
|
||||
env.driveMain();
|
||||
|
||||
const jsContents = env.getContents('test.js');
|
||||
expect(jsContents).toContain('i0.ΔdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents).toContain('i0.ɵɵdefineNgModule({ type: TestModule });');
|
||||
expect(jsContents)
|
||||
.toContain(
|
||||
'/*@__PURE__*/ i0.ΔsetNgModuleScope(TestModule, { exports: [OtherModule] });');
|
||||
'/*@__PURE__*/ i0.ɵɵsetNgModuleScope(TestModule, { exports: [OtherModule] });');
|
||||
|
||||
const dtsContents = env.getContents('test.d.ts');
|
||||
expect(dtsContents)
|
||||
.toContain(
|
||||
'static ngModuleDef: i0.ΔNgModuleDefWithMeta<TestModule, never, never, [typeof OtherModule]>');
|
||||
'static ngModuleDef: i0.ɵɵNgModuleDefWithMeta<TestModule, never, never, [typeof OtherModule]>');
|
||||
});
|
||||
|
||||
it('should produce an error when a non-NgModule class is exported', () => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,17 +26,17 @@ export declare class NgForOfContext<T> {
|
||||
export declare class NgForOf<T> {
|
||||
ngForOf: T[];
|
||||
static ngTemplateContextGuard<T>(dir: NgForOf<T>, ctx: any): ctx is NgForOfContext<T>;
|
||||
static ngDirectiveDef: i0.ΔDirectiveDefWithMeta<NgForOf<any>, '[ngFor][ngForOf]', never, {'ngForOf': 'ngForOf'}, {}, never>;
|
||||
static ngDirectiveDef: i0.ɵɵDirectiveDefWithMeta<NgForOf<any>, '[ngFor][ngForOf]', never, {'ngForOf': 'ngForOf'}, {}, never>;
|
||||
}
|
||||
|
||||
export declare class NgIf {
|
||||
ngIf: any;
|
||||
static ngTemplateGuard_ngIf<E>(dir: NgIf, expr: E): expr is NonNullable<E>
|
||||
static ngDirectiveDef: i0.ΔDirectiveDefWithMeta<NgForOf<any>, '[ngIf]', never, {'ngIf': 'ngIf'}, {}, never>;
|
||||
static ngDirectiveDef: i0.ɵɵDirectiveDefWithMeta<NgForOf<any>, '[ngIf]', never, {'ngIf': 'ngIf'}, {}, never>;
|
||||
}
|
||||
|
||||
export declare class CommonModule {
|
||||
static ngModuleDef: i0.ΔNgModuleDefWithMeta<CommonModule, [typeof NgIf, typeof NgForOf], never, [typeof NgIf, typeof NgForOf]>;
|
||||
static ngModuleDef: i0.ɵɵNgModuleDefWithMeta<CommonModule, [typeof NgIf, typeof NgForOf], never, [typeof NgIf, typeof NgForOf]>;
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
||||
@@ -81,18 +81,18 @@ In `ngtsc` this is instead emitted as,
|
||||
```js
|
||||
const i0 = require("@angular/core");
|
||||
class GreetComponent {}
|
||||
GreetComponent.ngComponentDef = i0.ΔdefineComponent({
|
||||
GreetComponent.ngComponentDef = i0.ɵɵdefineComponent({
|
||||
type: GreetComponent,
|
||||
tag: 'greet',
|
||||
factory: () => new GreetComponent(),
|
||||
template: function (rf, ctx) {
|
||||
if (rf & RenderFlags.Create) {
|
||||
i0.ΔelementStart(0, 'div');
|
||||
i0.Δtext(1);
|
||||
i0.ΔelementEnd();
|
||||
i0.ɵɵelementStart(0, 'div');
|
||||
i0.ɵɵtext(1);
|
||||
i0.ɵɵelementEnd();
|
||||
}
|
||||
if (rf & RenderFlags.Update) {
|
||||
i0.ΔtextBinding(1, i0.Δinterpolation1('Hello ', ctx.name, '!'));
|
||||
i0.ɵɵtextBinding(1, i0.ɵɵinterpolation1('Hello ', ctx.name, '!'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -161,7 +161,7 @@ export class MyComponent {
|
||||
```js
|
||||
export class MyComponent {
|
||||
name: string;
|
||||
static ngComponentDef = ΔdefineComponent({...});
|
||||
static ngComponentDef = ɵɵdefineComponent({...});
|
||||
}
|
||||
```
|
||||
|
||||
@@ -213,7 +213,7 @@ export class MyDirective {
|
||||
constructor() {
|
||||
this.dirId = 'some id';
|
||||
}
|
||||
static ngDirectiveDef = ΔdefineDirective({...});
|
||||
static ngDirectiveDef = ɵɵdefineDirective({...});
|
||||
}
|
||||
```
|
||||
|
||||
@@ -256,7 +256,7 @@ export class MyPipe implements PipeTransform {
|
||||
```js
|
||||
export class MyPipe {
|
||||
transform(...) ...
|
||||
static ngPipeDef = ΔdefinePipe({...});
|
||||
static ngPipeDef = ɵɵdefinePipe({...});
|
||||
}
|
||||
```
|
||||
|
||||
@@ -329,7 +329,7 @@ export class MyModule {}
|
||||
*my.module.js*
|
||||
```js
|
||||
export class MyModule {
|
||||
static ngInjectorDef = ΔdefineInjector(...);
|
||||
static ngInjectorDef = ɵɵdefineInjector(...);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -389,7 +389,7 @@ manually written as:
|
||||
|
||||
```ts
|
||||
export class MyModule {
|
||||
static ngInjectorDef = ΔdefineInjector({
|
||||
static ngInjectorDef = ɵɵdefineInjector({
|
||||
providers: [{
|
||||
provide: Service, useClass: ServiceImpl
|
||||
}],
|
||||
@@ -411,7 +411,7 @@ export class MyModule {
|
||||
}
|
||||
```
|
||||
|
||||
except for the call to `ΔdefineInjector` would generate a `{ __symbolic: 'error' }`
|
||||
except for the call to `ɵɵdefineInjector` would generate a `{ __symbolic: 'error' }`
|
||||
value which is ignored by the ivy compiler. This allows the system to ignore
|
||||
the difference between manually and mechanically created module definitions.
|
||||
|
||||
@@ -440,7 +440,7 @@ properties by including a `// @__BUILD_OPTIMIZER_REMOVE_` comment:
|
||||
|
||||
```ts
|
||||
export class MyModule {
|
||||
static ngInjectorDef = ΔdefineInjector({
|
||||
static ngInjectorDef = ɵɵdefineInjector({
|
||||
providers: [{
|
||||
provide: Service, useClass: ServiceImpl
|
||||
}],
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user