- Issue created by @mglaman
- ๐ณ๐ฑNetherlands balintbrews Amsterdam, NL
So 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-ui
as 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()
. - Merge request !1293Issue #3536093: Provide cache buster query string on imports โ (Merged) created by penyaskito
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
(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 fromAssetQueryStringInterface
.
Wondering if we could use the component version though.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 for xb-ui as 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 in hook_library_info_alter().
I see 2 options here:
1) KISS, just remove version, and Drupal will handle it using the same
AssetQueryStringInterface
that uses for the rest of assets.
2)hook_library_info_alter
readingui/package.json
, which we should keep in sync on release numbers. - ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Needs feedback on direction.
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
+1 for keeping it simple in the first instance
- ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
FWIW 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 - ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
We 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 morning. - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
(trying to categorize this, not sure what is the best match, assuming Page builder)
Appreciate that! ๐
But it should be , since this is a problem only for the
js
ComponentSource
plugin ("code components"). - ๐บ๐ธUnited States effulgentsia
penyaskito โ credited effulgentsia โ .
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Ended up implementing a MockVersion for testing purposes. All feedback addressed.
Crediting effulgentsia for feedback on MR. - ๐ณ๐ฑNetherlands balintbrews Amsterdam, NL
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Reflecting the slightly expanded scope per @balintbrews and my request ๐
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Now we fallback to
AssetQueryString
also 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.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
LGTM โ 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 โ ๐ข
-
wim leers โ
committed 648cb639 on 0.x authored by
penyaskito โ
Issue #3536093 by penyaskito, wim leers, balintbrews, larowlan, mglaman...
-
wim leers โ
committed 648cb639 on 0.x authored by
penyaskito โ
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