feat: Custom Slot - fragment-backed reusable content with instance-local fields#5677
Open
Yxnnxck wants to merge 1 commit intowebstudio-is:mainfrom
Open
feat: Custom Slot - fragment-backed reusable content with instance-local fields#5677Yxnnxck wants to merge 1 commit intowebstudio-is:mainfrom
Yxnnxck wants to merge 1 commit intowebstudio-is:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR introduces a new core component: Custom Slot, enabling reusable synced content with per-instance field values.
It builds on top of:
The goal is to bridge the gap between current Slots and a full component system by introducing:
Summary
Custom Slot allows creating reusable content blocks that behave like real components:
Unlike current Slots, this removes implicit structure (e.g. "first child is special") and introduces a proper internal model.
Motivation
Current limitations:
This PR moves Webstudio toward a real component model.
What changed
Implemented
1. New core component:
ws:customSlot2. Data model redesign
Invariant:
Custom Slot -> Fragment (internal)
__customSlotValues__customSlotSchemacomponentobject3. Rendering & traversal
4. Local fields system
5. Structured bindable values
componentobject creation6. Scope isolation
component7. UX cleanup
Internal variables hidden from:
8. Not implemented
Why this approach
Steps for reproduction
Custom SlotExpected:
Code Review
Before requesting a review
(I didn't add Comments if needed I can do so but I hope Code is clear)
Before merging