Last week ended with 12 remaining issues. Did we make it? đ
Major loose ends
Like last week, Iâm starting with the major loose ends.Thanks to the impressive work by Dang âsea2709â Tran and the reviews and guidance from Jesse âjessebakerâ Baker as well as many others, Experience Builder (XB) now has a robust solution for previewing components when hovering them in the âinsertâ menu. It required both server-side changes (global theme asset libraries were missing previously) and client-side changes (shadow DOM didnât offer sufficient isolation; we needed <iframe>
).
The result is so nice that I almost spat out my coffee because of a deep, unavoidable âOOOOOHHHHHHHHHHHHHHHHHHHHHHHH!!!!!â when reviewing it! đ
Once a component is placed, the preview canvasâ <iframe>
must be updated: an updated HTML response is fetched and rendered. But every update to the component tree must result in an update to the preview. That means any typing the Content Creator does in the component props form results in the entire preview1 getting re-rendered, which easily results in flickering. Jesse devised a very clever solution, inspired by ⊠computer games!
He introduced an IframeSwapper
that keeps two <iframe>
s active, but with only one visible. Once the preview has updated (i.e. the invisible <iframe>
has finished loading), he swaps it with the visible <iframe>
2 â eliminating all flicker:
Updating the props of a Single-Directory Component (SDC) can be done by clicking the placed component in the preview, and the âcomponent props formâ will appear on the right side. This generally works well, but there are still lots of rough edges. The roughest of edges has now been fixed by Atul, Dave âlongwaveâ Long, Travis âtraviscardenâ Carden and BĂĄlint âbalintbrewsâ KlĂ©ri (with Ben âbnjmnmâ Mullins shepherding that issue after its many twists and turns to clarity): the server side now correctly handles SDC props that are required, the client side now uses browsersâ native reportValidity
functionality. The result is that premature preview updates no longer occur.3
While placing components and inspecting the component tree youâre creating, it can be handy to quickly get an overview. Browsers have â+
/â-
(Ctrl+
/Ctrl-
) keyboard shortcuts to zoom in/out. But for XB, you typically want to zoom in/out only the preview, not the entire UI. So thanks to Jesse and Atul âsoaratulâ Dubey, XB now allows zooming in/out just the preview by pressing +
or -
.4
Another rough edge in that component props form was fixed: some field widgets are highly complex, and need to load CSS/JS to work correctly. An example is the most complex widget in Drupal core: the media library widget, which we the recently added support for. Our naĂŻve initial approach failed whenever switching between different components that each used the media library widget: the same JS was loaded again, resulting in JS errors! Fortunately, Drupal already solved this problem: Ben added ajaxPageState
support â solved!
With all of those UI improvements in, parts of XB are starting to feel solid!
Better defaults
To make it easier for future (and existing) contributors to start contributing to/playing with XB, we changed two important defaults:
- Ben made XB depend on the Media Library module, because it offers a superior UX for (re)using images
- Deepak âdeepakkmâ Mishra, Ted âtedbowâ Bowman and I updated the default XB config to start with an empty XB canvas
Only one 0.1
priority left!
With only one 0.1
priority left (#3469672: The XB annotations and labels should not change size when zooming), it became possible to help land non-priority fixes, such as:
- Thanks to fazilitehreem and Utkarsh âutkarsh_33â, the âduplicateâ action on component instances now works as expected, rather than resulting in an error
- Jesse and Gaurav âgauravvvvâ made the canvas size dynamic based on browser viewport size, improving what we landed 4 weeks earlier
- Abhisek âabhisekmazumdarâ Mazumdar, Dave and I updated the XB field type to no longer store SDC plugin IDs, but
Component
config entity IDs (a small but necessary first step towards supporting multiple component types â starting with Blocks)
Accelerating whatâs to come after 0.1
With 0.1
essentially done, itâs important to prepare for whatâs next, and set us up for success and facilitate wider contribution:
- James âq0rbanâ Sansbury, abhisekmazumdar and Alex âeffulgentsiaâ Bronstein made MR reviews much easier and faster by adding Tugboat integration!
- Dave ensured that OpenAPI validation errors now result in a JSON response, which unblocks #3470321: Surface API error response in the UI â for better bug reports and faster DX â the issue title says it all!
- Together with Feliksas âf.mazeikisâ Mazeikis and Dave, I documented the current component discovery + SDC criteria +
Component
config entity, and described the status quo in an ADR. Because the status quo is now documented in depth, weâll be able to make it crystal clear in #3454519: [META] Support component types other than SDC and child issues how we aim to evolve XB to supporting multiple component types, reducing the time to get to consensus on how to achieve that.
Canât wait to see what product lead Lauri âlauriiiâ Timmanee prioritizes for milestone 0.2
! đ (Spoiler: supporting blocks and actually saving what you see in the XB UI will definitely be in there!)
Week 19 was September 16â22, 2024.
- 1
This will improve later, once we do #3462360: Partial preview updates: update preview of modified component only, not entire component tree, although later the previously mentioned abstract syntax tree (AST) would make that unnecessary (in most cases).
- 2
In lower-level contexts this is called double buffering â and for example Microsoft .NET forms documentation has a great explanation.
- 3
This is not yet completely solved â next in line is #3474732: Premature prop validation can break the UI. The value entered by the user must first meet the required shape that the SDCâs metadata conveys it needs (using JSON schema in its
*.component.yml
file). - 4
Interesting follow-up issues for this: #3475838: Consider a11y impact and/or competitor analysis for preventing browser zoom and #3475749: Pinch gesture zooming sometimes invokes OS zoom behavior.