- Issue created by @effulgentsia
- ๐ณ๐ฑNetherlands balintbrews Amsterdam, NL
Adding some filtering capabilities to our
/xb/api/config/js_component
endpoint could be nice, so it can return config entities with empty vs. non-emptyoverride
properties, helping us display two distinct lists on the UI. With that said, we can easily separate the items on the frontend, so this can happen in a follow-up. - ๐บ๐ธUnited States effulgentsia
Here's an initial patch (yeah, I know, MRs are better, but old habits die hard) with
system_menu_block
implemented. I'll work on breadcrumb, site branding, and page title next. - ๐บ๐ธUnited States effulgentsia
This includes page_title and system_branding. Still need to do breadcrumb.
- ๐บ๐ธUnited States effulgentsia
Note, if you're testing the wip patch, make sure to:
- Install the xb_dev_js_blocks module (included in the patch), since that's what provides the default JS component entities.
- Within the theme settings, click "Use Experience Builder for page templates in this theme.", since the JS component entities only override rendering of blocks that are rendered via XB dynamic components, not blocks that are rendered via Block UI entities.
- ๐บ๐ธUnited States effulgentsia
This adds the breadcrumb block, so now this has all 4 desired for the initial scope.
- Merge request !665#3505993: Code Components as Block Overrides, step 1 โ (Merged) created by Unnamed author
- ๐ณ๐ฑNetherlands balintbrews Amsterdam, NL
Thanks for the patches, @effulgentsia! I created an MR and verified the functionality. It works beautifully! I added the components to our working repository for the initial code components.
I also added testing steps to the issue summary. In addition to #8 โจ Code Components as Block Overrides, step 1 Active , we need to re-run the build to get the necessary change to our bundled hydration library. I learned that the hard way. ๐ I saw your change there initially, but by the time I started testing, I forgot about it, then I thought we may have never tested our
astro_island
element with actual props, so I got into debugging. Once I found the relevant part in Astro, I realized what I forgot. ๐ In any case, this gave me more confidence in our implementation, so it was a good adventure. - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
wim leers โ made their first commit to this issueโs fork.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
It works!
I've got it working locally using the steps in #8. I manually modified the "admin" menu block
Component
config entity to expand all levels, and โฆ that does work:๐
Concerns/initial review
Picking up where @effulgentsia left off. He handed it over to me in the past hour, and he answered my 2 most crucial questions:
- https://git.drupalcode.org/project/experience_builder/-/merge_requests/6...
- https://git.drupalcode.org/project/experience_builder/-/merge_requests/6...
Next
Self-assigning to get this MR:
- to green
- to explicitly isolate/annotate the highly experimental bits that this introduces.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This blocks โจ [PP-1] Editing code components as overrides, step 1 Postponed .
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Finished adding the critical server-side test coverage:
- at the full page rendering level: https://git.drupalcode.org/project/experience_builder/-/merge_requests/6...
- at the component tree rendering level: https://git.drupalcode.org/project/experience_builder/-/merge_requests/6...
This test coverage revealed some flaws in the existing infrastructure:
- the
BlockComponent::renderComponent()
logic that dynamically switches to use the block-overridingJavaScriptComponent
lacks cacheability information: https://git.drupalcode.org/project/experience_builder/-/merge_requests/6... XbConfigOverrides
(introduced only days ago, in ๐ Code Components should render with their auto-saved state(if any) when rendered in the XB UI Active ), is bubbling cacheability incorrectly: https://git.drupalcode.org/project/experience_builder/-/merge_requests/6...- the existing access control for
JavaScriptComponent
's@todo
s are actively getting in the way: they prevent the integration test from working โ but that's for ๐ Add access control for "code components" and "asset libraries", special case: instantiated code components must be accessible to *all* Active to fix.
I'm not proficient at writing Cypress e2e tests, so leaving to somebody else, so I can switch gears to other pressing matters. I defer to @effulgentsia and @balintbrews to decide whether this is commit-blocking or not. ๐ก They decided that it's not necessary, because they both confirmed this is all highly experimental and likely to change ๐
Next up:
- on
10.4.x
this fails withYou have requested a non-existent service "plugin.manager.condition".
โ can somebody please investigate that? ๐ - docs
- @balintbrews or @effulgentsia to confirm https://git.drupalcode.org/project/experience_builder/-/merge_requests/6... is correct
- @effulgentsia to review the test coverage I added
- ๐บ๐ธUnited States effulgentsia
@balintbrews or @effulgentsia to confirm 135ac01 is correct
Yes, that change is correct. Though as a side note, I'm curious under what conditions it's reachable. Are default slots a thing in SDCs? I only see examples of named slots, or did I not search thoroughly enough?
- ๐บ๐ธUnited States effulgentsia
Thanks for adding those tests, Wim. They look great. Back to needs work for the rest of #19 (docs + the error on 10.4.x).
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
#20: IDK when that is reachable โ but our kernel tests surely were reaching it!
#21: yay!
The 2 last bullets of #19 are complete thanks to @effulgentsia, assigning to @longwave for
- on
10.4.x
this fails withYou have requested a non-existent service "plugin.manager.condition".
โ can somebody please investigate that? ๐ - docs
- on
- First commit to issue fork.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
This should also get an entry in
CODEOWNERS
, under the# โ ๏ธ # โ ๏ธ Highly experimental new concepts โ ๏ธ # โ ๏ธ
section.
- ๐ฌ๐งUnited Kingdom longwave UK
I think this is OK to land as highly experimental and have added even more comments to denote this. I am not sure that mapping each block plugin that might want to become a JS component is sustainable; I have concerns about both discoverability for developers and extensibility by contrib if we do continue with this solution. But, I don't have a better idea right now, and this unblocks the feature to see if it is at least workable and understandable by XB users who are experimenting with JS components.
- ๐ฌ๐งUnited Kingdom longwave UK
That should be the last of the test failures.
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Looks great!
- Added missing "invalidate (render) cached block component instances when an overriding code component instance is saved" โ which @longwave pointed out: tests (fails) + fix
- Added missing internal HTTP API test coverage to ensure the client can actually set
block_override
! Turns out it couldn't ๐ It was missing a one-liner. That'd have been a frustrating discovery for @balintbrews in โจ [PP-1] Editing code components as overrides, step 1 Postponed !
I think there's plenty of warnings to not risk this ossifying as-is. I agree with @longwave's concerns, but โฆ I mostly admire the very clever solution @effulgentsia demonstrated here ๐คฏ
-
wim leers โ
committed 27eba95a on 0.x authored by
balintbrews โ
Issue #3505993 by wim leers, effulgentsia, longwave, balintbrews: Code...
-
wim leers โ
committed 27eba95a on 0.x authored by
balintbrews โ
Automatically closed - issue fixed for 2 weeks with no activity.