fix: replace duplicate componentInfos with registeredComponents
Description
We're trying to reduce the page size from using the Builder SDK. We've noticed there's about 1mb of component info stored in state and I noticed that the components are essentially stored twice in 2x different properties. The first step to reducing the payload is just using 1x: registeredComponents and passing it into the EnableEditor component to be used (the only place it is used).
Partially addresses #4166 and saves about 500kb of state (depending on component count ofc)
Screenshot
[!NOTE] Consolidates component registration by removing
componentInfosfrom context and usingregisteredComponentspassed fromContenttoEnableEditorfor editor registration, with minor version bumps.
- Content rendering:
- Build
state.registeredComponentsfrom defaults +customComponents, serialize, and expose viaComponentsContext.- Pass
registeredComponentstoBlocksand toEnableEditor.- Editor integration:
EnableEditornow acceptsregisteredComponentsand posts register messages from it; stops readingbuilderContextSignal.value.componentInfos.- Context/Types cleanup:
- Remove
componentInfosfromBuilderContextInterfaceand default context.- Build/config:
- Remove
componentInfosinjection from React Native context setup inmitosis.config.cjs.- Release:
- Changeset: minor bumps for
@builder.io/sdkand all framework SDKs.Written by Cursor Bugbot for commit 47bee42bc23fa14122a0d35fd710270b9c3a3cfe. This will update automatically on new commits. Configure here.
🦋 Changeset detected
Latest commit: 47bee42bc23fa14122a0d35fd710270b9c3a3cfe
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 10 packages
| Name | Type |
|---|---|
| @builder.io/sdk | Minor |
| @builder.io/sdk-angular | Minor |
| @builder.io/sdk-react-nextjs | Minor |
| @builder.io/sdk-qwik | Minor |
| @builder.io/sdk-react | Minor |
| @builder.io/sdk-react-native | Minor |
| @builder.io/sdk-solid | Minor |
| @builder.io/sdk-svelte | Minor |
| @builder.io/sdk-vue | Minor |
| @builder.io/react | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
🤖 Nx Cloud AI Fix Eligible
An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.
To disable these notifications, a workspace admin can disable them in workspace settings.
View your CI Pipeline Execution ↗ for commit 47bee42bc23fa14122a0d35fd710270b9c3a3cfe
| Command | Status | Duration | Result |
|---|---|---|---|
nx test @e2e/nextjs-sdk-next-app |
❌ Failed | 23m 9s | View ↗ |
nx test @snippet/nextjs-sdk-next-app |
❌ Failed | 15m 47s | View ↗ |
nx test @snippet/angular-17 |
❌ Failed | 5m 44s | View ↗ |
nx test @snippet/angular-17-ssr |
❌ Failed | 5m 32s | View ↗ |
nx test @snippet/vue |
❌ Failed | 3m 33s | View ↗ |
nx test @snippet/svelte |
❌ Failed | 2m 26s | View ↗ |
nx test @snippet/react |
❌ Failed | 1m 58s | View ↗ |
nx test @e2e/qwik-city |
✅ Succeeded | 9m 25s | View ↗ |
Additional runs (37) |
✅ Succeeded | ... | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-10-30 10:13:52 UTC
Thanks for reading through it and detailing the changes required :)
We've got a big project to deliver and already hacked this away in a PNPM patch (linked in my Issue) so I can't work on this right now but I can get back to it later maybe.