Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Theme builder
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2025 at 19:46 UTC
Updated:
4 Jul 2025 at 08:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
libbna commentedGiving it a try on this.
Comment #3
libbna commentedHi @mglaman,
Could you please share the steps to reproduce this issue?
Below are the steps I followed—please let me know if they are correct or if I’m missing something. The CSS appears to be getting applied, but I’m not sure if I’m approaching it the right way. I’d appreciate your guidance on this.
Thanks!
Comment #4
libbna commentedI again tried but couldn't reproduce the issue. In the last comment I forgot to attach the screenshot so I have attached it now!
Comment #5
wim leersThe problem/challenge here is that it's possible that both the code component (
JavaScriptComponentconfig entity)'s and theAssetLibraryconfig entity (only a single one allowed for now, with the IDglobal) can have a draft (auto-saved) version.So dependencies don't quite end up working, because it depends on the context which should be loaded:
which is then used by
\Drupal\experience_builder\Entity\JavaScriptComponent::getCssLibrary():isPreviewwill be true when editing inside XB, not outside of it, and an auto-save entry can (dis)appear at any time. Similar thing for the global asset library:—
\Drupal\experience_builder\Hook\ComponentSourceHooks::pageAttachments()Comment #6
wim leersComment #8
libbna commentedComment #9
wim leersHowever … the work I did on #3508922: Regression after #3500386: import map scope mismatch when previewed code component's JS is a 307 due to it not having an auto-save/draft gave me an idea:
ApiConfigAutoSaveControllers::getCss()andApiConfigAutoSaveControllers::getJs()do the disambiguation: return auto-save data if it exists, return stored/live data if notCan you test this, @mglaman? Quick manual test suggests it works fine. 😊
Comment #10
larowlanJust a couple of minor nits about the use of the verbose
matchfor booleansComment #11
wim leersAll tests are passing, the tests are pretty detailed, manual testing reveals no regressions and … this really does simplify the "asset loading" logic of config-defined CSS/JS a lot. It makes all this much easier to reason about.
Only +1s from @larowlan, so going ahead and RTBC'ing even ahead of @mglaman's manual testing.
Comment #12
wim leersComment #14
wim leers