-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@schematics/angular): add option to setup new workspace or appli…
…cation as zoneless mode
- Loading branch information
Showing
12 changed files
with
118 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
packages/schematics/angular/application/files/module-files/src/main.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
<% if(!!viewEncapsulation) { %>import { ViewEncapsulation } from '@angular/core'; | ||
<% }%>import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|
||
import { AppModule } from './app/app.module'; | ||
|
||
platformBrowserDynamic().bootstrapModule(AppModule, { | ||
ngZoneEventCoalescing: true<% if(!!viewEncapsulation) { %>, | ||
<% if(!experimentalZoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %> | ||
defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %> | ||
}) | ||
.catch(err => console.error(err)); |
2 changes: 2 additions & 0 deletions
2
...ematics/angular/application/files/standalone-files/src/app/app.component.spec.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...ages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';<% if (routing) { %> | ||
import { ApplicationConfig, <% if(!experimentalZoneless) { %>provideZoneChangeDetection<% } else { %>provideExperimentalZonelessChangeDetection<% } %> } from '@angular/core';<% if (routing) { %> | ||
import { provideRouter } from '@angular/router'; | ||
|
||
import { routes } from './app.routes';<% } %> | ||
|
||
export const appConfig: ApplicationConfig = { | ||
providers: [provideZoneChangeDetection({ eventCoalescing: true })<% if (routing) { %>, provideRouter(routes)<% } %>] | ||
providers: [ | ||
<% if(experimentalZoneless) { %>provideExperimentalZonelessChangeDetection()<% } else { %>provideZoneChangeDetection({ eventCoalescing: true })<% } %><% if (routing) {%>, provideRouter(routes)<% } %> | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tests/legacy-cli/e2e/tests/generate/application/application-zoneless.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ng } from '../../../utils/process'; | ||
import { useCIChrome } from '../../../utils/project'; | ||
|
||
export default async function () { | ||
await ng('generate', 'app', 'standalone', '--experimental-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 useCIChrome('ngmodules', 'projects/ngmodules'); | ||
await ng('test', 'ngmodules', '--watch=false'); | ||
await ng('build', 'ngmodules'); | ||
} |