Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Theme builder
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Mar 2025 at 11:01 UTC
Updated:
18 Jun 2025 at 22:16 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
lauriiiComment #3
balintbrewsI took a look, and what happens here is that if we use the contextual menu from the sidebar list, we will send the canonical entity data with the
PATCHrequest when we update theJavaScriptComponententity to rename it or make it internal/exposed, because that's what we have available in the React component that outputs that list. With a new code component which hasn't been published since it was created, it means that only the auto-saved version has the data — and we lose all of that. 🙈This isn't a cache invalidation problem, because the endpoint that lists the code components doesn't use auto-saved data. To solve the issue, we need to:
PATCHrequests to include only the wanted changes:ui/src/features/code-editor/dialogs/AddToComponentsDialog.tsxui/src/features/code-editor/dialogs/RemoveFromComponentsDialog.tsxui/src/features/code-editor/dialogs/RenameCodeComponentDialog.tsxThe alternative would be to retrieve fresh auto-saved data if it exists before performing those actions, but I believe our efforts are better spent with making sure our API endpoint can properly handle
PATCHrequests, so we don't need any extra logic and complexity to handle this in the client.Comment #4
wim leers#3508140: PATCH request for config entities reset values that are not sent is in!
Comment #5
nagwani commentedComment #6
hooroomooComment #8
hooroomooSeeing some strange behavior after adding a code component to the library, the JS doesn't load...
Comment #9
effulgentsia commentedThis issue surfaced #3519634: Modifying a XB config entity's `status` or `label` should update the auto-save entry too, rather than delete it which I think the rest of the stuff that's here is blocked on until that's resolved.
Comment #10
wim leers#3508140: PATCH request for config entities reset values that are not sent landed 20 days ago. 😅
Comment #11
wim leersAh, but #3519634: Modifying a XB config entity's `status` or `label` should update the auto-save entry too, rather than delete it is net new!
Comment #12
wim leers@hooroomoo I've got a working MR up at #3519634: Modifying a XB config entity's `status` or `label` should update the auto-save entry too, rather than delete it, can you give that a try? 🙏
Comment #13
hooroomoo#12. Thanks, I applied your MR 937 from #3519634: Modifying a XB config entity's `status` or `label` should update the auto-save entry too, rather than delete it and it fixes the issue reported in the issue summary and it shows the current auto-saved JS and CSS when I open the code editor for the component.
But when I add the component to the layout page preview, the CSS isn't there. The CSS file for the component inside of /sites/default/astro-island never gets created.
Comment #14
wim leers#13: What are the steps to reproduce that? Is that reproducible:
?
IOW: is it safe to merge #3519634, or does that somehow introduce the problem you're describing? If so, we're lacking some tests, because #3519634: Modifying a XB config entity's `status` or `label` should update the auto-save entry too, rather than delete it is passing tests. 😅
Comment #15
hooroomooSteps to reproduce:
1. Checkout this MR https://git.drupalcode.org/project/experience_builder/-/merge_requests/906. This MR contains frontend changes to only include desired changes in the PATCH requests AND #3519634's MR from yesterday.
2. Create a new code component
3. Make any change to the JS or CSS.
4. Click "Add to components" using the top right button in the code editor (NOT from the contextual menu)
5. After Adding it to components, the compiled JS and CSS file doesn't get generated in
/sites/default/files/astro-island. When you click Add to components, the expected behavior is those files gets generated in that directory.Comment #16
wim leersIn step 3, that's the code component's CSS and JS, not the global CSS, right? Because #3508937: Global AssetLibrary should render with its auto-saved state (if any) when rendered in the XB UI is a known bug.
Comment #17
hooroomooCorrect, step 3 - Make any change to the code component's JS or CSS.
Comment #18
wim leers#3519634: Modifying a XB config entity's `status` or `label` should update the auto-save entry too, rather than delete it is in — with @hooroomoo's approval 🥳
Comment #19
hooroomoo#3519634: Modifying a XB config entity's `status` or `label` should update the auto-save entry too, rather than delete it fixes this issue :) Closing as outdated
Comment #20
hooroomooComment #23
hooroomooComment #25
effulgentsia commented