Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit18e13e2

Browse files
committed
feat(@schematics/angular): remove--server-routing option
Server-side rendering (SSR) will always enable server routing when using the application builder.BREAKING CHANGE: `--server-routing` option has been removed from several schematics. Server routing will be used when using the application builder.
1 parentcdfc50c commit18e13e2

File tree

44 files changed

+95
-469
lines changed

Some content is hidden

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

44 files changed

+95
-469
lines changed

‎packages/angular/ssr/schematics/ng-add/index_spec.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { join } from 'node:path';
1414
describe('@angular/ssr ng-add schematic',()=>{
1515
constdefaultOptions={
1616
project:'test-app',
17-
serverRouting:false,
1817
};
1918

2019
constschematicRunner=newSchematicTestRunner(

‎packages/angular/ssr/schematics/ng-add/schema.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
"description":"Skip the automatic installation of packages. You will need to manually install the dependencies later.",
1717
"type":"boolean",
1818
"default":false
19-
},
20-
"serverRouting": {
21-
"description":"Configure the server application to use the Angular Server Routing API and App Engine APIs (currently in Developer Preview).",
22-
"type":"boolean"
2319
}
2420
},
2521
"required": ["project"],

‎packages/schematics/angular/app-shell/index.ts‎

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import {
2727
}from'../utility/ast-utils';
2828
import{applyToUpdateRecorder}from'../utility/change';
2929
import{getAppModulePath,isStandaloneApp}from'../utility/ng-ast-utils';
30+
import{isUsingApplicationBuilder,targetBuildNotFoundError}from'../utility/project-targets';
3031
import{findBootstrapApplicationCall,getMainFilePath}from'../utility/standalone/util';
31-
import{getWorkspace,updateWorkspace}from'../utility/workspace';
32-
import{Builders}from'../utility/workspace-models';
32+
import{getWorkspace}from'../utility/workspace';
3333
import{SchemaasAppShellOptions}from'./schema';
3434

3535
constAPP_SHELL_ROUTE='shell';
@@ -156,29 +156,6 @@ function getMetadataProperty(metadata: ts.Node, propertyName: string): ts.Proper
156156
returnproperty;
157157
}
158158

159-
functionaddAppShellConfigToWorkspace(options:AppShellOptions):Rule{
160-
returnupdateWorkspace((workspace)=>{
161-
constproject=workspace.projects.get(options.project);
162-
if(!project){
163-
return;
164-
}
165-
constbuildTarget=project.targets.get('build');
166-
if(
167-
buildTarget?.builder===Builders.Application||
168-
buildTarget?.builder===Builders.BuildApplication
169-
){
170-
// Application builder configuration.
171-
constprodConfig=buildTarget.configurations?.production;
172-
if(!prodConfig){
173-
thrownewSchematicsException(
174-
`A "production" configuration is not defined for the "build" builder.`,
175-
);
176-
}
177-
prodConfig.appShell=true;
178-
}
179-
});
180-
}
181-
182159
functionaddServerRoutes(options:AppShellOptions):Rule{
183160
returnasync(host:Tree)=>{
184161
// The workspace gets updated so this needs to be reloaded
@@ -359,17 +336,21 @@ export default function (options: AppShellOptions): Rule {
359336
constbrowserEntryPoint=awaitgetMainFilePath(tree,options.project);
360337
constisStandalone=isStandaloneApp(tree,browserEntryPoint);
361338

339+
constworkspace=awaitgetWorkspace(tree);
340+
constproject=workspace.projects.get(options.project);
341+
if(!project){
342+
throwtargetBuildNotFoundError();
343+
}
344+
362345
returnchain([
363346
validateProject(browserEntryPoint),
364347
schematic('server',options),
365-
...(options.serverRouting
348+
...(isUsingApplicationBuilder(project)
366349
?[noop()]
367350
:isStandalone
368351
?[addStandaloneServerRoute(options)]
369352
:[addServerRoutes(options)]),
370-
options.serverRouting
371-
?addServerRoutingConfig(options,isStandalone)
372-
:addAppShellConfigToWorkspace(options),
353+
addServerRoutingConfig(options,isStandalone),
373354
schematic('component',{
374355
name:'app-shell',
375356
module:'app.module.server.ts',

‎packages/schematics/angular/app-shell/index_spec.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ describe('App Shell Schematic', () => {
1919
);
2020
constdefaultOptions:AppShellOptions={
2121
project:'bar',
22-
serverRouting:true,
2322
};
2423

2524
constworkspaceOptions:WorkspaceOptions={

‎packages/schematics/angular/app-shell/schema.json‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
"$default": {
1313
"$source":"projectName"
1414
}
15-
},
16-
"serverRouting": {
17-
"description":"Set up a server application using the Server Routing and App Engine APIs (Developer Preview).",
18-
"type":"boolean",
19-
"default":false
2015
}
2116
},
2217
"required": ["project"]

‎packages/schematics/angular/application/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export default function (options: ApplicationOptions): Rule {
101101
options.ssr
102102
?schematic('ssr',{
103103
project:options.name,
104-
serverRouting:options.serverRouting,
105104
skipInstall:true,
106105
})
107106
:noop(),

‎packages/schematics/angular/application/index_spec.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ describe('Application Schematic', () => {
3232
constdefaultOptions:ApplicationOptions={
3333
name:'foo',
3434
skipPackageJson:false,
35-
serverRouting:false,
3635
};
3736

3837
letworkspaceTree:UnitTestTree;

‎packages/schematics/angular/application/schema.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@
118118
"default":false,
119119
"x-user-analytics":"ep.ng_ssr"
120120
},
121-
"serverRouting": {
122-
"description":"Set up a server application using the Server Routing and App Engine APIs (Developer Preview).",
123-
"type":"boolean"
124-
},
125121
"experimentalZoneless": {
126122
"description":"Generate an application that does not use `zone.js`.",
127123
"type":"boolean",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export default function (options: NgNewOptions): Rule {
5757
minimal:options.minimal,
5858
standalone:options.standalone,
5959
ssr:options.ssr,
60-
serverRouting:options.serverRouting,
6160
experimentalZoneless:options.experimentalZoneless,
6261
};
6362

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@
139139
"type":"boolean",
140140
"x-user-analytics":"ep.ng_ssr"
141141
},
142-
"serverRouting": {
143-
"description":"Create a server application in the initial project using the Server Routing and App Engine APIs (Developer Preview).",
144-
"type":"boolean"
145-
},
146142
"experimentalZoneless": {
147143
"description":"Create an initial application that does not utilize `zone.js`.",
148144
"type":"boolean",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp