Skip to content

Framework Support

RSPFx is framework-agnostic — the core knows nothing about React or Vue. Each framework is a pluggable package with a compiler preset and a web part base class. See Microsoft docs: SharePoint Framework overview and Working with web part manifests.

Tip: Pick your bundler by ranking Vite > Rsbuild > Rspack. Vite gives the simplest CSS and fastest loop for every framework. See styling.md.

Choosing a framework

FrameworkOfficial SPFxRSPFxFast refresh
React / Vanilla TS✅ / —
Preact / Vue / Svelte / Solid

Official templates ship React only. RSPFx adds the rest as first-class presets (@mbsks/rspfx-framework-*) with loaders and base classes (ReactWebPart, VueWebPart, …). Solid is available via Rspack (examples/solid) and Rsbuild (examples/rsbuild-solid, @mbsks/rspfx-example-rsbuild-solid).

Tip: Scaffold with any starter first (npm create vite@latest -- --template react-ts / pnpm create vite@latest / yarn create vite@latest / bun create vite@latest, better-t-stack, TanStack Router, etc.), then add rspfxVite() — framework deps come from your starter, not from RSPFx pins. packages/templates/src/index.ts:62 FRAMEWORK_RUNTIME_DEPS is only the rspfx new shortcut.

Tip: For new parts, use React if your org already does; for small or interactive parts, Solid and Preact give smaller bundles with full HMR. See fast-refresh.md.

AspectOfficialRSPFx
Other frameworksCommunity webpack loadersrspfx new --framework vue|svelte|solid|preact
JSX / compilerHeft rig + ts-loaderSWC, per-framework preset contributions
Fast refreshrspfx dev --refresh (react/preact/vue/svelte/solid)

Adapter contract

Each framework exports a pure createXAdapter factory — testable off-DOM with jsdom:

ts
import { createVanillaAdapter } from '@mbsks/rspfx-framework-vanilla/headless';
const adapter = createVanillaAdapter<{ name: string }>((props) => props.name);
adapter.mount(root, { name: 'a' });
adapter.update(root, { name: 'b' });
adapter.unmount(root);

For SPFx, wire it via defineWebPart:

ts
import { defineWebPart } from '@mbsks/rspfx-webpart-base';
import { createReactAdapter } from '@mbsks/rspfx-framework-react/headless';
export default defineWebPart<{ name: string }>({
  adapterFactory: () => createReactAdapter((props) => <Hello {...props} />),
});

See custom-framework.md.

Mount semantics

AdapterMountUpdateUnmount
ReactcreateRoot(root).renderroot.renderroot.unmount
Preactrender(vnode, root)render(vnode, root)render(null, root)
VuecreateApp(comp).mountunmount + recreateapp.unmount
Sveltenew Component / mount (Svelte 5)$set or recreate$destroy / unmount
Solidrender + signalsetPropsdispose
VanillareplaceChildrenreplaceChildrenreplaceChildren

Package layout

Each @mbsks/rspfx-framework-<fw> has three entry points: index (preset only, Node-safe), /headless (createXAdapter, browser, no SPFx dep), and /webpart (thin HeadlessWebPart shim, deprecated).

Fast refresh

FrameworkFast refreshMechanism
Reactplugin-react-refresh
Preactplugin-preact-refresh
Vuevue-loader HMR
Sveltesvelte-loader hotReload
Solidsolid-refresh babel plugin
VanillaFull reload

Any failure falls back to reload. Enable with rspfx dev --refresh. See fast-refresh.md.

Adding a new framework

  1. Create the framework package (depends on core + plugin-api; framework libs as peers).
  2. Export a FrameworkPreset with contributions() (loader rules, SWC options, plugins).
  3. Export a <Cap>WebPart class from the /webpart subpath.
  4. Register the preset via the CLI registry or definePlugin/registerPlugin.
  5. Add a scaffold template — it appears automatically at http://localhost:4321/.

See custom-framework.md.

Looking for Angular, Lit or Qwik?

RSPFx ships React, Vue, Svelte, Solid, Preact and vanilla. Other frameworks — Angular, Lit, Qwik, Astro, Ember, Stencil, Alpine, Mithril, Inferno — work via Custom Framework; create a FrameworkPreset and register it with definePlugin/registerPlugin.

FrameworkPath
AngularCustom — follow custom-framework.md
LitCustom — lit element wrapper via adapter
QwikCustom — follow custom-framework.md
AstroCustom — follow custom-framework.md
EmberCustom — follow custom-framework.md
StencilCustom — follow custom-framework.md
AlpineCustom — follow custom-framework.md
MithrilCustom — follow custom-framework.md
InfernoCustom — follow custom-framework.md

See custom-framework.md for the preset and web part contract.

Fluent UI

@mbsks/rspfx-fluent-adapter is an optional React-only package: FluentWebPart extends ReactWebPart and syncs the SharePoint theme via onThemeChanged(). Install with bun add @mbsks/rspfx-fluent-adapter @fluentui/react (or pnpm add / npm i / yarn add).

Note: @fluentui/react v8 and @fluentui/react-components v9 peer react >=16.8.0 <19.0.0 — they do not support React 19 yet. See react-19.md for the React 19 + Fluent UI caveat and alternatives.

Tip: Bundle React per web part (official behavior) — don't externalize it.

Released under the MIT License.