Skip to content

Commit aa1d46f

Browse files
Merge pull request #1127 from angular/main
Create a new pull request by comparing changes across two branches
2 parents 114d323 + 7b994e4 commit aa1d46f

File tree

20 files changed

+398
-302
lines changed

20 files changed

+398
-302
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
./scripts/saucelabs/wait-for-tunnel.sh
171171
yarn bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
172172
./scripts/saucelabs/stop-tunnel.sh
173-
- uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
173+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
174174
if: ${{ failure() }}
175175
with:
176176
name: sauce-connect-log

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Build release targets
8181
run: yarn ng-dev release build
8282
- name: Store PR release packages
83-
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
83+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
8484
with:
8585
name: packages
8686
path: dist/releases/*.tgz

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
# Upload the results as artifacts.
4040
- name: 'Upload artifact'
41-
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
41+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
4242
with:
4343
name: SARIF file
4444
path: results.sarif

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@
6969
"@angular/platform-server": "19.0.0-next.8",
7070
"@angular/router": "19.0.0-next.8",
7171
"@angular/service-worker": "19.0.0-next.8",
72-
"@babel/core": "7.25.7",
72+
"@babel/core": "7.25.8",
7373
"@babel/generator": "7.25.7",
7474
"@babel/helper-annotate-as-pure": "7.25.7",
7575
"@babel/helper-split-export-declaration": "7.24.7",
7676
"@babel/plugin-syntax-import-attributes": "7.25.7",
77-
"@babel/plugin-transform-async-generator-functions": "7.25.7",
77+
"@babel/plugin-transform-async-generator-functions": "7.25.8",
7878
"@babel/plugin-transform-async-to-generator": "7.25.7",
7979
"@babel/plugin-transform-runtime": "7.25.7",
80-
"@babel/preset-env": "7.25.7",
80+
"@babel/preset-env": "7.25.8",
8181
"@babel/runtime": "7.25.7",
8282
"@bazel/bazelisk": "1.22.0",
8383
"@bazel/buildifier": "7.3.1",
@@ -129,7 +129,7 @@
129129
"buffer": "6.0.3",
130130
"chokidar": "4.0.1",
131131
"copy-webpack-plugin": "12.0.2",
132-
"critters": "0.0.24",
132+
"critters": "0.0.25",
133133
"css-loader": "7.1.2",
134134
"debug": "^4.1.1",
135135
"esbuild": "0.24.0",
@@ -186,7 +186,7 @@
186186
"rollup": "4.24.0",
187187
"rollup-plugin-sourcemaps": "^0.6.0",
188188
"rxjs": "7.8.1",
189-
"sass": "1.79.4",
189+
"sass": "1.79.5",
190190
"sass-loader": "16.0.2",
191191
"semver": "7.6.3",
192192
"shelljs": "^0.8.5",

packages/angular/build/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
"dependencies": {
2121
"@ampproject/remapping": "2.3.0",
2222
"@angular-devkit/architect": "0.0.0-EXPERIMENTAL-PLACEHOLDER",
23-
"@babel/core": "7.25.7",
23+
"@babel/core": "7.25.8",
2424
"@babel/helper-annotate-as-pure": "7.25.7",
2525
"@babel/helper-split-export-declaration": "7.24.7",
2626
"@babel/plugin-syntax-import-attributes": "7.25.7",
2727
"@inquirer/confirm": "5.0.0",
2828
"@vitejs/plugin-basic-ssl": "1.1.0",
2929
"browserslist": "^4.23.0",
30-
"critters": "0.0.24",
30+
"critters": "0.0.25",
3131
"esbuild": "0.24.0",
3232
"fast-glob": "3.3.2",
3333
"https-proxy-agent": "7.0.5",
@@ -39,7 +39,7 @@
3939
"picomatch": "4.0.2",
4040
"piscina": "4.7.0",
4141
"rollup": "4.24.0",
42-
"sass": "1.79.4",
42+
"sass": "1.79.5",
4343
"semver": "7.6.3",
4444
"vite": "5.4.8",
4545
"watchpack": "2.4.2"

packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export function createCompilerPlugin(
130130
// Track incremental component stylesheet builds
131131
const stylesheetBundler = new ComponentStylesheetBundler(
132132
styleOptions,
133+
styleOptions.inlineStyleLanguage,
133134
pluginOptions.incremental,
134135
);
135136
let sharedTSCompilationState: SharedTSCompilationState | undefined;
@@ -190,8 +191,8 @@ export function createCompilerPlugin(
190191
stylesheetResult = await stylesheetBundler.bundleInline(
191192
data,
192193
containingFile,
193-
// Inline stylesheets from a template style element are always CSS
194-
containingFile.endsWith('.html') ? 'css' : styleOptions.inlineStyleLanguage,
194+
// Inline stylesheets from a template style element are always CSS; Otherwise, use default.
195+
containingFile.endsWith('.html') ? 'css' : undefined,
195196
// When external runtime styles are enabled, an identifier for the style that does not change
196197
// based on the content is required to avoid emitted JS code changes. Any JS code changes will
197198
// invalid the output and force a full page reload for HMR cases. The containing file and order
@@ -490,7 +491,6 @@ export function createCompilerPlugin(
490491
build,
491492
stylesheetBundler,
492493
additionalResults,
493-
styleOptions.inlineStyleLanguage,
494494
pluginOptions.loadResultCache,
495495
);
496496
}

packages/angular/build/src/tools/esbuild/angular/component-stylesheets.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export class ComponentStylesheetBundler {
3333
*/
3434
constructor(
3535
private readonly options: BundleStylesheetOptions,
36+
private readonly defaultInlineLanguage: string,
3637
private readonly incremental: boolean,
3738
) {}
3839

