Skip to content

fix(dev): an aggregated stylesheet swaps its dependents alone - #94

Merged
gronke merged 1 commit into
mainfrom
live-reload-attribution
Sep 7, 2026
Merged

gronke merged 1 commit into
mainfrom
live-reload-attribution

Conversation

@gronke

@gronke gronke commented Sep 7, 2026

Copy link
Copy Markdown
Owner
  • changes_for: a non-partial .scss that has recorded dependents but was never recorded as an entry (DependencyIndex::is_entry) publishes its dependents alone; an entry keeps naming its own URL.
  • changes_for: an edit outside every mount, or of an unknown kind, that the index attributes to stylesheets publishes those without the trailing bare Change::reload() (a vendored partial on a load path hot-swaps instead of reloading).
  • live.js: a named stylesheet that no <link> on the page carries is a logged no-op — only url: null fans out; a swap still in flight for the same link is superseded by the newer change (WeakMap/WeakSet bookkeeping), so rapid edits never leave duplicate links.
  • Changelog entries, plus the missing note that Processors gained external, dts and library (breaking for struct literals).

A non-partial stylesheet that is only reached through another stylesheet's imports — recorded as a dependency, never compiled as an entry — published its own URL too, which no `<link>` carried.
The client turned that miss into a refresh of every stylesheet, and the targeted swap that followed in the same batch raced it into two `<link>` elements for one sheet.
Such a stylesheet now names its dependents alone, an edit outside every mount that the index attributes to stylesheets hot-swaps them instead of reloading the page, and the client ignores a named stylesheet the page does not carry and supersedes a swap still in flight.
@gronke
gronke force-pushed the live-reload-attribution branch from 156407b to 7e43301 Compare September 7, 2026 09:15
@gronke
gronke merged commit 33433da into main Sep 7, 2026
9 checks passed
@gronke
gronke deleted the live-reload-attribution branch September 7, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant