refactor(ivy): migrate ɵɵ prefix back to Δ (#30362)

Now that issues are resolved with Closure compiler, we can move back to our desired prefix of `Δ`.

PR Close #30362
This commit is contained in:
Ben Lesh
2019-05-14 16:52:15 -07:00
committed by Alex Rickabaugh
parent dbb150a9bd
commit cf86ed7b29
142 changed files with 6417 additions and 6453 deletions
+47 -47
View File
@@ -1,11 +1,11 @@
# Deprecated APIs and Features
Angular strives to balance innovation and stability.
Sometimes, APIs and features become obsolete and need to be removed or replaced so that Angular can stay current with new best practices, changing dependencies, or changes in the (web) platform itself.
Angular strives to balance innovation and stability.
Sometimes, APIs and features become obsolete and need to be removed or replaced so that Angular can stay current with new best practices, changing dependencies, or changes in the (web) platform itself.
To make these transitions as easy as possible, we deprecate APIs and features for a period of time before removing them. This gives you time to update your apps to the latest APIs and best practices.
This guide contains a summary of all Angular APIs and features that are currently deprecated.
This guide contains a summary of all Angular APIs and features that are currently deprecated.
<div class="alert is-helpful">
@@ -13,7 +13,7 @@ This guide contains a summary of all Angular APIs and features that are currentl
Features and APIs that were deprecated in v6 or earlier are candidates for removal in version 9 or any later major version. For information about Angular's deprecation and removal practices, see [Angular Release Practices](guide/releases#deprecation-practices "Angular Release Practices: Deprecation practices").
For step-by-step instructions on how to update to the latest Angular release, use the interactive update guide at [update.angular.io](https://update.angular.io).
For step-by-step instructions on how to update to the latest Angular release, use the interactive update guide at [update.angular.io](https://update.angular.io).
</div>
@@ -21,7 +21,7 @@ For step-by-step instructions on how to update to the latest Angular release, us
## Deprecated APIs
This section contains a complete list all of the currently-deprecated APIs, with details to help you plan your migration to a replacement.
This section contains a complete list all of the currently-deprecated APIs, with details to help you plan your migration to a replacement.
<div class="alert is-helpful">
@@ -49,16 +49,16 @@ Tip: In the [API reference section](api) of this doc site, deprecated APIs are i
| API | Replacement | Deprecation announced | Notes |
| --- | ----------- | --------------------- | ----- |
| [`CollectionChangeRecord`](api/core/CollectionChangeRecord) | [`IterableChangeRecord`](api/core/IterableChangeRecord) | v4 | none |
| [`CollectionChangeRecord`](api/core/CollectionChangeRecord) | [`IterableChangeRecord`](api/core/IterableChangeRecord) | v4 | none |
| [`DefaultIterableDiffer`](api/core/DefaultIterableDiffer) | n/a | v4 | Not part of public API. |
| [`defineInjectable`](api/core/defineInjectable) | `ɵɵdefineInjectable` | v8 | Used only in generated code. No source code should depend on this API. |
| [`inject`](api/core/inject) | `ɵɵinject` | v8 | Used only in generated code. No source code should depend on this API. |
| [`ReflectiveInjector`](api/core/ReflectiveInjector) | [`Injector.create`](api/core/Injector#create) | v5 | See [`ReflectiveInjector`](#reflectiveinjector) |
| [`defineInjectable`](api/core/defineInjectable) | `ΔdefineInjectable` | v8 | Used only in generated code. No source code should depend on this API. |
| [`inject`](api/core/inject) | `Δinject` | v8 | Used only in generated code. No source code should depend on this API. |
| [`ReflectiveInjector`](api/core/ReflectiveInjector) | [`Injector.create`](api/core/Injector#create) | v5 | See [`ReflectiveInjector`](#reflectiveinjector) |
| [`ReflectiveKey`](api/core/ReflectiveKey) | none | v5 | none |
| [`RenderComponentType`](api/core/RenderComponentType) | [`RendererType2`](api/core/RendererType2) and [`Renderer2`](api/core/Renderer2) | v4 | none |
| [`Renderer`](api/core/Renderer) | [`Renderer2`](api/core/Renderer2) | v4 | none |
| [`RootRenderer`](api/core/RootRenderer) | [`RendererFactory2`](api/core/RendererFactory2) | v4 | none |
| [`ViewEncapsulation.Native`](api/core/ViewEncapsulation#Native) | [`ViewEncapsulation.ShadowDom`](api/core/ViewEncapsulation#ShadowDom) | v6 | Use the native encapsulation mechanism of the renderer. See [view.ts](https://github.com/angular/angular/blob/3e992e18ebf51d6036818f26c3d77b52d3ec48eb/packages/core/src/metadata/view.ts#L32).
| [`RenderComponentType`](api/core/RenderComponentType) | [`RendererType2`](api/core/RendererType2) and [`Renderer2`](api/core/Renderer2) | v4 | none |
| [`Renderer`](api/core/Renderer) | [`Renderer2`](api/core/Renderer2) | v4 | none |
| [`RootRenderer`](api/core/RootRenderer) | [`RendererFactory2`](api/core/RendererFactory2) | v4 | none |
| [`ViewEncapsulation.Native`](api/core/ViewEncapsulation#Native) | [`ViewEncapsulation.ShadowDom`](api/core/ViewEncapsulation#ShadowDom) | v6 | Use the native encapsulation mechanism of the renderer. See [view.ts](https://github.com/angular/angular/blob/3e992e18ebf51d6036818f26c3d77b52d3ec48eb/packages/core/src/metadata/view.ts#L32).
#### @angular/core/testing
@@ -72,7 +72,7 @@ Tip: In the [API reference section](api) of this doc site, deprecated APIs are i
| API | Replacement | Deprecation announced | Notes |
| --- | ----------- | --------------------- | ----- |
| [`NgFormSelectorWarning`](api/forms/NgFormSelectorWarning) | n/a | v6 | See [ngForm](#ngform). |
| [`NgFormSelectorWarning`](api/forms/NgFormSelectorWarning) | n/a | v6 | See [ngForm](#ngform). |
#### @angular/router
@@ -93,15 +93,15 @@ Tip: In the [API reference section](api) of this doc site, deprecated APIs are i
| API | Replacement | Deprecation announced | Notes |
| --- | ----------- | --------------------- | ----- |
| [`getAngularLib`](api/upgrade/static/getAngularLib) | [`getAngularJSGlobal`](api/upgrade/static/getAngularJSGlobal) | v5 | See [Upgrading from AngularJS](guide/upgrade). |
[`setAngularLib`](api/upgrade/static/setAngularLib) | [`setAngularJSGlobal`](api/upgrade/static/setAngularJSGlobal) | v5 | See [Upgrading from AngularJS](guide/upgrade). |
| [`getAngularLib`](api/upgrade/static/getAngularLib) | [`getAngularJSGlobal`](api/upgrade/static/getAngularJSGlobal) | v5 | See [Upgrading from AngularJS](guide/upgrade). |
[`setAngularLib`](api/upgrade/static/setAngularLib) | [`setAngularJSGlobal`](api/upgrade/static/setAngularJSGlobal) | v5 | See [Upgrading from AngularJS](guide/upgrade). |
{@a deprecated-features}
## Deprecated features
This section lists all of the currently-deprecated features, which includes template syntax, configuration options, and any other deprecations not listed in the [Deprecated APIs](#deprecated-apis) section above. It also includes deprecated API usage scenarios or API combinations, to augment the information above.
This section lists all of the currently-deprecated features, which includes template syntax, configuration options, and any other deprecations not listed in the [Deprecated APIs](#deprecated-apis) section above. It also includes deprecated API usage scenarios or API combinations, to augment the information above.
@@ -111,20 +111,20 @@ This section lists all of the currently-deprecated features, which includes temp
The shadow-piercing descendant combinator is deprecated and support is being removed from major browsers and tools. As such, in v4 we deprecated support in Angular for all 3 of `/deep/`, `>>>` and `::ng-deep`. Until removal, `::ng-deep` is preferred for broader compatibility with the tools.
For more information, see [/deep/, >>>, and ::ng-deep](guide/component-styles#deprecated-deep--and-ng-deep "Component Styles guide, Deprecated deep and ngdeep")
in the Component Styles guide.
in the Component Styles guide.
{@a template-tag}
### &lt;template&gt; tag
The `<template>` tag was deprecated in v4 to avoid colliding with the DOM's element of the same name (such as when using web components). Use `<ng-template>` instead. For more information, see the [Ahead-of-Time Compilation](guide/aot-compiler#enablelegacytemplate) guide.
The `<template>` tag was deprecated in v4 to avoid colliding with the DOM's element of the same name (such as when using web components). Use `<ng-template>` instead. For more information, see the [Ahead-of-Time Compilation](guide/aot-compiler#enablelegacytemplate) guide.
{@a ngform}
### ngForm element selector
Support for using `ngForm` element selector was deprecated in v6.
Support for using `ngForm` element selector was deprecated in v6.
It has been deprecated to be consistent with other core Angular selectors, which are typically written in kebab-case.
Deprecated:
@@ -133,13 +133,13 @@ Deprecated:
<ngForm #myForm="ngForm">
```
Replacement:
Replacement:
```
<ng-form #myForm="ngForm">
```
The [`NgFormSelectorWarning`](api/forms/NgFormSelectorWarning) directive is solely used to display warnings when the deprecated `ngForm` selector is used.
The [`NgFormSelectorWarning`](api/forms/NgFormSelectorWarning) directive is solely used to display warnings when the deprecated `ngForm` selector is used.
{@a ngmodel-reactive}
@@ -147,23 +147,23 @@ The [`NgFormSelectorWarning`](api/forms/NgFormSelectorWarning) directive is sole
Support for using the `ngModel` input property and `ngModelChange` event with reactive form directives was deprecated in version 6.
For more information, see the usage notes for [`FormControlDirective`](api/forms/FormControlDirective#use-with-ngmodel) and [`FormControlName`](api/forms/FormControlName#use-with-ngmodel).
For more information, see the usage notes for [`FormControlDirective`](api/forms/FormControlDirective#use-with-ngmodel) and [`FormControlName`](api/forms/FormControlName#use-with-ngmodel).
{@a sw-versionedfiles}
### Service worker versionedFiles
In the service worker configuration file `ngsw-config.json`, `versionedFiles` and `files` have the same behavior. As of v6, `versionedFiles` is deprecated; use `files` instead.
In the service worker configuration file `ngsw-config.json`, `versionedFiles` and `files` have the same behavior. As of v6, `versionedFiles` is deprecated; use `files` instead.
For more information, see [Service Worker Configuration](guide/service-worker-config#assetgroups).
For more information, see [Service Worker Configuration](guide/service-worker-config#assetgroups).
{@a reflectiveinjector}
### ReflectiveInjector
In v5, Angular replaced the `ReflectiveInjector` with the `StaticInjector`. The injector no longer requires the Reflect polyfill, reducing application size for most developers.
In v5, Angular replaced the `ReflectiveInjector` with the `StaticInjector`. The injector no longer requires the Reflect polyfill, reducing application size for most developers.
Before:
Before:
```
ReflectiveInjector.resolveAndCreate(providers);
@@ -178,18 +178,18 @@ Injector.create({providers});
{@a i18n-pipes}
### Pipes using Intl API
<!--
<!--
From https://blog.angular.io/version-5-0-0-of-angular-now-available-37e414935ced
-->
Angular used to rely on the browser to provide number, date, and currency formatting using browser i18n APIs. This practice meant that most apps needed to use a polyfill, users were seeing inconsistent results across browsers, and common formats (such as the currency pipe) didn’t match developer expectations out of the box.
In version 4.3, Angular introduced new number, date, and currency pipes that increase standardization across browsers and eliminate the need for i18n polyfills. These pipes use the Unicode Common Locale Data Repository (CLDR) instead of the JS Intl API to provide extensive locale support.
In version 4.3, Angular introduced new number, date, and currency pipes that increase standardization across browsers and eliminate the need for i18n polyfills. These pipes use the Unicode Common Locale Data Repository (CLDR) instead of the JS Intl API to provide extensive locale support.
In version 5.0.0, Angular updated its standard pipes to use the CLRD implementation.
At that time, Angular also added [`DeprecatedI18NPipesModule`](api/common/DeprecatedI18NPipesModule) and related APIs to provide limited-time access to the old behavior. If you need to use these `Deprecated*` pipes, see [Angular change log](https://github.com/angular/angular/blob/master/CHANGELOG.md#i18n-pipes) and the [Date Formats mappings](https://docs.google.com/spreadsheets/d/12iygt-_cakNP1VO7MV9g4lq9NsxVWG4tSfc98HpHb0k/edit#gid=0 "Date Formats Google sheet").
In version 5.0.0, Angular updated its standard pipes to use the CLRD implementation.
At that time, Angular also added [`DeprecatedI18NPipesModule`](api/common/DeprecatedI18NPipesModule) and related APIs to provide limited-time access to the old behavior. If you need to use these `Deprecated*` pipes, see [Angular change log](https://github.com/angular/angular/blob/master/CHANGELOG.md#i18n-pipes) and the [Date Formats mappings](https://docs.google.com/spreadsheets/d/12iygt-_cakNP1VO7MV9g4lq9NsxVWG4tSfc98HpHb0k/edit#gid=0 "Date Formats Google sheet").
Reminder: If you use these `Deprecated*` pipes, you should migrate to the current APIs listed above as soon as possible. These deprecated APIs are candidates for removal in the next major release.
Reminder: If you use these `Deprecated*` pipes, you should migrate to the current APIs listed above as soon as possible. These deprecated APIs are candidates for removal in the next major release.
{@a loadChildren}
@@ -199,7 +199,7 @@ When Angular first introduced lazy routes, there wasn't browser support for dyna
In v8, the string syntax for the [`loadChildren`](api/router/LoadChildren) route specification was deprecated, in favor of new syntax that uses `import()` syntax.
Before:
Before:
```
const routes: Routes = [{
@@ -209,12 +209,12 @@ const routes: Routes = [{
}];
```
After:
After:
```
const routes: Routes = [{
path: 'lazy',
// The new import() syntax
// The new import() syntax
loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule)
}];
```
@@ -223,7 +223,7 @@ const routes: Routes = [{
<div class="alert is-helpful">
**v8 update**: When you update to version 8, the [`ng update`](cli/update) command performs the transformation automatically. Prior to version 7, the `import()` syntax only works in JIT mode (with view engine).
**v8 update**: When you update to version 8, the [`ng update`](cli/update) command performs the transformation automatically. Prior to version 7, the `import()` syntax only works in JIT mode (with view engine).
</div>
@@ -240,13 +240,13 @@ const routes: Routes = [{
| `params` | `paramMap` |
| `queryParams` | `queryParamMap` |
For more information see the [Router guide](guide/router#activated-route).
For more information see the [Router guide](guide/router#activated-route).
{@a removed}
## Removed APIs
The following APIs have been removed starting with version 8.0.0:
The following APIs have been removed starting with version 8.0.0:
| Package | API | Replacement | Notes |
| ------- | -------------- | ----------- | ----- |
@@ -260,24 +260,24 @@ The following APIs have been removed starting with version 8.0.0:
{@a http}
### @angular/http
<!--
Deprecation announced in version 5
https://blog.angular.io/version-5-0-0-of-angular-now-available-37e414935ced)
<!--
Deprecation announced in version 5
https://blog.angular.io/version-5-0-0-of-angular-now-available-37e414935ced)
-->
The entire [`@angular/http`](http://v7.angular.io/api/http) package has been removed. Use [`@angular/common/http`](api/common/http) instead.
The entire [`@angular/http`](http://v7.angular.io/api/http) package has been removed. Use [`@angular/common/http`](api/common/http) instead.
The new API is a smaller, easier, and more powerful way to make HTTP requests in Angular.
The new API simplifies the default ergonomics: There is no need to map by invoking the `.json()` method.
It also supports typed return values and interceptors.
The new API is a smaller, easier, and more powerful way to make HTTP requests in Angular.
The new API simplifies the default ergonomics: There is no need to map by invoking the `.json()` method.
It also supports typed return values and interceptors.
To update your apps:
* Replace `HttpModule` with [`HttpClientModule`](api/common/http/HttpClientModule) (from [`@angular/common/http`](api/common/http)) in each of your modules.
* Replace the `Http` service with the [`HttpClient`](api/common/http/HttpClient) service.
* Remove any `map(res => res.json())` calls. They are no longer needed.
* Remove any `map(res => res.json())` calls. They are no longer needed.
For more information about using `@angular/common/http`, see the [HttpClient guide](guide/http "HTTP Client guide").
For more information about using `@angular/common/http`, see the [HttpClient guide](guide/http "HTTP Client guide").
| `@angular/http` | Closest replacement in `@angular/common/http` |
+1 -1
View File
@@ -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
View File
@@ -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 [double barred latin o](https://en.wikipedia.org/wiki/%C6%9F) (`ɵɵ`).
- 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)) (`Δ`).
- 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)
+7 -7
View File
@@ -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, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵselect, ɵɵstyleProp, ɵɵstyling, ɵɵtext, ɵɵtextBinding} from '@angular/core';
import {ɵRenderFlags, ɵrenderComponent as renderComponent, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔdefineComponent, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation1, Δselect, ΔstyleProp, Δstyling, Δ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,41 +35,41 @@ 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');
ɵɵstyling(null, c1);
{ ɵɵtext(2); }
ɵɵelementEnd();
ɵɵcontainer(3);
ɵɵcontainer(4);
ΔelementStart(1, 'span');
Δstyling(null, c1);
{ Δtext(2); }
ΔelementEnd();
Δcontainer(3);
Δcontainer(4);
}
ɵɵelementEnd();
ΔelementEnd();
}
if (rf & ɵRenderFlags.Update) {
ɵɵselect(1);
ɵɵstyleProp(0, ctx.depth % 2 ? '' : 'grey');
ɵɵstyling();
ɵɵselect(2);
ɵɵtextBinding(2, ɵɵinterpolation1(' ', ctx.value, ' '));
ɵɵcontainerRefreshStart(3);
Δselect(1);
ΔstyleProp(0, ctx.depth % 2 ? '' : 'grey');
Δstyling();
Δselect(2);
Δ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 -5
View File
@@ -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, ɵɵclassMap, ɵɵdefineDirective, ɵɵstyling, ɵɵstylingApply} from '@angular/core';
import {Directive, DoCheck, Input, ɵRenderFlags, ΔclassMap, ΔdefineDirective, Δstyling, ΔstylingApply} 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) {
ɵɵstyling();
Δstyling();
}
if (rf & ɵRenderFlags.Update) {
ɵɵclassMap(ctx.getValue());
ɵɵstylingApply();
ΔclassMap(ctx.getValue());
ΔstylingApply();
}
}
});
+5 -5
View File
@@ -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, ɵɵstyleMap, ɵɵstyling, ɵɵstylingApply} from '@angular/core';
import {Directive, DoCheck, Input, ɵRenderFlags, ΔdefineDirective, ΔstyleMap, Δstyling, ΔstylingApply} 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) {
ɵɵstyling();
Δstyling();
}
if (rf & ɵRenderFlags.Update) {
ɵɵstyleMap(ctx.getValue());
ɵɵstylingApply();
ΔstyleMap(ctx.getValue());
ΔstylingApply();
}
}
});
+3 -3
View File
@@ -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))
});
/**
@@ -160,11 +160,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,
@@ -205,7 +205,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]' }]
@@ -339,7 +339,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'],
]);
@@ -14,7 +14,7 @@ import * as ts from 'typescript';
import {NgtscProgram} from '../../src/ngtsc/program';
const IDENTIFIER = /[A-Za-z_$ɵ][A-Za-z0-9_$]*/;
const IDENTIFIER = /[A-Za-z_$ɵΔ][A-Za-z0-9_$]*/;
const OPERATOR =
/!|\?|%|\*|\/|\^|&&?|\|\|?|\(|\)|\{|\}|\[|\]|:|;|<=?|>=?|={1,3}|!==?|=>|\+\+?|--?|@|,|\.|\.\.\./;
const STRING = /'[^']*'|"[^"]*"|`[\s\S]*?`/;
@@ -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$.ɵɵproperty("title", $ctx$.title);
$i0$.Δselect(0);
$i0$.Δproperty("title", $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$.ɵɵpropertyInterpolate1("title", "Hello ", $ctx$.name, "");
$i0$.Δselect(0);
$i0$.ΔpropertyInterpolate1("title", "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$.ɵɵproperty("for", ctx.forValue);
$i0$.Δselect(0);
$i0$.Δproperty("for", 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$.ɵɵproperty("id", ctx.dirId, null, true);
$r3$.Δproperty("id", 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$.ɵɵproperty("id", $r3$.ɵɵpureFunction1(1, $ff$, ctx.id), null, true);
$r3$.Δproperty("id", $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$);
…
}
…
@@ -469,26 +469,26 @@ describe('compiler compliance: bindings', () => {
const template = `
…
if (rf & 2) {
i0.ɵɵselect(0);
i0.ɵɵpropertyInterpolateV("title", ["a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h", ctx.eight, "i", ctx.nine, "j"]);
i0.ɵɵselect(1);
i0.ɵɵpropertyInterpolate8("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h", ctx.eight, "i");
i0.ɵɵselect(2);
i0.ɵɵpropertyInterpolate7("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h");
i0.ɵɵselect(3);
i0.ɵɵpropertyInterpolate6("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g");
i0.ɵɵselect(4);
i0.ɵɵpropertyInterpolate5("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f");
i0.ɵɵselect(5);
i0.ɵɵpropertyInterpolate4("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e");
i0.ɵɵselect(6);
i0.ɵɵpropertyInterpolate3("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d");
i0.ɵɵselect(7);
i0.ɵɵpropertyInterpolate2("title", "a", ctx.one, "b", ctx.two, "c");
i0.ɵɵselect(8);
i0.ɵɵpropertyInterpolate1("title", "a", ctx.one, "b");
i0.ɵɵselect(9);
i0.ɵɵpropertyInterpolate("title", ctx.one);
i0.Δselect(0);
i0.ΔpropertyInterpolateV("title", ["a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h", ctx.eight, "i", ctx.nine, "j"]);
i0.Δselect(1);
i0.ΔpropertyInterpolate8("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h", ctx.eight, "i");
i0.Δselect(2);
i0.ΔpropertyInterpolate7("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g", ctx.seven, "h");
i0.Δselect(3);
i0.ΔpropertyInterpolate6("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f", ctx.six, "g");
i0.Δselect(4);
i0.ΔpropertyInterpolate5("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e", ctx.five, "f");
i0.Δselect(5);
i0.ΔpropertyInterpolate4("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d", ctx.four, "e");
i0.Δselect(6);
i0.ΔpropertyInterpolate3("title", "a", ctx.one, "b", ctx.two, "c", ctx.three, "d");
i0.Δselect(7);
i0.ΔpropertyInterpolate2("title", "a", ctx.one, "b", ctx.two, "c");
i0.Δselect(8);
i0.ΔpropertyInterpolate1("title", "a", ctx.one, "b");
i0.Δselect(9);
i0.ΔpropertyInterpolate("title", ctx.one);
}
…
`;
@@ -510,19 +510,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, " "));
}
}
`;
@@ -542,12 +542,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);
@@ -566,11 +566,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);
@@ -585,7 +585,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$.ɵɵproperty("someDirective", true);
$r3$.Δselect(0);
$r3$.Δproperty("someDirective", 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$.ɵɵproperty("ngIf", ctx.showing);
$r3$.Δselect(0);
$r3$.Δproperty("ngIf", 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$.ɵɵproperty("someDirective", true);
$r3$.Δselect(0);
$r3$.Δproperty("someDirective", 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$.ɵɵproperty("ngIf", ctx.showing);
$i0$.Δselect(0);
$i0$.Δproperty("ngIf", 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$.ɵɵproperty("@attr", …);
$i0$.ɵɵproperty("@binding", …);
$i0$.Δselect(0);
$i0$.Δproperty("@attr", …);
$i0$.Δproperty("@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$.ɵɵproperty("@mySelector", …);
$i0$.Δselect(0);
$i0$.Δproperty("@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
+6 -6
View File
@@ -2113,7 +2113,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/);
});
@@ -2169,7 +2169,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', () => {
@@ -2189,7 +2189,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', () => {
@@ -2209,7 +2209,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', () => {
@@ -2226,7 +2226,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/);
});
@@ -2253,7 +2253,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,9 +62,9 @@ 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 ɵɵPipeDefWithMeta<PipeT, NameT> = any;
export type ΔNgModuleDefWithMeta<ModuleT, DeclarationsT, ImportsT, ExportsT> = any;
export type ΔDirectiveDefWithMeta<DirT, SelectorT, ExportAsT, InputsT, OutputsT, QueriesT> = any;
export type ΔPipeDefWithMeta<PipeT, NameT> = 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
@@ -34,17 +34,17 @@ export declare class IndexPipe {
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, typeof IndexPipe], never, [typeof NgIf, typeof NgForOf, typeof IndexPipe]>;
static ngModuleDef: i0.ΔNgModuleDefWithMeta<CommonModule, [typeof NgIf, typeof NgForOf, typeof IndexPipe], never, [typeof NgIf, typeof NgForOf, typeof IndexPipe]>;
}
`);
}

Some files were not shown because too many files have changed in this diff Show More