diff --git a/CHANGELOG.md b/CHANGELOG.md index 5535c4927997..8352c2a65472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,33 @@ + + +# 17.3.7 (2024-05-08) + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------- | +| [998c72036](https://github.com/angular/angular-cli/commit/998c720363087f3f0b1748d3f875e5b536a3119d) | fix | decode URL pathname decoding during SSG fetch | + +### @angular-devkit/schematics + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | --------------------------------------------- | +| [1ab1c6c9e](https://github.com/angular/angular-cli/commit/1ab1c6c9e10ce938402355afed4602b76ac08a0e) | fix | use web standard error check for Deno support | + + + + + +# 17.3.6 (2024-04-25) + +### @angular-devkit/build-angular + +| Commit | Type | Description | +| --------------------------------------------------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| [dcec59799](https://github.com/angular/angular-cli/commit/dcec59799faac66bf25043984c11944479efcf4d) | fix | properly configure headers for media resources and HTML page | + + + # 17.3.5 (2024-04-17) diff --git a/package.json b/package.json index 08c61c3c4b5b..a99021861d4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@angular/devkit-repo", - "version": "17.3.5", + "version": "17.3.7", "private": true, "description": "Software Development Kit for Angular", "bin": { diff --git a/packages/angular_devkit/build_angular/src/utils/server-rendering/fetch-patch.ts b/packages/angular_devkit/build_angular/src/utils/server-rendering/fetch-patch.ts index b0eb6c0e9666..aa03111fc740 100644 --- a/packages/angular_devkit/build_angular/src/utils/server-rendering/fetch-patch.ts +++ b/packages/angular_devkit/build_angular/src/utils/server-rendering/fetch-patch.ts @@ -39,7 +39,8 @@ export function patchFetchToLoadInMemoryAssets(): void { return originalFetch(input, init); } - const { pathname, protocol } = url; + const { protocol } = url; + const pathname = decodeURIComponent(url.pathname); if (protocol !== RESOLVE_PROTOCOL || !assetFiles[pathname]) { // Only handle relative requests or files that are in assets. diff --git a/packages/angular_devkit/schematics/src/rules/template.ts b/packages/angular_devkit/schematics/src/rules/template.ts index 31327035e094..c2105477dcfa 100644 --- a/packages/angular_devkit/schematics/src/rules/template.ts +++ b/packages/angular_devkit/schematics/src/rules/template.ts @@ -62,7 +62,7 @@ export function applyContentTemplate(options: T): FileOperator { content: Buffer.from(templateImpl(decodedContent, {})(options)), }; } catch (e) { - if ((e as NodeJS.ErrnoException).code === 'ERR_ENCODING_INVALID_ENCODED_DATA') { + if (e instanceof TypeError) { return entry; } diff --git a/packages/schematics/angular/workspace/files/__dot__gitignore.template b/packages/schematics/angular/workspace/files/__dot__gitignore.template index 0711527ef9d5..cc7b141350ff 100644 --- a/packages/schematics/angular/workspace/files/__dot__gitignore.template +++ b/packages/schematics/angular/workspace/files/__dot__gitignore.template @@ -1,4 +1,4 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. +# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. # Compiled output /dist diff --git a/tests/legacy-cli/e2e/tests/build/prerender/http-requests-assets.ts b/tests/legacy-cli/e2e/tests/build/prerender/http-requests-assets.ts index 52f7ac439bb1..9d47c5b26194 100644 --- a/tests/legacy-cli/e2e/tests/build/prerender/http-requests-assets.ts +++ b/tests/legacy-cli/e2e/tests/build/prerender/http-requests-assets.ts @@ -38,8 +38,11 @@ export default async function () { ], }; `, + // Add asset 'src/assets/media.json': JSON.stringify({ dataFromAssets: true }), + 'src/assets/media with-space.json': JSON.stringify({ dataFromAssetsWithSpace: true }), + // Update component to do an HTTP call to asset. 'src/app/app.component.ts': ` import { Component, inject } from '@angular/core'; @@ -53,16 +56,23 @@ export default async function () { imports: [CommonModule, RouterOutlet], template: \`

{{ data | json }}

+

{{ dataWithSpace | json }}

\`, }) export class AppComponent { data: any; + dataWithSpace: any; + constructor() { const http = inject(HttpClient); http.get('/assets/media.json').subscribe((d) => { this.data = d; }); + + http.get('/assets/media%20with-space.json').subscribe((d) => { + this.dataWithSpace = d; + }); } } `, @@ -74,4 +84,8 @@ export default async function () { 'dist/test-project/browser/index.html', /

{[\S\s]*"dataFromAssets":[\s\S]*true[\S\s]*}<\/p>/, ); + await expectFileToMatch( + 'dist/test-project/browser/index.html', + /

{[\S\s]*"dataFromAssetsWithSpace":[\s\S]*true[\S\s]*}<\/p>/, + ); }