Make the UI Editor work through portals #53
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The core feature here is to get all the UI Editor code into implementer-tools. Changing the UI Editor shouldn't require changing the
Extension
orExtensionSlot
elements themselves. This change achieves that by using Portals to get the UI Editor content to appear over the slots and extensions.In order to accomplish this, the main thing that had to change in Core is that 1. slots need to pass a ref to register with and 2. DOM nodes for slots and extensions should be kept in the store.
Tangentially, I created a function
createUseStore
based on this comment from the unistore creator to make it easier to use state and actions in React components (no moreconnect
).There's pretty much no UI change here. Just an architecture thing. We can now make the UI Editor as elaborate as we want without worrying about the core libraries getting bloated or slowing down.