Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ Each folder is a self-contained dev app that consumes the hub via `"@stackone/hu
| Folder | What it exercises | Stack | Port | Run from hub root |
|---|---|---|---|---|
| `vite/` | React export (`<StackOneHub>`) on a Vite SPA | React 18 + Vite | 3001 | `npm run dev` |
| `vite-react19/` | React export (`<StackOneHub>`) on a Vite SPA, React 19 | React 19 + Vite | 3015 | `npm run dev:react19` |
| `nextjs/` | React export (`<StackOneHub>`) under Next.js SSR | React 19 + Next.js 15 | 3002 | `npm run dev:nextjs` |
| `vanilla/` | `<stackone-hub>` custom element via `<script src>` | Plain HTML + `serve` | 3010 | `npm run dev:vanilla` |
| `vue/` | `<stackone-hub>` in a Vue template | Vue 3.5 + Vite 5 | 3011 | `npm run dev:vue` |
| `svelte/` | `<stackone-hub>` in a Svelte component | Svelte 5 + Vite 6 | 3012 | `npm run dev:svelte` |
| `react/` | `<stackone-hub>` mounted from React (not the React export) | React 19 + Vite 5 | 3013 | `npm run dev:react-wc` |
| `rsbuild/` | React export (`<StackOneHub>`) bundled by Rspack — catches Node built-in leaks | React 19 + rsbuild | 3014 | `npm run dev:rsbuild` |
| `angular/` | `<stackone-hub>` in an Angular template | Angular 18 + Angular CLI | 4201 | `npm run dev:angular` |

## First-time setup
Expand Down
27 changes: 27 additions & 0 deletions dev/rsbuild/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# rsbuild sandbox

Consumes the React `<StackOneHub>` export and bundles it with
[rsbuild](https://rsbuild.dev) (Rspack) for a browser target.

Rspack is stricter than Vite: it does **not** silently polyfill Node core modules for the
web. So if anything in the bundle reaches for `crypto`, `fs`, `path`, or `vm`, the build
fails here with a clear `Module not found` error instead of shipping a broken bundle to
consumers. That makes this sandbox a good guard that the published hub stays browser-safe.

## Run

```bash
npm run dev:rsbuild:setup # build the hub, then npm install in dev/rsbuild
npm run dev:rsbuild # dev server on http://localhost:3014
```

To check the bundle directly:

```bash
cd dev/rsbuild && npm run build
```

A clean build means no Node built-ins leaked into `dist/`. If the build fails on one,
a transitive dependency has started reaching for the Node platform — trace it with
`npm ls <module>` and either resolve it to a browser entry or stub it in the hub's
`rollup.config.mjs`.
Loading
Loading