Skip to content

Commit 2bfc5ae

Browse files
committed
fix(@schematics/angular): Remove experimental from zoneless
This commit removes experimental from the option and provider names
1 parent 05485ed commit 2bfc5ae

File tree

12 files changed

+35
-35
lines changed

12 files changed

+35
-35
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule, provideBrowserGlobalErrorListeners<% if(experimentalZoneless) { %>, provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';
1+
import { NgModule, provideBrowserGlobalErrorListeners<% if(zoneless) { %>, provideZonelessChangeDetection<% } %> } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
<% if (routing) { %>
44
import { AppRoutingModule } from './app-routing-module';<% } %>
@@ -13,8 +13,8 @@ import { App } from './app';
1313
AppRoutingModule<% } %>
1414
],
1515
providers: [
16-
provideBrowserGlobalErrorListeners()<% if (experimentalZoneless) { %>,
17-
provideExperimentalZonelessChangeDetection()<% } %>
16+
provideBrowserGlobalErrorListeners()<% if (zoneless) { %>,
17+
provideZonelessChangeDetection()<% } %>
1818
],
1919
bootstrap: [App]
2020
})

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,12 +1,12 @@
1-
import { ApplicationConfig, provideBrowserGlobalErrorListeners, <% if(!experimentalZoneless) { %>provideZoneChangeDetection<% } else { %>provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
1+
import { ApplicationConfig, provideBrowserGlobalErrorListeners, <% 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 = {
77
providers: [
88
provideBrowserGlobalErrorListeners(),
9-
<% if(experimentalZoneless) { %>provideExperimentalZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %>,
9+
<% if(zoneless) { %>provideZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %>,
1010
<% if (routing) {%>provideRouter(routes)<% } %>
1111
]
1212
};

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
@@ -258,7 +258,7 @@ function addAppToWorkspaceFile(
258258
options: {
259259
index: `${sourceRoot}/index.html`,
260260
browser: `${sourceRoot}/main.ts`,
261-
polyfills: options.experimentalZoneless ? [] : ['zone.js'],
261+
polyfills: options.zoneless ? [] : ['zone.js'],
262262
tsConfig: `${projectRoot}tsconfig.app.json`,
263263
inlineStyleLanguage,
264264
assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }],
@@ -297,7 +297,7 @@ function addAppToWorkspaceFile(
297297
: {
298298
builder: Builders.BuildKarma,
299299
options: {
300-
polyfills: options.experimentalZoneless ? [] : ['zone.js', 'zone.js/testing'],
300+
polyfills: options.zoneless ? [] : ['zone.js', 'zone.js/testing'],
301301
tsConfig: `${projectRoot}tsconfig.spec.json`,
302302
inlineStyleLanguage,
303303
assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }],

packages/schematics/angular/application/index_spec.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -729,70 +729,70 @@ describe('Application Schematic', () => {
729729
);
730730
});
731731

732-
it('should add provideExperimentalZonelessChangeDetection() in app-module.ts when experimentalZoneless is true', async () => {
732+
it('should add provideZonelessChangeDetection() in app-module.ts when zoneless is true', async () => {
733733
const tree = await schematicRunner.runSchematic(
734734
'application',
735735
{
736736
...defaultOptions,
737-
experimentalZoneless: true,
737+
zoneless: true,
738738
standalone: false,
739739
},
740740
workspaceTree,
741741
);
742742
const path = '/projects/foo/src/app/app-module.ts';
743743
const fileContent = tree.readContent(path);
744-
expect(fileContent).toContain('provideExperimentalZonelessChangeDetection()');
744+
expect(fileContent).toContain('provideZonelessChangeDetection()');
745745
});
746746

747-
it('should not add provideExperimentalZonelessChangeDetection() in app-module.ts when experimentalZoneless is false', async () => {
747+
it('should not add provideZonelessChangeDetection() in app-module.ts when zoneless is false', async () => {
748748
const tree = await schematicRunner.runSchematic(
749749
'application',
750750
{
751751
...defaultOptions,
752-
experimentalZoneless: false,
752+
zoneless: false,
753753
standalone: false,
754754
},
755755
workspaceTree,
756756
);
757757
const path = '/projects/foo/src/app/app-module.ts';
758758
const fileContent = tree.readContent(path);
759-
expect(fileContent).not.toContain('provideExperimentalZonelessChangeDetection()');
759+
expect(fileContent).not.toContain('provideZonelessChangeDetection()');
760760
});
761761

762-
it('should add provideExperimentalZonelessChangeDetection() when experimentalZoneless is true', async () => {
762+
it('should add provideZonelessChangeDetection() when zoneless is true', async () => {
763763
const tree = await schematicRunner.runSchematic(
764764
'application',
765765
{
766766
...defaultOptions,
767-
experimentalZoneless: true,
767+
zoneless: true,
768768
},
769769
workspaceTree,
770770
);
771771
const path = '/projects/foo/src/app/app.config.ts';
772772
const fileContent = tree.readContent(path);
773-
expect(fileContent).toContain('provideExperimentalZonelessChangeDetection()');
773+
expect(fileContent).toContain('provideZonelessChangeDetection()');
774774
});
775775

776-
it('should not add provideExperimentalZonelessChangeDetection() when experimentalZoneless is false', async () => {
776+
it('should not add provideZonelessChangeDetection() when zoneless is false', async () => {
777777
const tree = await schematicRunner.runSchematic(
778778
'application',
779779
{
780780
...defaultOptions,
781-
experimentalZoneless: false,
781+
zoneless: false,
782782
},
783783
workspaceTree,
784784
);
785785
const path = '/projects/foo/src/app/app.config.ts';
786786
const fileContent = tree.readContent(path);
787-
expect(fileContent).not.toContain('provideExperimentalZonelessChangeDetection()');
787+
expect(fileContent).not.toContain('provideZonelessChangeDetection()');
788788
});
789789

790-
it('should not add provideZoneChangeDetection when experimentalZoneless is true', async () => {
790+
it('should not add provideZoneChangeDetection when zoneless is true', async () => {
791791
const tree = await schematicRunner.runSchematic(
792792
'application',
793793
{
794794
...defaultOptions,
795-
experimentalZoneless: true,
795+
zoneless: true,
796796
},
797797
workspaceTree,
798798
);

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)