@@ -63,7 +64,12 @@ export class ComponentStylesheetBundler {
6364
);
6465
}
6566

66-
async bundleInline(data: string, filename: string, language: string, externalId?: string) {
67+
async bundleInline(
68+
data: string,
69+
filename: string,
70+
language = this.defaultInlineLanguage,
71+
externalId?: string,
72+
) {
6773
// Use a hash of the inline stylesheet content to ensure a consistent identifier. External stylesheets will resolve
6874
// to the actual stylesheet file path.
6975
// TODO: Consider xxhash instead for hashing

packages/angular/build/src/tools/esbuild/angular/jit-plugin-callbacks.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export function setupJitPluginCallbacks(
6666
build: PluginBuild,
6767
stylesheetBundler: ComponentStylesheetBundler,
6868
additionalResultFiles: Map<string, { outputFiles?: OutputFile[]; metafile?: Metafile }>,
69-
inlineStyleLanguage: string,
7069
loadCache?: LoadResultCache,
7170
): void {
7271
const root = build.initialOptions.absWorkingDir ?? '';
@@ -114,11 +113,7 @@ export function setupJitPluginCallbacks(
114113
if (entry.contents === undefined) {
115114
stylesheetResult = await stylesheetBundler.bundleFile(entry.path);
116115
} else {
117-
stylesheetResult = await stylesheetBundler.bundleInline(
118-
entry.contents,
119-
entry.path,
120-
inlineStyleLanguage,
121-
);
116+
stylesheetResult = await stylesheetBundler.bundleInline(entry.contents, entry.path);
122117
}
123118

124119
const { contents, outputFiles, errors, warnings, metafile, referencedFiles } =

packages/angular/build/src/tools/vite/middlewares/ssr-middleware.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,18 @@ export async function createAngularSsrExternalMiddleware(
9292
next: Connect.NextFunction,
9393
) {
9494
(async () => {
95-
const { default: handler, AngularAppEngine } = (await server.ssrLoadModule(
96-
'./server.mjs',
97-
)) as {
98-
default?: unknown;
95+
const { reqHandler, AngularAppEngine } = (await server.ssrLoadModule('./server.mjs')) as {
96+
reqHandler?: unknown;
9997
AngularAppEngine: typeof SSRAngularAppEngine;
10098
};
101-
102-
if (!isSsrNodeRequestHandler(handler) && !isSsrRequestHandler(handler)) {
99+
if (!isSsrNodeRequestHandler(reqHandler) && !isSsrRequestHandler(reqHandler)) {
103100
if (!fallbackWarningShown) {
104101
// eslint-disable-next-line no-console
105102
console.warn(
106-
`The default export in 'server.ts' does not provide a Node.js request handler. ` +
103+
`The 'reqHandler' export in 'server.ts' is either undefined or does not provide a recognized request handler. ` +
107104
'Using the internal SSR middleware instead.',
108105
);
106+
109107
fallbackWarningShown = true;
110108
}
111109

@@ -130,10 +128,10 @@ export async function createAngularSsrExternalMiddleware(
130128
}
131129

132130
// Forward the request to the middleware in server.ts
133-
if (isSsrNodeRequestHandler(handler)) {
134-
await handler(req, res, next);
131+
if (isSsrNodeRequestHandler(reqHandler)) {
132+
await reqHandler(req, res, next);
135133
} else {
136-
const webRes = await handler(createWebRequestFromNodeRequest(req));
134+
const webRes = await reqHandler(createWebRequestFromNodeRequest(req));
137135
if (!webRes) {
138136
next();
139137

packages/angular/build/src/utils/server-rendering/launch-server.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ export const DEFAULT_URL = new URL('http://ng-localhost/');
2020
* @returns A promise that resolves to the URL of the running server.
2121
*/
2222
export async function launchServer(): Promise<URL> {
23-
const { default: handler } = await loadEsmModuleFromMemory('./server.mjs');
23+
const { reqHandler } = await loadEsmModuleFromMemory('./server.mjs');
2424
const { createWebRequestFromNodeRequest, writeResponseToNodeResponse } =
2525
await loadEsmModule<typeof import('@angular/ssr/node')>('@angular/ssr/node');
2626

27-
if (!isSsrNodeRequestHandler(handler) && !isSsrRequestHandler(handler)) {
27+
if (!isSsrNodeRequestHandler(reqHandler) && !isSsrRequestHandler(reqHandler)) {
2828
return DEFAULT_URL;
2929
}
3030

3131
const server = createServer((req, res) => {
3232
(async () => {
3333
// handle request
34-
if (isSsrNodeRequestHandler(handler)) {
35-
await handler(req, res, (e) => {
34+
if (isSsrNodeRequestHandler(reqHandler)) {
35+
await reqHandler(req, res, (e) => {
3636
throw e;
3737
});
3838
} else {
39-
const webRes = await handler(createWebRequestFromNodeRequest(req));
39+
const webRes = await reqHandler(createWebRequestFromNodeRequest(req));
4040
if (webRes) {
4141
await writeResponseToNodeResponse(webRes, res);
4242
} else {

0 commit comments

Comments
 (0)