Skip to content

Commit

Permalink
feat(angular): update generators to support the new server rendering …
Browse files Browse the repository at this point in the history
…api (#28939)

Upstream changes:

-
angular/angular-cli@292a4b7
-
angular/angular-cli@4e2a5fe
-
angular/angular-cli@df4e1d3
-
angular/angular-cli@bfa8fec

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
leosvelperez committed Nov 15, 2024
1 parent a7ab739 commit 60730cd
Show file tree
Hide file tree
Showing 59 changed files with 778 additions and 250 deletions.
5 changes: 5 additions & 0 deletions docs/generated/packages/angular/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@
"type": "boolean",
"x-prompt": "Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)?",
"default": false
},
"serverRouting": {
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
"type": "boolean",
"default": false
}
},
"additionalProperties": false,
Expand Down
5 changes: 5 additions & 0 deletions docs/generated/packages/angular/generators/host.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@
"default": false,
"x-priority": "important"
},
"serverRouting": {
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
"type": "boolean",
"default": false
},
"typescriptConfiguration": {
"type": "boolean",
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
Expand Down
5 changes: 5 additions & 0 deletions docs/generated/packages/angular/generators/remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@
"type": "boolean",
"default": false
},
"serverRouting": {
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
"type": "boolean",
"default": false
},
"typescriptConfiguration": {
"type": "boolean",
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
Expand Down
5 changes: 5 additions & 0 deletions docs/generated/packages/angular/generators/setup-ssr.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
"description": "Set up Hydration for the SSR application.",
"default": true
},
"serverRouting": {
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
"type": "boolean",
"default": false
},
"skipFormat": {
"type": "boolean",
"description": "Skip formatting the workspace after the generator completes.",
Expand Down
5 changes: 5 additions & 0 deletions docs/generated/packages/workspace/generators/new.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
"type": "boolean",
"default": false
},
"serverRouting": {
"description": "Use the Angular Server Routing and App Engine APIs (Developer Preview).",
"type": "boolean",
"default": false
},
"prefix": {
"description": "The prefix to use for Angular component and directive selectors.",
"type": "string"
Expand Down
5 changes: 5 additions & 0 deletions docs/generated/packages/workspace/generators/preset.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
"type": "boolean",
"default": false
},
"serverRouting": {
"description": "Use the Angular Server Routing and App Engine APIs (Developer Preview).",
"type": "boolean",
"default": false
},
"prefix": {
"description": "The prefix to use for Angular component and directive selectors.",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ describe('app', () => {
await generateApp(appTree, 'app1', { ssr: true });

expect(appTree.exists('app1/src/main.server.ts')).toBe(true);
expect(appTree.exists('app1/server.ts')).toBe(true);
expect(appTree.exists('app1/src/server.ts')).toBe(true);
});
});

Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/generators/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export async function applicationGenerator(
project: options.name,
standalone: options.standalone,
skipPackageJson: options.skipPackageJson,
serverRouting: options.serverRouting,
});
}

Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/generators/application/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ export interface Schema {
minimal?: boolean;
bundler?: 'webpack' | 'esbuild';
ssr?: boolean;
serverRouting?: boolean;
nxCloudToken?: string;
}
5 changes: 5 additions & 0 deletions packages/angular/src/generators/application/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@
"type": "boolean",
"x-prompt": "Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)?",
"default": false
},
"serverRouting": {
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
"type": "boolean",
"default": false
}
},
"additionalProperties": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ exports[`Host App Generator --ssr should generate the correct files 9`] = `
"customWebpackConfig": {
"path": "test/webpack.server.config.js",
},
"main": "test/server.ts",
"main": "test/src/server.ts",
"outputPath": "dist/test/server",
"tsConfig": "test/tsconfig.server.json",
},
Expand Down Expand Up @@ -456,7 +456,7 @@ exports[`Host App Generator --ssr should generate the correct files for standalo
"customWebpackConfig": {
"path": "test/webpack.server.config.js",
},
"main": "test/server.ts",
"main": "test/src/server.ts",
"outputPath": "dist/test/server",
"tsConfig": "test/tsconfig.server.json",
},
Expand Down Expand Up @@ -681,7 +681,7 @@ exports[`Host App Generator --ssr should generate the correct files for standalo
"customWebpackConfig": {
"path": "test/webpack.server.config.ts",
},
"main": "test/server.ts",
"main": "test/src/server.ts",
"outputPath": "dist/test/server",
"tsConfig": "test/tsconfig.server.json",
},
Expand Down Expand Up @@ -891,7 +891,7 @@ exports[`Host App Generator --ssr should generate the correct files when --types
"customWebpackConfig": {
"path": "test/webpack.server.config.ts",
},
"main": "test/server.ts",
"main": "test/src/server.ts",
"outputPath": "dist/test/server",
"tsConfig": "test/tsconfig.server.json",
},
Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/generators/host/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ export interface Schema {
skipFormat?: boolean;
standalone?: boolean;
ssr?: boolean;
serverRouting?: boolean;
typescriptConfiguration?: boolean;
}
5 changes: 5 additions & 0 deletions packages/angular/src/generators/host/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@
"default": false,
"x-priority": "important"
},
"serverRouting": {
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
"type": "boolean",
"default": false
},
"typescriptConfiguration": {
"type": "boolean",
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ exports[`MF Remote App Generator --ssr should generate the correct files 11`] =
"customWebpackConfig": {
"path": "test/webpack.server.config.js",
},
"main": "test/server.ts",
"main": "test/src/server.ts",
"outputPath": "dist/test/server",
"tsConfig": "test/tsconfig.server.json",
},
Expand Down Expand Up @@ -438,7 +438,7 @@ exports[`MF Remote App Generator --ssr should generate the correct files when --
"customWebpackConfig": {
"path": "test/webpack.server.config.ts",
},
"main": "test/server.ts",
"main": "test/src/server.ts",
"outputPath": "dist/test/server",
"tsConfig": "test/tsconfig.server.json",
},
Expand Down
1 change: 1 addition & 0 deletions packages/angular/src/generators/remote/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ export interface Schema {
skipFormat?: boolean;
standalone?: boolean;
ssr?: boolean;
serverRouting?: boolean;
typescriptConfiguration?: boolean;
}
5 changes: 5 additions & 0 deletions packages/angular/src/generators/remote/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@
"type": "boolean",
"default": false
},
"serverRouting": {
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
"type": "boolean",
"default": false
},
"typescriptConfiguration": {
"type": "boolean",
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
Expand Down
Loading

0 comments on commit 60730cd

Please sign in to comment.