Skip to content

Commit cf86ed7

Browse files
benleshalxhub
authored andcommitted
refactor(ivy): migrate ɵɵ prefix back to Δ (angular#30362)
Now that issues are resolved with Closure compiler, we can move back to our desired prefix of `Δ`. PR Close angular#30362
1 parent dbb150a commit cf86ed7

File tree

142 files changed

+6433
-6469
lines changed

Some content is hidden

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

142 files changed

+6433
-6469
lines changed

aio/content/guide/deprecations.md

Lines changed: 47 additions & 47 deletions
Large diffs are not rendered by default.

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 [double barred latin o](https://en.wikipedia.org/wiki/%C6%9F) (`ɵɵ`).
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)) (`Δ`).
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: 23 additions & 23 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, ɵɵembeddedViewEnd, ɵɵembeddedViewStart, ɵɵinterpolation1, ɵɵselect, ɵɵstyleProp, ɵɵstyling, ɵɵtext, ɵɵtextBinding} from '@angular/core';
9+
import {ɵRenderFlags, ɵrenderComponent as renderComponent, Δcontainer, ΔcontainerRefreshEnd, ΔcontainerRefreshStart, ΔdefineComponent, ΔelementEnd, ΔelementStart, ΔembeddedViewEnd, ΔembeddedViewStart, Δinterpolation1, Δselect, ΔstyleProp, Δstyling, Δ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,41 +35,41 @@ 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-
ɵɵstyling(null, c1);
42-
{ ɵɵtext(2); }
43-
ɵɵelementEnd();
44-
ɵɵcontainer(3);
45-
ɵɵcontainer(4);
40+
ΔelementStart(1, 'span');
41+
Δstyling(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-
ɵɵselect(1);
51-
ɵɵstyleProp(0, ctx.depth % 2 ? '' : 'grey');
52-
ɵɵstyling();
53-
ɵɵselect(2);
54-
ɵɵtextBinding(2, ɵɵinterpolation1(' ', ctx.value, ' '));
55-
ɵɵcontainerRefreshStart(3);
50+
Δselect(1);
51+
ΔstyleProp(0, ctx.depth % 2 ? '' : 'grey');
52+
Δstyling();
53+
Δselect(2);
54+
ΔtextBinding(2, Δinterpolation1(' ', ctx.value, ' '));
55+
ΔcontainerRefreshStart(3);
5656
{
5757
if (ctx.left != null) {
58-
let rf0 = ɵɵembeddedViewStart(0, 5, 1);
58+
let rf0 = ΔembeddedViewStart(0, 5, 1);
5959
{ TreeTpl(rf0, ctx.left); }
60-
ɵɵembeddedViewEnd();
60+
ΔembeddedViewEnd();
6161
}
6262
}
63-
ɵɵcontainerRefreshEnd();
64-
ɵɵcontainerRefreshStart(4);
63+
ΔcontainerRefreshEnd();
64+
ΔcontainerRefreshStart(4);
6565
{
6666
if (ctx.right != null) {
67-
let rf0 = ɵɵembeddedViewStart(0, 5, 1);
67+
let rf0 = ΔembeddedViewStart(0, 5, 1);
6868
{ TreeTpl(rf0, ctx.right); }
69-
ɵɵembeddedViewEnd();
69+
ΔembeddedViewEnd();
7070
}
7171
}
72-
ɵɵcontainerRefreshEnd();
72+
ΔcontainerRefreshEnd();
7373
}
7474
}
7575

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, ɵɵclassMap, ɵɵdefineDirective, ɵɵstyling, ɵɵstylingApply} from '@angular/core';
8+
import {Directive, DoCheck, Input, ɵRenderFlags, ΔclassMap, ΔdefineDirective, Δstyling, ΔstylingApply} 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-
ɵɵstyling();
38+
Δstyling();
3939
}
4040
if (rf & ɵRenderFlags.Update) {
41-
ɵɵclassMap(ctx.getValue());
42-
ɵɵstylingApply();
41+
ΔclassMap(ctx.getValue());
42+
ΔstylingApply();
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, ɵɵstyleMap, ɵɵstyling, ɵɵstylingApply} from '@angular/core';
8+
import {Directive, DoCheck, Input, ɵRenderFlags, ΔdefineDirective, ΔstyleMap, Δstyling, ΔstylingApply} 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-
ɵɵstyling();
38+
Δstyling();
3939
}
4040
if (rf & ɵRenderFlags.Update) {
41-
ɵɵstyleMap(ctx.getValue());
42-
ɵɵstylingApply();
41+
ΔstyleMap(ctx.getValue());
42+
ΔstylingApply();
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
@@ -160,11 +160,11 @@ describe('Renderer', () => {
160160
const addDefinitionsSpy = renderer.addDefinitions as jasmine.Spy;
161161
expect(addDefinitionsSpy.calls.first().args[2])
162162
.toEqual(
163-
`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) {
164-
ɵngcc0.ɵɵtext(0);
163+
`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) {
164+
ɵngcc0.Δtext(0);
165165
} if (rf & 2) {
166-
ɵngcc0.ɵɵselect(0);
167-
ɵngcc0.ɵɵtextBinding(0, ɵngcc0.ɵɵinterpolation1("", ctx.person.name, ""));
166+
ɵngcc0.Δselect(0);
167+
ɵngcc0.ΔtextBinding(0, ɵngcc0.Δinterpolation1("", ctx.person.name, ""));
168168
} }, encapsulation: 2 });
169169
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
170170
type: Component,
@@ -205,7 +205,7 @@ describe('Renderer', () => {
205205
}));
206206
expect(addDefinitionsSpy.calls.first().args[2])
207207
.toEqual(
208-
`A.ngDirectiveDef = ɵngcc0.ɵɵdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });
208+
`A.ngDirectiveDef = ɵngcc0.ΔdefineDirective({ type: A, selectors: [["", "a", ""]], factory: function A_Factory(t) { return new (t || A)(); } });
209209
/*@__PURE__*/ ɵngcc0.ɵsetClassMetadata(A, [{
210210
type: Directive,
211211
args: [{ selector: '[a]' }]
@@ -339,7 +339,7 @@ describe('Renderer', () => {
339339
const typingsFile = result.find(f => f.path === '/typings/file.d.ts') !;
340340
expect(typingsFile.contents)
341341
.toContain(
342-
'foo(x: number): number;\n static ngDirectiveDef: ɵngcc0.ɵɵDirectiveDefWithMeta');
342+
'foo(x: number): number;\n static ngDirectiveDef: ɵngcc0.ΔDirectiveDefWithMeta');
343343
});
344344

345345
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_compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as ts from 'typescript';
1414
import {NgtscProgram} from '../../src/ngtsc/program';
1515

1616

17-
const IDENTIFIER = /[A-Za-z_$ɵ][A-Za-z0-9_$]*/;
17+
const IDENTIFIER = /[A-Za-z_$ɵΔ][A-Za-z0-9_$]*/;
1818
const OPERATOR =
1919
/!|\?|%|\*|\/|\^|&&?|\|\|?|\(|\)|\{|\}|\[|\]|:|;|<=?|>=?|={1,3}|!==?|=>|\+\+?|--?|@|,|\.|\.\.\./;
2020
const STRING = /'[^']*'|"[^"]*"|`[\s\S]*?`/;

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)