GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — serve: with NG_HMR_CSTYLES=1, component stylesheets not touched by the last change revert to first-build content after a rebuild · Issue #34248 · angular/angular-cli Open Labels Milestone DescriptionCommandserve Is this a regression?Unknown. I have only tested 22.2.1. DescriptionWith Each check below is a fresh request for the page and its Without the flag, the same edit sequence (steps c1 to c5) produces no stale stylesheet. Hypothesis (unverified, from reading the code, not from debugging): in // TODO: Only attempt rebundling of invalidated styles once incremental build results are supported. if (rebuildState && options.externalRuntimeStyles) { componentStyleBundler.invalidate(rebuildState.fileChanges.all); const componentResults = await componentStyleBundler.bundleAllFiles(true, true); bundlingIndividualResults.push(...componentResults); } so only the invalidated sheets are re-bundled, and the sheets that are not invalidated seem to be served from their initial-build output rather than their last-built output. I have not confirmed which layer (bundler cache, result merging, or the dev server asset map) drops the later content. Side observation, no claim about impact: with the flag, the SSR HTML contains no inline Minimal Reproductionpnpm dlx @angular/[email protected] new repro --ssr --style=scss --defaults --skip-git --package-manager=pnpm cd repro mkdir src/app/a src/app/b
$color: red;
import { Component } from '@angular/core'; @Component({ selector: 'app-a', template: '<p class="a">a</p>', styleUrl: './style.scss', }) export class AComponent {}
@use '../p'; .a { color: p.$color; } .BASELINE-a { order: 0; }
<app-a /> <app-b />
Serve with the flag: NG_HMR_CSTYLES=1 pnpm exec ng serve --port 8094 --no-openHelper that fetches the page, takes every #!/bin/zsh label=$1 html=$(curl -s http://localhost:8094/) echo "--- $label" echo "$html" | grep -oE 'href="[^"]*ngcomp[^"]*"' | sed -E 's/href="//; s/"$//; s/&/\&/g' | while read -r h; do body=$(curl -s "http://localhost:8094/$h") who=$(echo "$body" | grep -oE '^\.(a|b) ' | head -1 | tr -d ' .') markers=$(echo "$body" | grep -oE '(BASELINE|MARK)-[A-Za-z0-9-]+' | tr '\n' ' ') echo "$h sheet=${who:-empty(app)} markers: $markers" done Edit sequence (wait about 4 seconds after each edit for the rebuild, then run ./check.sh baseline printf '.MARK-P1 { order: 1; }\n' >> src/app/_p.scss # c1: edit partial printf '.MARK-P2 { order: 2; }\n' >> src/app/_p.scss # c2: edit partial again printf '.MARK-A1 { order: 1; }\n' >> src/app/a/style.scss # c3: edit sheet A only printf '.MARK-P3 { order: 3; }\n' >> src/app/_p.scss # c4: edit partial again printf '.MARK-B1 { order: 1; }\n' >> src/app/b/style.scss # c5: edit sheet B only printf '.MARK-A2 { order: 2; }\n' >> src/app/a/style.scss # c6: edit sheet A only Observed with
(Marker names abbreviated: Control: steps c1 to c5 without Expected: after each rebuild every served component stylesheet reflects the current content of its sources (the latest successful build), not only the stylesheets touched by the latest change. Actual: untouched sheets revert to their first-build content until they are touched again. Exception or ErrorNo error is reported by the dev server. Its log only says Your EnvironmentAnything else relevant?Stylesheets were checked with Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions | ||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |