Problem/Motivation
Child 5 of #3624396: Plan: Harden InstanceInterface, IslandInterface and DisplayBuildableInterface as public API before RC1. Islands are what contrib extends most, so their API has to be right before RC1.
- An island calls the instance a builder:
build(InstanceInterface $builder),buildContent(),getHtmlId(string $builder_id), and the protected$builderand$builderIdofIslandPluginBase. The 11on*()methods of the same island say$instance, as does the rest of the API. keyboardShortcuts()is a static method, called on the class, so an island cannot answer from its configuration. Its docblock promises a map of keys to descriptions.typeis optional on#[Island], while an island without a type does not work.afterBuild()is declared twice, onIslandInterfaceand onIslandWithFormInterface.reloadWithNodeData()has no caller.
Proposed resolution
$builderbecomes$instanceand$builderIdbecomes$instanceId: the protected properties ofIslandPluginBase, and the arguments ofbuild(),buildContent()andgetHtmlId(). Renamed outright, as every API change before RC1.getKeyboardShortcuts(): arrayreplaces the statickeyboardShortcuts(). The base returns none.typerequired on#[Island], afterlabel. Every island passes named arguments.afterBuild()leavesIslandWithFormInterface.reloadWithNodeData()is removed.
ThirdPartySettingsInterface keeps its name, see #7. What an empty result of an island means moves to #3635780: Islands cannot tell "no update" from "empty me" in an event result.
Remaining tasks
- Update
display_builder_aiand raise its constraint ondrupal/display_builder. - Publish the change record with beta10.
User interface changes
None.
API changes
IslandPluginBase::$builderand$builderIdrenamed$instanceand$instanceId, with the arguments ofbuild(),buildContent()andgetHtmlId().IslandInterface::getKeyboardShortcuts()replaces the statickeyboardShortcuts().typerequired on#[Island].reloadWithNodeData()removed.afterBuild()removed fromIslandWithFormInterface.
Data model changes
None.
Issue fork display_builder-3627256
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
mogtofu33 commentedComment #3
mogtofu33 commentedComment #4
mogtofu33 commentedComment #5
mogtofu33 commentedComment #6
pdureau commentedbeta9 has been released. Changing the tag.
Comment #7
pdureau commentedIt is the good time to do such a change, which is a leftover of the big instance/node/builder confusion of summer 2025. I don't see how it breaks compatibility thoughts:
👌 It worth to check.
👌 OK, let's not change too much so close to 1.0.0
👌OK, let's do this.
👌OK, let's do this.
👌OK, let's do this.
⚠️ Why? It was named like the Core interface for familiarity reason. It has only one method but it is expected to host more. Third party settings will be the most movable part of the API, we have only scratched the surface with our curent panels.
⚠️ We need a way of making the distinction between:
Maybe it is not properly documented, or not properly implemented, and I would advise to address such topic in a dedicated ticket.
Comment #8
pdureau commentedI would like to give a try, but I see it is "Needs work". Do you already have something local ?
Comment #9
pdureau commentedComment #10
mogtofu33 commentedTrimmed to land before beta10.
ThirdPartySettingsInterfacekeeps its name, you are right that it will grow.The empty result question is real and wider than
build(), so it gets #3635780: Islands cannot tell "no update" from "empty me" in an event result.MR in for review.
Comment #12
mogtofu33 commentedComment #13
pdureau commented✅ MR looks good. No changes in PHP tests except renaming. No changes in playwright tests.
✅ MR looks good. No changes in PHP tests except renaming. No changes in playwright tests.
✅ MR looks good. I see the change in
src/Attribute/Island.php. No changes in tests.✅ MR looks good. I see the changes in
src/Island/IslandWithFormInterface.phpandIslandPluginBase. No changes in tests.✅ kept.
✅ OK, let's discuss there: #3635780: Islands cannot tell "no update" from "empty me" in an event result
Comment #14
pdureau commentedComment #16
mogtofu33 commentedThanks !
Comment #18
pdureau commentedShipped in beta10 release.