feat(registry): design-system registry infrastructure#46
Conversation
Introduces a pluggable component + slot registry so the editor tree can be rendered entirely with any design system (MUI, Chakra, etc.) without forking the library. Public API - `SchemaBuilderRegistryProvider` — context provider; registries nest (inner merges over outer, so consumers override only what they need) - `mergeRegistry(base, override)` — explicit merge helper - `useComponent` / `useSlot` / `useSlotProps` — internal hooks consumed by every editor component Component adapters (Button, Input, Switch, Label, Badge, ButtonToggle) Slot adapters (Root, FieldFrame, FieldHeader, FieldMain, FieldActions, FieldBody, MobileModeSwitch, FullscreenToggle) Layout ownership DefaultFieldFrame and DefaultFieldHeader own their own layout classes; callers pass only semantic state (depth, expanded, hasErrors). Demo demo/pages/MuiRegistry.tsx — full working example of overriding every component and slot adapter with @mui/material primitives. demo/App.tsx — two-tab nav (Default | MUI Registry). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hello and thank you! I find this a little hard to review. The pr is huge. Did you review it yourself? |
|
If you want to move forward, I think you should split this, and start with one small PR, that clearly brings value on its own, with a human written description of what you did to ensure the LLMs output is correct and why you think the changes are valuable, and don't introduce code duplication, unreachable hidden undocumented features, test cheats, illogical user experience, and other common issues introduced by unmonitored AI agents |
|
Hello, @lovasoa ! Of course I did review this PR. In fact this is 4th or 5th generation of internal reviews. I think you are being unfair judging the size of the PR by sheer LOC. In fact the only large pieces are:
Otherwise all the changes are atomic, clean extract refactorings of I will be happy to assist with an overview doc, if you wish, to guide you through the changes, would that help? Egor |
|
Hi Egor! |
|
And if you are in the mood of reviewing large changes, there is this other PR that sounds like a nice feature, but is also too large for me to review at the moment: #47 . Feel free to merge it if it's good. |
|
@lovasoa Yes, I can commit fair share of my time to project maintenance. Can't promise always day-to-day answers, though. What are your expectations? Are you up to continue doing maintenance? |
|
Yes, I'm staying here as a maintainer. This is unpaid labor, so I won't require anything from you, but if you could at least review PRs and issues touching the code you added, it'd be nice. If you have more time and want to take more ownership, that's even better. I sent you an invite. |
|
Publishing to npm is automated, so you should be able to publish new versions just by pushing a new tag: https://github.com/lovasoa/jsonjoy-builder/blob/main/.github/workflows/publish.yml |

Summary
SchemaBuilderRegistryProvidernests — inner registries merge over outer, so you override only what you needDefaultFieldFrameandDefaultFieldHeaderown their own visual classes; callers pass only semantic state (depth,expanded,hasErrors)demo/pages/MuiRegistry.tsx) that overrides every component adapter and slot adapter — demonstrates the API and justifies@mui/materialas a dev depPublic API additions
SchemaBuilderRegistryProvidermergeRegistry(base, override)SchemaBuilderRegistry/SchemaBuilderComponents/SchemaBuilderSlotsuseComponent/useSlot/useSlotPropsComponent adapters
Button,Input(with integratedlabelprop),Switch,Label,Badge,ButtonToggle(exposesaria-pressedfor toggle state)Slot adapters
FieldFrame(depth,expanded,hasErrors),FieldHeader,FieldMain,FieldActions,FieldBody,Root,MobileModeSwitch,FullscreenToggleTest plan
npm test— 4 new registry test files covering component overrides, slot overrides,mergeRegistry, and provider nestingnpm run typecheck— no errorsnpm run check— no lint/format errorsnpm run demo→ navigate to MUI Registry tab and verify all 6 schema fields render with MUI components