diff --git a/packages/angular/ssr/test/testing-utils.ts b/packages/angular/ssr/test/testing-utils.ts index 92521972ac58..9f1cd076e33e 100644 --- a/packages/angular/ssr/test/testing-utils.ts +++ b/packages/angular/ssr/test/testing-utils.ts @@ -11,7 +11,7 @@ import { EnvironmentProviders, Provider, Type, - provideExperimentalZonelessChangeDetection, + provideZonelessChangeDetection, } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser'; import { RouterOutlet, Routes, provideRouter } from '@angular/router'; @@ -93,7 +93,7 @@ export function setAngularAppTestingManifest( bootstrap: async () => () => { return bootstrapApplication(rootComponent, { providers: [ - provideExperimentalZonelessChangeDetection(), + provideZonelessChangeDetection(), provideRouter(routes), provideServerRendering(withRoutes(serverRoutes)), ...extraProviders, diff --git a/packages/schematics/angular/application/files/module-files/src/app/app-module.ts.template b/packages/schematics/angular/application/files/module-files/src/app/app-module.ts.template index a9a5a07900cb..6adc80524f72 100644 --- a/packages/schematics/angular/application/files/module-files/src/app/app-module.ts.template +++ b/packages/schematics/angular/application/files/module-files/src/app/app-module.ts.template @@ -1,4 +1,4 @@ -import { NgModule, provideBrowserGlobalErrorListeners<% if(experimentalZoneless) { %>, provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core'; +import { NgModule, provideBrowserGlobalErrorListeners<% if(zoneless) { %>, provideZonelessChangeDetection<% } %> } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; <% if (routing) { %> import { AppRoutingModule } from './app-routing-module';<% } %> @@ -13,8 +13,8 @@ import { App } from './app'; AppRoutingModule<% } %> ], providers: [ - provideBrowserGlobalErrorListeners()<% if (experimentalZoneless) { %>, - provideExperimentalZonelessChangeDetection()<% } %> + provideBrowserGlobalErrorListeners()<% if (zoneless) { %>, + provideZonelessChangeDetection()<% } %> ], bootstrap: [App] }) diff --git a/packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template b/packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template index d9e11422c77e..e3f5c5fff092 100644 --- a/packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template +++ b/packages/schematics/angular/application/files/module-files/src/app/app.spec.ts.template @@ -1,4 +1,4 @@ -<% if(experimentalZoneless) { %>import { provideExperimentalZonelessChangeDetection } from '@angular/core'; +<% if(zoneless) { %>import { provideZonelessChangeDetection } from '@angular/core'; <% } %>import { TestBed } from '@angular/core/testing';<% if (routing) { %> import { RouterModule } from '@angular/router';<% } %> import { App } from './app'; @@ -11,8 +11,8 @@ describe('App', () => { ],<% } %> declarations: [ App - ],<% if(experimentalZoneless) { %> - providers: [provideExperimentalZonelessChangeDetection()]<% } %> + ],<% if(zoneless) { %> + providers: [provideZonelessChangeDetection()]<% } %> }).compileComponents(); }); diff --git a/packages/schematics/angular/application/files/module-files/src/main.ts.template b/packages/schematics/angular/application/files/module-files/src/main.ts.template index 97d2d132989c..407a18d4a65d 100644 --- a/packages/schematics/angular/application/files/module-files/src/main.ts.template +++ b/packages/schematics/angular/application/files/module-files/src/main.ts.template @@ -3,7 +3,7 @@ import { AppModule } from './app/app-module'; platformBrowser().bootstrapModule(AppModule, { - <% if(!experimentalZoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %> + <% if(!zoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %> defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %> }) .catch(err => console.error(err)); diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template index d45afde0b35e..638b2acd363a 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template @@ -1,4 +1,4 @@ -import { ApplicationConfig, provideBrowserGlobalErrorListeners, <% if(!experimentalZoneless) { %>provideZoneChangeDetection<% } else { %>provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %> +import { ApplicationConfig, provideBrowserGlobalErrorListeners, <% if(!zoneless) { %>provideZoneChangeDetection<% } else { %>provideZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %> import { provideRouter } from '@angular/router'; import { routes } from './app.routes';<% } %> @@ -6,7 +6,7 @@ import { routes } from './app.routes';<% } %> export const appConfig: ApplicationConfig = { providers: [ provideBrowserGlobalErrorListeners(), - <% if(experimentalZoneless) { %>provideExperimentalZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %>, + <% if(zoneless) { %>provideZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %>, <% if (routing) {%>provideRouter(routes)<% } %> ] }; diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template index 8d52e127f1dd..eb529a1df3c7 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/app/app.spec.ts.template @@ -1,12 +1,12 @@ -<% if(experimentalZoneless) { %>import { provideExperimentalZonelessChangeDetection } from '@angular/core'; +<% if(zoneless) { %>import { provideZonelessChangeDetection } from '@angular/core'; <% } %>import { TestBed } from '@angular/core/testing'; import { App } from './app'; describe('App', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [App],<% if(experimentalZoneless) { %> - providers: [provideExperimentalZonelessChangeDetection()]<% } %> + imports: [App],<% if(zoneless) { %> + providers: [provideZonelessChangeDetection()]<% } %> }).compileComponents(); }); diff --git a/packages/schematics/angular/application/index.ts b/packages/schematics/angular/application/index.ts index 1a39e397a90b..e84c5ba7a121 100644 --- a/packages/schematics/angular/application/index.ts +++ b/packages/schematics/angular/application/index.ts @@ -258,7 +258,7 @@ function addAppToWorkspaceFile( options: { index: `${sourceRoot}/index.html`, browser: `${sourceRoot}/main.ts`, - polyfills: options.experimentalZoneless ? [] : ['zone.js'], + polyfills: options.zoneless ? [] : ['zone.js'], tsConfig: `${projectRoot}tsconfig.app.json`, inlineStyleLanguage, assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }], @@ -297,7 +297,7 @@ function addAppToWorkspaceFile( : { builder: Builders.BuildKarma, options: { - polyfills: options.experimentalZoneless ? [] : ['zone.js', 'zone.js/testing'], + polyfills: options.zoneless ? [] : ['zone.js', 'zone.js/testing'], tsConfig: `${projectRoot}tsconfig.spec.json`, inlineStyleLanguage, assets: [{ 'glob': '**/*', 'input': `${projectRoot}public` }], diff --git a/packages/schematics/angular/application/index_spec.ts b/packages/schematics/angular/application/index_spec.ts index f1e39307e4e9..0607a20b766e 100644 --- a/packages/schematics/angular/application/index_spec.ts +++ b/packages/schematics/angular/application/index_spec.ts @@ -745,70 +745,70 @@ describe('Application Schematic', () => { ); }); - it('should add provideExperimentalZonelessChangeDetection() in app-module.ts when experimentalZoneless is true', async () => { + it('should add provideZonelessChangeDetection() in app-module.ts when zoneless is true', async () => { const tree = await schematicRunner.runSchematic( 'application', { ...defaultOptions, - experimentalZoneless: true, + zoneless: true, standalone: false, }, workspaceTree, ); const path = '/projects/foo/src/app/app-module.ts'; const fileContent = tree.readContent(path); - expect(fileContent).toContain('provideExperimentalZonelessChangeDetection()'); + expect(fileContent).toContain('provideZonelessChangeDetection()'); }); - it('should not add provideExperimentalZonelessChangeDetection() in app-module.ts when experimentalZoneless is false', async () => { + it('should not add provideZonelessChangeDetection() in app-module.ts when zoneless is false', async () => { const tree = await schematicRunner.runSchematic( 'application', { ...defaultOptions, - experimentalZoneless: false, + zoneless: false, standalone: false, }, workspaceTree, ); const path = '/projects/foo/src/app/app-module.ts'; const fileContent = tree.readContent(path); - expect(fileContent).not.toContain('provideExperimentalZonelessChangeDetection()'); + expect(fileContent).not.toContain('provideZonelessChangeDetection()'); }); - it('should add provideExperimentalZonelessChangeDetection() when experimentalZoneless is true', async () => { + it('should add provideZonelessChangeDetection() when zoneless is true', async () => { const tree = await schematicRunner.runSchematic( 'application', { ...defaultOptions, - experimentalZoneless: true, + zoneless: true, }, workspaceTree, ); const path = '/projects/foo/src/app/app.config.ts'; const fileContent = tree.readContent(path); - expect(fileContent).toContain('provideExperimentalZonelessChangeDetection()'); + expect(fileContent).toContain('provideZonelessChangeDetection()'); }); - it('should not add provideExperimentalZonelessChangeDetection() when experimentalZoneless is false', async () => { + it('should not add provideZonelessChangeDetection() when zoneless is false', async () => { const tree = await schematicRunner.runSchematic( 'application', { ...defaultOptions, - experimentalZoneless: false, + zoneless: false, }, workspaceTree, ); const path = '/projects/foo/src/app/app.config.ts'; const fileContent = tree.readContent(path); - expect(fileContent).not.toContain('provideExperimentalZonelessChangeDetection()'); + expect(fileContent).not.toContain('provideZonelessChangeDetection()'); }); - it('should not add provideZoneChangeDetection when experimentalZoneless is true', async () => { + it('should not add provideZoneChangeDetection when zoneless is true', async () => { const tree = await schematicRunner.runSchematic( 'application', { ...defaultOptions, - experimentalZoneless: true, + zoneless: true, }, workspaceTree, ); diff --git a/packages/schematics/angular/application/schema.json b/packages/schematics/angular/application/schema.json index 7a6ea47a2020..85952ef00e3c 100644 --- a/packages/schematics/angular/application/schema.json +++ b/packages/schematics/angular/application/schema.json @@ -118,8 +118,9 @@ "default": false, "x-user-analytics": "ep.ng_ssr" }, - "experimentalZoneless": { + "zoneless": { "description": "Generate an application that does not use `zone.js`.", + "x-prompt": "Do you want to create a 'zoneless' application without zone.js (Developer Preview)?", "type": "boolean", "default": false } diff --git a/packages/schematics/angular/ng-new/index.ts b/packages/schematics/angular/ng-new/index.ts index f5e37ccccf40..e9362726d4d1 100644 --- a/packages/schematics/angular/ng-new/index.ts +++ b/packages/schematics/angular/ng-new/index.ts @@ -57,7 +57,7 @@ export default function (options: NgNewOptions): Rule { minimal: options.minimal, standalone: options.standalone, ssr: options.ssr, - experimentalZoneless: options.experimentalZoneless, + zoneless: options.zoneless, }; return chain([ diff --git a/packages/schematics/angular/ng-new/schema.json b/packages/schematics/angular/ng-new/schema.json index be65f561bc88..d6381afce198 100644 --- a/packages/schematics/angular/ng-new/schema.json +++ b/packages/schematics/angular/ng-new/schema.json @@ -139,8 +139,9 @@ "type": "boolean", "x-user-analytics": "ep.ng_ssr" }, - "experimentalZoneless": { + "zoneless": { "description": "Create an initial application that does not utilize `zone.js`.", + "x-prompt": "Do you want to create a 'zoneless' application without zone.js (Developer Preview)?", "type": "boolean", "default": false } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 948c45e0e811..f4664135ae12 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6705,7 +6705,6 @@ packages: engines: {node: '>=0.6.0', teleport: '>=0.2.0'} deprecated: |- You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. - (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) qjobs@1.2.0: diff --git a/tests/legacy-cli/e2e/tests/build/wasm-esm.ts b/tests/legacy-cli/e2e/tests/build/wasm-esm.ts index 134584d40716..43d3708c2c36 100644 --- a/tests/legacy-cli/e2e/tests/build/wasm-esm.ts +++ b/tests/legacy-cli/e2e/tests/build/wasm-esm.ts @@ -65,12 +65,12 @@ export default async function () { await replaceInFile( 'src/app/app.config.ts', 'provideZoneChangeDetection', - 'provideExperimentalZonelessChangeDetection', + 'provideZonelessChangeDetection', ); await replaceInFile( 'src/app/app.config.ts', 'provideZoneChangeDetection({ eventCoalescing: true })', - 'provideExperimentalZonelessChangeDetection()', + 'provideZonelessChangeDetection()', ); await ng('build'); diff --git a/tests/legacy-cli/e2e/tests/generate/application/application-zoneless.ts b/tests/legacy-cli/e2e/tests/generate/application/application-zoneless.ts index 8f92eac3e7cf..b7ceaddf3cb1 100644 --- a/tests/legacy-cli/e2e/tests/generate/application/application-zoneless.ts +++ b/tests/legacy-cli/e2e/tests/generate/application/application-zoneless.ts @@ -2,19 +2,12 @@ import { ng } from '../../../utils/process'; import { useCIChrome } from '../../../utils/project'; export default async function () { - await ng('generate', 'app', 'standalone', '--experimental-zoneless', '--standalone'); + await ng('generate', 'app', 'standalone', '--zoneless', '--standalone'); await useCIChrome('standalone', 'projects/standalone'); await ng('test', 'standalone', '--watch=false'); await ng('build', 'standalone'); - await ng( - 'generate', - 'app', - 'ngmodules', - '--experimental-zoneless', - '--no-standalone', - '--skip-install', - ); + await ng('generate', 'app', 'ngmodules', '--zoneless', '--no-standalone', '--skip-install'); await useCIChrome('ngmodules', 'projects/ngmodules'); await ng('test', 'ngmodules', '--watch=false'); await ng('build', 'ngmodules');