Skip to content

fix(loader): propagate plugin asset version digest to scoped stylesheet (closes #23 #24)#26

Merged
fdaugan merged 1 commit into
feature/vuejsfrom
norman/fix-css-cache-desync
Jun 11, 2026
Merged

fix(loader): propagate plugin asset version digest to scoped stylesheet (closes #23 #24)#26
fdaugan merged 1 commit into
feature/vuejsfrom
norman/fix-css-cache-desync

Conversation

@Terracosmos

Copy link
Copy Markdown
Collaborator

Problem

The host loader (app-ui/.../plugins/loader.js) imports the plugin JS bundle via /main/<id>/vue/index.js?v=<digest>, where the MD5 digest rotates on every plugin upgrade (long-cached for 1 year, immutable). However, the CSS injection inside ui/src/index.js did:

link.href = new URL('./index.css', import.meta.url).href

Relative URL resolution drops the base query string, so the <link> pointed at index.css without the ?v= cache buster. As a consequence, after any plugin upgrade the freshly-loaded JS bundle (new data-v-* scope id) was paired with a stale, long-cached index.css (previous data-v-* ids). Every scoped style of the SFCs in this plugin silently stopped matching, producing apparently random layout regressions with zero JS errors.

Fix

Carry over the ?v=<digest> query from import.meta.url to the CSS URL so the stylesheet is busted in lockstep with the JS bundle. Bonus: the CSS now benefits from the same 1-year immutable cache as the JS in production.

Closes

Both were manifestations of the same root cause: scoped CSS classes silently dropped after each plugin upgrade.

Verified

  • Runtime test before/after the fix: stat-bar layout restored on Plugins / Nodes / Configuration / Cache views; success-rate column in Cache view now displays correct percentages (94%, 71%, 79%) instead of absurd values (5980%, 3091%, etc.).

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@fdaugan fdaugan merged commit 533fc62 into feature/vuejs Jun 11, 2026
3 of 4 checks passed
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.

2 participants