Overview
Let's start cleaning up the experience and remove the default content. This served us well while developing this, but since we have capabilities now to actually build a lot of the stuff by yourself, it doesn't seem necessary anymore.
Proposed resolution
- Remove the default value for the XB field (
config/optional/field.field.node.article.field_xb_demo.yml) - Remove the Hero field (
config/optional/field.storage.node.field_hero.yml+config/optional/field.field.node.article.field_hero.yml)
User interface changes
Empty canvas when you start using XB!

| Comment | File | Size | Author |
|---|---|---|---|
| #30 | XB-empty-canvas-to-start.gif | 809.66 KB | wim leers |
Issue fork experience_builder-3472299
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
lauriiiComment #3
wim leersThis must happen after #3469436: Fix the visually broken "image" component instance: use FileUriItem's computed `url` property, not the stored `value` property at least, and possibly more issues, to minimize disruption for in-progress MRs.
Comment #4
wim leers#3469436: Fix the visually broken "image" component instance: use FileUriItem's computed `url` property, not the stored `value` property is in, let's do this now!
Comment #5
annmarysruthy commentedComment #8
annmarysruthy commentedComment #9
deepakkm commentedComment #10
wim leersTalked to @lauriii, narrowing the scope, to the part that is actually important for #3454094: Milestone 0.1.0: Experience Builder Demo 👍
Comment #11
wim leersNote: this blocks #3471026: Harden UUID validation in ComponentTreeStructureConstraintValidator. (That's not urgent though.)
Comment #12
wim leersFYI: this also blocks #3472103: Add Tugboat integration.
Comment #13
tedbow@deepakkm thanks the work on this. Since it past your end of day and this is important for #3454094: Milestone 0.1.0: Experience Builder Demo I am going to try move this forward
Comment #16
tedbowI have an idea I am working to leave the test coverage mostly the same so I am going to leave this assigned to me
Comment #17
wim leersIf I do a fresh install of XB using this MR (and rebuilt the UI — I tested commit
4ce1b00bc8d2a41309ffcea12ae62b4a27a2845eof this MR), then I do start with an empty canvas. 🥳Unfortunately, I cannot place any component onto the canvas without fatal errors, except the sole propless component ()
🚨 Surprisingly, @jessebaker and @shyam_bhatt did not run into the below that when they created #3473761: Render a placeholder DIV inside empty Regions/Slots in the preview, where they manually emptied the canvas. So their starting point was different. I bet there's an (initialization) edge case there 🤓
But there’s something odd going on with
addNewComponentToLayout()in the UI: when dragging the component onto the empty canvas, the UI correctly initializesinitialData(I just stepped through it), and hencehas the correct
model, yet somehow that information is lost by the time the request is sent to/api/preview/node/1:Comment #18
wim leersTo make
TranslationTestpass, we need it to not rely onfield_heroanymore. So, changes to the default{"uuid":"dynamic-image-udf7d","component":"experience_builder:image"},{"uuid": "dynamic-image-static-imageStyle-something7d","component": "experience_builder:image"}with:
{"uuid":"static-heading-some-uuid","component":"experience_builder:heading"}+ as prop value:
cta1hrefprop value for{"sourceType":"dynamic","expression":"ℹ︎␜entity:node:article␝field_hero␞␟entity␜␜entity:file␝uri␞␟value"}}with
{"sourceType":"static:field_item:link","value":{"uri":"https:\/\/drupal.org","title":null,"options":[]},"expression":"ℹ︎link␟uri"}}Comment #19
wim leersFor the Cypress E2E tests, I recommend:
0.xNode::create()call inXBTestSetupComment #20
jessebaker commentedRE #17
It seems that the initial request for the page data when loading the page made to
/api/layout/node/1is returningThe important part of that is that
"model": []here is coming back as a JS Array. When the model has content, the request returns model as a JS Object ("model": {}).If required, we can probably re-shape the data to make it work on the front end in this case, but I think the better solution would be to solve it on the back end.
Comment #21
tedbowCreated follow-up #3474257: Create an E2E test that starts with an empty canvas
Comment #22
tedbowComment #23
tedbowwhoops
Comment #24
danielvezaLeft a couple of tiny comments on the MR.
The IS mentions updating CONTRIBUTING.md, I've checked it in the merge branch and I don't think anything needs to be updated :)
Comment #25
wim leersMerged in upstream changes that #3474226: Make Media Library a dependency landed … curious to see if this still passes 🤓
Comment #26
wim leers#24++ :)
Comment #27
tedbowFrom
contributing.md5. Browse to `/node/add/article` — you'll see a `🪄 XB Demo ✨` field. Don't touch that — just enter a title for the article and hit save: a component is rendered using the article title 🤓I think we do need to update this.
The component is not render with title by default now, and you don't actually see the field in /node/add/article(maybe that was pre-existing).
I switched by to https://git.drupalcode.org/project/experience_builder/-/merge_requests/2... and it worked again.
Maybe something changed in 0.x and the merged change caused this?
Comment #28
wim leers#27.2: thanks, that's what I was gonna do next before merging, and why I didn't merge rapidly before the personal stuff I left for at #26 😅
That's exactly the problem I was running into I ran into in #17.
Comment #29
tedbowComment #30
wim leersManually tested, works well!
Comment #31
wim leers