Skip to content

Commit b057806

Browse files
committed
refactor(ivy): use ɵɵ instead of Δ for now (angular#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 angular#29850
1 parent 54058ba commit b057806

File tree

146 files changed

+8053
-8021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+8053
-8021
lines changed

aio/tools/transforms/angular-api-package/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ module.exports = new Package('angular-api', [basePackage, typeScriptPackage])
7474

7575
// API files are typescript
7676
readTypeScriptModules.basePath = API_SOURCE_PATH;
77-
readTypeScriptModules.ignoreExportsMatching = [/^[_Δ]|^VERSION$/];
77+
readTypeScriptModules.ignoreExportsMatching = [/^_|^ɵɵ|^VERSION$/];
7878
readTypeScriptModules.hidePrivateMembers = true;
7979

8080
// NOTE: This list should be in sync with tools/public_api_guard/BUILD.bazel

docs/PUBLIC_API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ We explicitly don't consider the following to be our public API surface:
3737

3838
- any file/import paths within our package except for the `/`, `/testing` and `/bundles/*` and other documented package entry-points.
3939
- constructors of injectable classes (services and directives) - please use DI to obtain instances of these classes
40-
- 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)) (`Δ`).
40+
- 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) (`ɵɵ`).
4141
- extending any of our classes unless the support for this is specifically documented in the API docs
4242
- 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)
4343

integration/ngcc/test.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,25 @@ if [[ $? != 0 ]]; then exit 1; fi
4040
if [[ $? != 0 ]]; then exit 1; fi
4141

4242
# Did it compile @angular/core/ApplicationModule correctly?
43-
grep "ApplicationModule.ngModuleDef = ΔdefineNgModule" node_modules/@angular/core/fesm2015/core.js
43+
grep "ApplicationModule.ngModuleDef = ɵɵdefineNgModule" node_modules/@angular/core/fesm2015/core.js
4444
if [[ $? != 0 ]]; then exit 1; fi
45-
grep "ApplicationModule.ngModuleDef = ΔdefineNgModule" node_modules/@angular/core/fesm5/core.js
45+
grep "ApplicationModule.ngModuleDef = ɵɵdefineNgModule" node_modules/@angular/core/fesm5/core.js
4646
if [[ $? != 0 ]]; then exit 1; fi
47-
grep "ApplicationModule.ngModuleDef = ɵngcc0.ΔdefineNgModule" node_modules/@angular/core/esm2015/src/application_module.js
47+
grep "ApplicationModule.ngModuleDef = ɵngcc0.ɵɵdefineNgModule" node_modules/@angular/core/esm2015/src/application_module.js
4848
if [[ $? != 0 ]]; then exit 1; fi
49-
grep "ApplicationModule.ngModuleDef = ɵngcc0.ΔdefineNgModule" node_modules/@angular/core/esm5/src/application_module.js
49+
grep "ApplicationModule.ngModuleDef = ɵngcc0.ɵɵdefineNgModule" node_modules/@angular/core/esm5/src/application_module.js
5050
if [[ $? != 0 ]]; then exit 1; fi
5151

5252
# Did it transform @angular/core typing files correctly?
5353
grep "import [*] as ɵngcc0 from './src/r3_symbols';" node_modules/@angular/core/core.d.ts
5454
if [[ $? != 0 ]]; then exit 1; fi
55-
grep "static ngInjectorDef: ɵngcc0.ΔInjectorDef<ApplicationModule>;" node_modules/@angular/core/core.d.ts
55+
grep "static ngInjectorDef: ɵngcc0.ɵɵInjectorDef<ApplicationModule>;" node_modules/@angular/core/core.d.ts
5656
if [[ $? != 0 ]]; then exit 1; fi
5757

5858
# Did it generate a base factory call for synthesized constructors correctly?
59-
grep "const ɵMatTable_BaseFactory = ɵngcc0.ΔgetInheritedFactory(MatTable);" node_modules/@angular/material/esm2015/table.js
59+
grep "const ɵMatTable_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm2015/table.js
6060
if [[ $? != 0 ]]; then exit 1; fi
61-
grep "const ɵMatTable_BaseFactory = ɵngcc0.ΔgetInheritedFactory(MatTable);" node_modules/@angular/material/esm5/table.es5.js
61+
grep "const ɵMatTable_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(MatTable);" node_modules/@angular/material/esm5/table.es5.js
6262
if [[ $? != 0 ]]; then exit 1; fi
6363

