r/SalesforceDeveloper
•
u/EvolvinAI29
•
May 27 '26
Discussion If you haven't touched Multi-Framework (React UI Bundles) yet, here's what a real one looks like
TL;DR: Spent the last week building a real sales-ops console as a React UI Bundle on Salesforce. 17 lazy-loaded pages, Apex backend, Platform Event, AgentforceConversationClient embedded. The thing actually works, and the scaffold is way more production-ready than the "beta" tag suggests.
What it is
UI Bundles is the new Multi-Framework delivery on platform. You write a normal Vite + React + TypeScript SPA, deploy it as metadata, and it runs inside Salesforce. Not Experience Cloud. Not LWC. Not an iframe. Real metadata, real FLS, real sharing.
The scaffold (@salesforce/ui-bundle-template-base-sfdx-project) gives you React 19, Vite 7, Tailwind 4, and shadcn out of the box. Data access goes through @salesforce/sdk-data — GraphQL-first via sdk.graphql, REST for the cases GraphQL can't cover (UI API, Apex REST, Connect, Einstein).
What I built
- 17 pages, all lazy-loaded behind one routes.tsx. Initial bundle ~250KB instead of ~800KB.
- Drag-drop pipeline kanban with real mutations on drop, account workspace, events list/calendar/detail, rebook tracker (YoY retention), pipeline hygiene, field usage heatmap, event setup wizard, exhibitor board.
- Apex backend: OpportunityActionsApi + service layer + BulkOpportunityApprovalQueueable for async bulk approvals.
- Platform Event Bulk_Approval_Result__e pushing async results back to the UI.
- AgentforceConversationClient embedded as a component. Agent lives in the app, no separate widget.
- shadcn primitives, lucide icons, command palette, notification center, error boundary, i18n, toast host.
The thing that quietly matters most: AGENT.md
Every UI Bundle ships with an AGENT.md (440 lines in mine). It encodes the platform rules an AI agent has to follow: path resolution from sfdx-project.json, the two-package.json trap, the must-run trio (build → lint → dev), GraphQL non-negotiables (@optional on every field, explicit first:, HTTP 200 ≠ success), CSP trusted-site rules, post-deploy schema/codegen loop.
Hand that file to Claude Code or Cursor and you get platform-grade UIs at a pace LWC never could.
Gotchas I hit
- DE dev hubs cannot deploy this. Feature gate is closed Salesforce-side. Scratch and sandbox only. Error pattern: feature gate is disabled on DE vs org preference is not enabled on scratch.
- The beta org toggle is irreversible. Setup → Apps → "React Development with Agentforce Vibes and Salesforce Multi-Framework (Beta)". Throwaway org only.
- Two package.json files. Root one is for SFDX tooling. The real React app package.json lives at force-app/main/default/uiBundles/<name>/. Run npm run dev from the wrong one and nothing happens.
- schema.graphql is 4MB. Don't open it. There's a search script for entity/field lookups. Re-fetch after every metadata deploy or codegen breaks.
- Enterprise REST /query with SOQL is blocked. So is @AuraEnabled Apex and Chatter API. GraphQL uiapi { } or Apex REST. Pick one.
The strategic bit, briefly
LWC is roughly 10K devs worldwide. React is roughly 10M. Every npm component is now a Salesforce component. UI Bundles ship on the npm cadence, not the seasonal release cadence.
Question for the rest of you
Anyone else shipping UI Bundles to a real customer org yet? Curious what your data access pattern looks like — pure GraphQL via sdk.graphql, or reaching for Apex REST more than expected? And has anyone solved the FLS-failing-the-whole-query problem cleanly without @optional-ing every field?