Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Component sources
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Jul 2025 at 14:40 UTC
Updated:
5 Aug 2025 at 16:09 UTC
Jump to comment: Most recent
Comments
Comment #2
lauriiiComment #3
penyaskitoComment #4
balintbrewsSo we have the items in the import map generated in
\Drupal\experience_builder\Plugin\ExperienceBuilder\ComponentSource\JsComponent::renderComponent.Then we have a lot of JS files included in libraries (i.e. in
experience_builder.libraries.yml) where the version gets appended from the library definition, but we never update those, and it's not even feasible forxb-uias that gets recompiled and updated constantly. How are those usually handled? I think I've seen it before that a hash was added to the filename by the JS bundler, and the filename was read inhook_library_info_alter().Comment #6
penyaskito(trying to categorize this, not sure what is the best match, assuming Page builder)
If I understood this, most of the issues come from js components?
Adding a cache buster query there from
AssetQueryStringInterface.Wondering if we could use the component version though.
I see 2 options here:
1) KISS, just remove version, and Drupal will handle it using the same
AssetQueryStringInterfacethat uses for the rest of assets.2)
hook_library_info_alterreadingui/package.json, which we should keep in sync on release numbers.Comment #7
penyaskitoNeeds feedback on direction.
Comment #8
larowlan+1 for keeping it simple in the first instance
Comment #9
larowlanFWIW we could also configure vite to include hash in filenames https://rollupjs.org/configuration-options/#output-entryfilenames
That's something we do on client projects
Comment #10
penyaskitoWe now use the package.json version (or a hashed variation of that).
Back to Lee for review in case he has the time, I will pass this by Bálint tomorrow (our) morning.
Comment #11
penyaskitoComment #12
wim leersAppreciate that! 😊
But it should be , since this is a problem only for the
jsComponentSourceplugin ("code components").Comment #13
wim leersComment #14
wim leersComment #16
penyaskitoEnded up implementing a MockVersion for testing purposes. All feedback addressed.
Crediting effulgentsia for feedback on MR.
Comment #17
balintbrewsThis looks really great!
I think long term we should consider what both @larowlan and I suggested (in #9 and #4), having Vite/Rollup output filenames with a hash in them. That would allow us to do releases with backend-only changes where we don't force re-downloading unchanged JavaScript assets.
Comment #18
balintbrewsOops, didn't mean to do that.
Comment #19
wim leers#17++ — but we'll still need what this MR does for the
xb-uiasset library's definition itself. Tagging for this 👍So very close!
Comment #20
wim leersReflecting the slightly expanded scope per @balintbrews and my request 😇
Comment #21
penyaskitoNow we fallback to
AssetQueryStringalso in xb-ui and astro libs.#17, #19: That might make harder to include the assets as we do right now, and specially would make tests more complicated? Not sure how worth would it be, and it would differ from what core does.
Comment #22
wim leersLGTM — and many thanks for the ℹ️ comments on the MR, @penyaskito!
Just added some clarifying comments based on the discussion on the issue + MR and fixed some language nits — 🚢
Comment #24
wim leers🥳
Still needs follow-up issue for #4 + #9 + #17, which are all about the same thing.
Comment #25
mayur-sose commentedException: Files with auto-generated JS names may not have it.
/ui/dist/assets/index.jsin the requests./ui/dist/assets/index.jsincludes a query string (e.g., ?something).npm version 4.1.3to fake a new version.The value for the query string is different than before.
astro-*.astro-*asset URL ends with?4.1.3.ui/dist/index.jsandastro-*assets.ui/dist/index.jsandastro-*assets have?4.1.3as their query strings in the network panel.Comment #26
wim leersThanks, @mayur-sose!
Comment #27
penyaskitoCreated #3537408: Use Rollup for adding a hash to output filenames