6464
# Can it be safely run again (as a noop)?

modules/benchmarks/src/tree/render3_function/index.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ɵRenderFlags, ɵrenderComponent as renderComponent, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔdefineComponent, ΔelementEnd, ΔelementStart, ΔelementStyleProp, ΔelementStyling, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation1, Δtext, ΔtextBinding} from '@angular/core';
9+
import {ɵRenderFlags, ɵrenderComponent as renderComponent, ɵɵcontainer, ɵɵcontainerRefreshEnd, ɵɵcontainerRefreshStart, ɵɵdefineComponent, ɵɵelementEnd, ɵɵelementStart, ɵɵelementStyleProp, ɵɵelementStyling, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵtext, ɵɵtextBinding} from '@angular/core';
1010

1111
import {bindAction, profile} from '../../util';
1212
import {createDom, destroyDom, detectChanges} from '../render3/tree';
@@ -18,7 +18,7 @@ export class TreeFunction {
1818
data: TreeNode = emptyTree;
1919

2020
/** @nocollapse */
21-
static ngComponentDef = ΔdefineComponent({
21+
static ngComponentDef = ɵɵdefineComponent({
2222
type: TreeFunction,
2323
selectors: [['tree']],
2424
consts: 5,
@@ -35,38 +35,38 @@ export class TreeFunction {
3535
const c1 = ['background-color'];
3636
export function TreeTpl(rf: ɵRenderFlags, ctx: TreeNode) {
3737
if (rf & ɵRenderFlags.Create) {
38-
ΔelementStart(0, 'tree');
38+
ɵɵelementStart(0, 'tree');
3939
{
40-
ΔelementStart(1, 'span');
41-
ΔelementStyling(null, c1);
42-
{ Δtext(2); }
43-
ΔelementEnd();
44-
Δcontainer(3);
45-
Δcontainer(4);
40+
ɵɵelementStart(1, 'span');
41+
ɵɵelementStyling(null, c1);
42+
{ ɵɵtext(2); }
43+
ɵɵelementEnd();
44+
ɵɵcontainer(3);
45+
ɵɵcontainer(4);
4646
}
47-
ΔelementEnd();
47+
ɵɵelementEnd();
4848
}
4949
if (rf & ɵRenderFlags.Update) {
50-
ΔelementStyleProp(1, 0, ctx.depth % 2 ? '' : 'grey');
51-
ΔtextBinding(2, Δinterpolation1(' ', ctx.value, ' '));
52-
ΔcontainerRefreshStart(3);
50+
ɵɵelementStyleProp(1, 0, ctx.depth % 2 ? '' : 'grey');
51+
ɵɵtextBinding(2, ɵɵinterpolation1(' ', ctx.value, ' '));
52+
ɵɵcontainerRefreshStart(3);
5353
{
5454
if (ctx.left != null) {
55-
let rf0 = ΔembeddedViewStart(0, 5, 1);
55+
let rf0 = ɵɵembeddedViewStart(0, 5, 1);
5656
{ TreeTpl(rf0, ctx.left); }
57-
ΔembeddedViewEnd();
57+
ɵɵembeddedViewEnd();
5858
}
5959
}
60-
ΔcontainerRefreshEnd();
61-
ΔcontainerRefreshStart(4);
60+
ɵɵcontainerRefreshEnd();
61+
ɵɵcontainerRefreshStart(4);
6262
{
6363
if (ctx.right != null) {
64-
let rf0 = ΔembeddedViewStart(0, 5, 1);
64+
let rf0 = ɵɵembeddedViewStart(0, 5, 1);
6565
{ TreeTpl(rf0, ctx.right); }
66-
ΔembeddedViewEnd();
66+
ɵɵembeddedViewEnd();
6767
}
6868
}
69-
ΔcontainerRefreshEnd();
69+
ɵɵcontainerRefreshEnd();
7070
}
7171
}
7272

packages/common/src/directives/ng_class.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {Directive, DoCheck, Input, ɵRenderFlags, ΔdefineDirective, ΔelementHostStyling, ΔelementHostStylingApply, ΔelementHostStylingMap} from '@angular/core';
8+
import {Directive, DoCheck, Input, ɵRenderFlags, ɵɵdefineDirective, ɵɵelementHostStyling, ɵɵelementHostStylingApply, ɵɵelementHostStylingMap} from '@angular/core';
99

1010
import {NgClassImpl, NgClassImplProvider} from './ng_class_impl';
1111

@@ -29,17 +29,17 @@ export const ngClassDirectiveDef__PRE_R3__ = undefined;
2929
// used when the VE is not present (note the directive will
3030
// never be instantiated normally because it is apart of a
3131
// base class)
32-
export const ngClassDirectiveDef__POST_R3__ = ΔdefineDirective({
32+
export const ngClassDirectiveDef__POST_R3__ = ɵɵdefineDirective({
3333
type: function() {} as any,
3434
selectors: null as any,
3535
factory: () => {},
3636
hostBindings: function(rf: ɵRenderFlags, ctx: any, elIndex: number) {
3737
if (rf & ɵRenderFlags.Create) {
38-
ΔelementHostStyling();
38+
ɵɵelementHostStyling();
3939
}
4040
if (rf & ɵRenderFlags.Update) {
41-
ΔelementHostStylingMap(ctx.getValue());
42-
ΔelementHostStylingApply();
41+
ɵɵelementHostStylingMap(ctx.getValue());
42+
ɵɵelementHostStylingApply();
4343
}
4444
}
4545
});

packages/common/src/directives/ng_style.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {Directive, DoCheck, Input, ɵRenderFlags, ΔdefineDirective, ΔelementHostStyling, ΔelementHostStylingApply, ΔelementHostStylingMap} from '@angular/core';
8+
import {Directive, DoCheck, Input, ɵRenderFlags, ɵɵdefineDirective, ɵɵelementHostStyling, ɵɵelementHostStylingApply, ɵɵelementHostStylingMap} from '@angular/core';
99

1010
import {NgStyleImpl, NgStyleImplProvider} from './ng_style_impl';
1111

@@ -29,17 +29,17 @@ export const ngStyleDirectiveDef__PRE_R3__ = undefined;
2929
// used when the VE is not present (note the directive will
3030
// never be instantiated normally because it is apart of a
3131
// base class)
32-
export const ngStyleDirectiveDef__POST_R3__ = ΔdefineDirective({
32+
export const ngStyleDirectiveDef__POST_R3__ = ɵɵdefineDirective({
3333
type: function() {} as any,
3434
selectors: null as any,
3535
factory: () => {},
3636
hostBindings: function(rf: ɵRenderFlags, ctx: any, elIndex: number) {
3737
if (rf & ɵRenderFlags.Create) {
38-
ΔelementHostStyling();
38+
ɵɵelementHostStyling();
3939
}
4040
if (rf & ɵRenderFlags.Update) {
41-
ΔelementHostStylingMap(null, ctx.getValue());
42-
ΔelementHostStylingApply();
41+
ɵɵelementHostStylingMap(null, ctx.getValue());
42+
ɵɵelementHostStylingApply();
4343
}
4444
}
4545
});

packages/common/src/viewport_scroller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ErrorHandler, ΔdefineInjectable, Δinject} from '@angular/core';
9+
import {ErrorHandler, ɵɵdefineInjectable, ɵɵinject} from '@angular/core';
1010

1111
import {DOCUMENT} from './dom_tokens';
1212

@@ -21,9 +21,9 @@ export abstract class ViewportScroller {
2121
// De-sugared tree-shakable injection
2222
// See #23917
2323
/** @nocollapse */
24-
static ngInjectableDef = ΔdefineInjectable({
24+
static ngInjectableDef = ɵɵdefineInjectable({
2525
providedIn: 'root',
26-
factory: () => new BrowserViewportScroller(Δinject(DOCUMENT), window, Δinject(ErrorHandler))
26+
factory: () => new BrowserViewportScroller(ɵɵinject(DOCUMENT), window, ɵɵinject(ErrorHandler))
2727
});
2828

2929
/**

packages/compiler-cli/ngcc/test/rendering/renderer_spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ describe('Renderer', () => {
152152
const addDefinitionsSpy = renderer.addDefinitions as jasmine.Spy;
153153
expect(addDefinitionsSpy.calls.first().args[2])
154154
.toEqual(
155-
`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) {
156-
ɵngcc0.Δtext(0);
155+
`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) {
156+
ɵngcc0.ɵɵtext(0);
157157
} if (rf & 2) {
158-
ɵngcc0.Δselect(0);
159-
ɵngcc0.ΔtextBinding(0, ɵngcc0.Δinterpolation1("", ctx.person.name, ""));
158+
ɵngcc0.ɵɵselect(0);
159+
ɵngcc0.ɵɵtextBinding(0, ɵngcc0.ɵɵinterpolation1("", ctx.person.name, ""));
160160
} }, encapsulation: 2 });
161161
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
162162
type: Component,
@@ -197,7 +197,7 @@ describe('Renderer', () => {
197197
}));
198198
expect(addDefinitionsSpy.calls.first().args[2])
199199
.toEqual(
200-
`A.ngDirectiveDef = ɵngcc0.ΔdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });
200+
`A.ngDirectiveDef = ɵngcc0.ɵɵdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });
201201
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
202202
type: Directive,
203203
args: [{ selector: '[a]' }]
@@ -331,7 +331,7 @@ describe('Renderer', () => {
331331
const typingsFile = result.find(f => f.path === '/typings/file.d.ts') !;
332332
expect(typingsFile.contents)
333333
.toContain(
334-
'foo(x: number): number;\n static ngDirectiveDef: ɵngcc0.ΔDirectiveDefWithMeta');
334+
'foo(x: number): number;\n static ngDirectiveDef: ɵngcc0.ɵɵDirectiveDefWithMeta');
335335
});
336336

337337
it('should render imports into typings files', () => {

packages/compiler-cli/src/metadata/bundler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ export class MetadataBundler {
423423
result[key] = this.convertFunction(moduleName, value);
424424
} else if (isMetadataSymbolicCallExpression(value)) {
425425
// Class members can also contain static members that call a function with module
426-
// references. e.g. "static ngInjectableDef = ΔdefineInjectable(..)". We also need to
426+
// references. e.g. "static ngInjectableDef = ɵɵdefineInjectable(..)". We also need to
427427
// convert these module references because otherwise these resolve to non-existent files.
428428
result[key] = this.convertValue(moduleName, value);
429429
} else {

packages/compiler-cli/src/ngtsc/imports/src/core.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ export class NoopImportRewriter implements ImportRewriter {
4848
* which they're exported from r3_symbols.
4949
*/
5050
const CORE_SUPPORTED_SYMBOLS = new Map<string, string>([
51-
['ΔdefineInjectable', 'ΔdefineInjectable'],
52-
['ΔdefineInjector', 'ΔdefineInjector'],
53-
['ΔdefineNgModule', 'ΔdefineNgModule'],
54-
['ΔsetNgModuleScope', 'ΔsetNgModuleScope'],
55-
['Δinject', 'Δinject'],
51+
['ɵɵdefineInjectable', 'ɵɵdefineInjectable'],
52+
['ɵɵdefineInjector', 'ɵɵdefineInjector'],
53+
['ɵɵdefineNgModule', 'ɵɵdefineNgModule'],
54+
['ɵɵsetNgModuleScope', 'ɵɵsetNgModuleScope'],
55+
['ɵɵinject', 'ɵɵinject'],
5656
['ɵsetClassMetadata', 'setClassMetadata'],
57-
['ΔInjectableDef', 'ΔInjectableDef'],
58-
['ΔInjectorDef', 'ΔInjectorDef'],
59-
['ΔNgModuleDefWithMeta', 'ΔNgModuleDefWithMeta'],
57+
['ɵɵInjectableDef', 'ɵɵInjectableDef'],
58+
['ɵɵInjectorDef', 'ɵɵInjectorDef'],
59+
['ɵɵNgModuleDefWithMeta', 'ɵɵNgModuleDefWithMeta'],
6060
['ɵNgModuleFactory', 'NgModuleFactory'],
6161
]);
6262

packages/compiler-cli/test/compliance/mock_compiler_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('mock_compiler', () => {
140140
expectEmit(
141141
result.source, `
142142
// TODO: this comment should not be taken into account
143-
$r3$.Δtext(0, "Hello!");
143+
$r3$.ɵɵtext(0, "Hello!");
144144
// TODO: this comment should not be taken into account
145145
`,
146146
'todo comments should be ignored');

0 commit comments

Comments
 (0)