Skip to content

Commit 4c27493

Browse files
committed
fix(@schematics/angular): Remove experimental from zoneless
This commit removes experimental from the option and provider names
1 parent 92e193c commit 4c27493

File tree

12 files changed

+34
-34
lines changed

12 files changed

+34
-34
lines changed

packages/angular/ssr/test/testing-utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
EnvironmentProviders,
1212
Provider,
1313
Type,
14-
provideExperimentalZonelessChangeDetection,
14+
provideZonelessChangeDetection,
1515
} from '@angular/core';
1616
import { bootstrapApplication } from '@angular/platform-browser';
1717
import { RouterOutlet, Routes, provideRouter } from '@angular/router';
@@ -93,7 +93,7 @@ export function setAngularAppTestingManifest(
9393
bootstrap: async () => () => {
9494
return bootstrapApplication(rootComponent, {
9595
providers: [
96-
provideExperimentalZonelessChangeDetection(),
96+
provideZonelessChangeDetection(),
9797
provideRouter(routes),
9898
provideServerRendering(withRoutes(serverRoutes)),
9999
...extraProviders,

packages/schematics/angular/application/files/module-files/src/app/app.module.ts.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule<% if(experimentalZoneless) { %>, provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';
1+
import { NgModule<% if(zoneless) { %>, provideZonelessChangeDetection<% } %> } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
<% if (routing) { %>
44
import { AppRoutingModule } from './app-routing.module';<% } %>
@@ -12,7 +12,7 @@ import { App } from './app';
1212
BrowserModule<% if (routing) { %>,
1313
AppRoutingModule<% } %>
1414
],
15-
providers: [<% if (experimentalZoneless) { %>provideExperimentalZonelessChangeDetection()<% } %>],
15+
providers: [<% if (zoneless) { %>provideZonelessChangeDetection()<% } %>],
1616
bootstrap: [App]
1717
})
1818
export class AppModule { }

packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<% if(experimentalZoneless) { %>import { provideExperimentalZonelessChangeDetection } from '@angular/core';
1+
<% if(zoneless) { %>import { provideZonelessChangeDetection } from '@angular/core';
22
<% } %>import { TestBed } from '@angular/core/testing';<% if (routing) { %>
33
import { RouterModule } from '@angular/router';<% } %>
44
import { App } from './app';
@@ -11,8 +11,8 @@ describe('App', () => {
1111
],<% } %>
1212
declarations: [
1313
App
14-
],<% if(experimentalZoneless) { %>
15-
providers: [provideExperimentalZonelessChangeDetection()]<% } %>
14+
],<% if(zoneless) { %>
15+
providers: [provideZonelessChangeDetection()]<% } %>
1616
}).compileComponents();
1717
});
1818

packages/schematics/angular/application/files/module-files/src/main.ts.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { AppModule } from './app/app.module';
44

55
platformBrowser().bootstrapModule(AppModule, {
6-
<% if(!experimentalZoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %>
6+
<% if(!zoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %>
77
defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %>
88
})
99
.catch(err => console.error(err));
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { ApplicationConfig, <% if(!experimentalZoneless) { %>provideZoneChangeDetection<% } else { %>provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
1+
import { ApplicationConfig, <% if(!zoneless) { %>provideZoneChangeDetection<% } else { %>provideZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
22
import { provideRouter } from '@angular/router';
33

44
import { routes } from './app.routes';<% } %>
55

66
export const appConfig: ApplicationConfig = {
7-
providers: [<% if(experimentalZoneless) { %>provideExperimentalZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %><% if (routing) {%>, provideRouter(routes)<% } %>]
7+
providers: [<% if(zoneless) { %>provideZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %><% if (routing) {%>, provideRouter(routes)<% } %>]
88
};

packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<% if(experimentalZoneless) { %>import { provideExperimentalZonelessChangeDetection } from '@angular/core';
1+
<% if(zoneless) { %>import { provideZonelessChangeDetection } from '@angular/core';
22
<% } %>import { TestBed } from '@angular/core/testing';
33
import { App } from './app';
44

55
describe('App', () => {
66
beforeEach(async () => {
77
await TestBed.configureTestingModule({
8-
imports: [App],<% if(experimentalZoneless) { %>
9-
providers: [provideExperimentalZonelessChangeDetection()]<% } %>
8+
imports: [App],<% if(zoneless) { %>
9+
providers: [provideZonelessChangeDetection()]<% } %>
1010
}).compileComponents();
1111
});
1212

packages/schematics/angular/application/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function addAppToWorkspaceFile(
238238
options: {
239239
index: `${sourceRoot}/index.html`,
240240
browser: `${sourceRoot}/main.ts`,
241-
polyfills: options.experimentalZoneless ? [] : ['zone.js'],
241+
polyfills: options.zoneless ? [] : ['zone.js'],
242242
tsConfig: `${projectRoot}tsconfig.app.json`,
243243
inlineStyleLanguage,
244244
assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }],
@@ -277,7 +277,7 @@ function addAppToWorkspaceFile(
277277
: {
278278
builder: Builders.BuildKarma,
279279
options: {
280-
polyfills: options.experimentalZoneless ? [] : ['zone.js', 'zone.js/testing'],
280+
polyfills: options.zoneless ? [] : ['zone.js', 'zone.js/testing'],
281281
tsConfig: `${projectRoot}tsconfig.spec.json`,
282282
inlineStyleLanguage,
283283
assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }],

packages/schematics/angular/application/index_spec.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -696,70 +696,70 @@ describe('Application Schematic', () => {
696696
);
697697
});
698698

699-
it('should add provideExperimentalZonelessChangeDetection() in app.module.ts when experimentalZoneless is true', async () => {
699+
it('should add provideZonelessChangeDetection() in app.module.ts when zoneless is true', async () => {
700700
const tree = await schematicRunner.runSchematic(
701701
'application',
702702
{
703703
...defaultOptions,
704-
experimentalZoneless: true,
704+
zoneless: true,
705705
standalone: false,
706706
},
707707
workspaceTree,
708708
);
709709
const path = '/projects/foo/src/app/app.module.ts';
710710
const fileContent = tree.readContent(path);
711-
expect(fileContent).toContain('provideExperimentalZonelessChangeDetection()');
711+
expect(fileContent).toContain('provideZonelessChangeDetection()');
712712
});
713713

714-
it('should not add provideExperimentalZonelessChangeDetection() in app.module.ts when experimentalZoneless is false', async () => {
714+
it('should not add provideZonelessChangeDetection() in app.module.ts when zoneless is false', async () => {
715715
const tree = await schematicRunner.runSchematic(
716716
'application',
717717
{
718718
...defaultOptions,
719-
experimentalZoneless: false,
719+
zoneless: false,
720720
standalone: false,
721721
},
722722
workspaceTree,
723723
);
724724
const path = '/projects/foo/src/app/app.module.ts';
725725
const fileContent = tree.readContent(path);
726-
expect(fileContent).not.toContain('provideExperimentalZonelessChangeDetection()');
726+
expect(fileContent).not.toContain('provideZonelessChangeDetection()');
727727
});
728728

729-
it('should add provideExperimentalZonelessChangeDetection() when experimentalZoneless is true', async () => {
729+
it('should add provideZonelessChangeDetection() when zoneless is true', async () => {
730730
const tree = await schematicRunner.runSchematic(
731731
'application',
732732
{
733733
...defaultOptions,
734-
experimentalZoneless: true,
734+
zoneless: true,
735735
},
736736
workspaceTree,
737737
);
738738
const path = '/projects/foo/src/app/app.config.ts';
739739
const fileContent = tree.readContent(path);
740-
expect(fileContent).toContain('provideExperimentalZonelessChangeDetection()');
740+
expect(fileContent).toContain('provideZonelessChangeDetection()');
741741
});
742742

743-
it('should not add provideExperimentalZonelessChangeDetection() when experimentalZoneless is false', async () => {
743+
it('should not add provideZonelessChangeDetection() when zoneless is false', async () => {
744744
const tree = await schematicRunner.runSchematic(
745745
'application',
746746
{
747747
...defaultOptions,
748-
experimentalZoneless: false,
748+
zoneless: false,
749749
},
750750
workspaceTree,
751751
);
752752
const path = '/projects/foo/src/app/app.config.ts';
753753
const fileContent = tree.readContent(path);
754-
expect(fileContent).not.toContain('provideExperimentalZonelessChangeDetection()');
754+
expect(fileContent).not.toContain('provideZonelessChangeDetection()');
755755
});
756756

757-
it('should not add provideZoneChangeDetection when experimentalZoneless is true', async () => {
757+
it('should not add provideZoneChangeDetection when zoneless is true', async () => {
758758
const tree = await schematicRunner.runSchematic(
759759
'application',
760760
{
761761
...defaultOptions,
762-
experimentalZoneless: true,
762+
zoneless: true,
763763
},
764764
workspaceTree,
765765
);

packages/schematics/angular/application/schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"default": false,
119119
"x-user-analytics": "ep.ng_ssr"
120120
},
121-
"experimentalZoneless": {
121+
"zoneless": {
122122
"description": "Generate an application that does not use `zone.js`.",
123123
"type": "boolean",
124124
"default": false

packages/schematics/angular/ng-new/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default function (options: NgNewOptions): Rule {
5757
minimal: options.minimal,
5858
standalone: options.standalone,
5959
ssr: options.ssr,
60-
experimentalZoneless: options.experimentalZoneless,
60+
zoneless: options.zoneless,
6161
};
6262

6363
return chain([

packages/schematics/angular/ng-new/schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
"type": "boolean",
140140
"x-user-analytics": "ep.ng_ssr"
141141
},
142-
"experimentalZoneless": {
142+
"zoneless": {
143143
"description": "Create an initial application that does not utilize `zone.js`.",
144144
"type": "boolean",
145145
"default": false

tests/legacy-cli/e2e/tests/build/wasm-esm.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ export default async function () {
6565
await replaceInFile(
6666
'src/app/app.config.ts',
6767
'provideZoneChangeDetection',
68-
'provideExperimentalZonelessChangeDetection',
68+
'provideZonelessChangeDetection',
6969
);
7070
await replaceInFile(
7171
'src/app/app.config.ts',
7272
'provideZoneChangeDetection({ eventCoalescing: true })',
73-
'provideExperimentalZonelessChangeDetection()',
73+
'provideZonelessChangeDetection()',
7474
);
7575

7676
await ng('build');

0 commit comments

Comments
 (0)