Skip to content

Commit 069b95e

Browse files
Merge remote-tracking branch 'origin/main' into feat/issue-757-migrate-mui-to-shadcn
# Conflicts: # docs/library/embedding/install.md # docs/library/overview.md # docs/library/quickstart.md # library/package.json # library/vite.config.ts # pnpm-lock.yaml
2 parents 05cddf5 + 515777b commit 069b95e

13 files changed

Lines changed: 270 additions & 104 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tumaet/apollon": minor
3+
---
4+
5+
Two packaging improvements for embedding hosts. First, `yjs` and `y-protocols` are now required peer dependencies instead of being bundled, so your app and Apollon share a single Yjs instance — no duplicate payload and no cross-instance document errors. Second, a new `@tumaet/apollon/external` entry exposes the same imperative `ApollonEditor` API as the default entry but leaves **every** dependency external (React, xyflow, Base UI, lucide, @dnd-kit, zustand, uuid, @chenglou/pretext, …) — so a bundler host of any framework resolves and de-duplicates each one from its own `node_modules` and gets full supply-chain / SBOM visibility, instead of a copy inlined invisibly into the bundle. The default `@tumaet/apollon` (self-contained) and `@tumaet/apollon/react` entries are unchanged. Action required only if you adopt the new entry or the Yjs peer: install the corresponding peers (most package managers do this automatically).

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ This monorepo contains every piece of the Apollon platform:
1515
## Use the library
1616

1717
```sh
18-
npm install @tumaet/apollon
18+
npm install @tumaet/apollon yjs y-protocols
1919
```
2020

21-
See the [library README](./library/README.md) for the API.
21+
`yjs` and `y-protocols` are required peer dependencies — they power Apollon's
22+
document model and undo/redo (and live collaboration when enabled), kept
23+
external so the host owns a single Yjs instance. See the
24+
[library README](./library/README.md) for the API and the other build entries.
2225

2326
## Run the stack locally
2427

@@ -52,7 +55,7 @@ To preview the documentation site instead, run `pnpm dev:docs` from the repo roo
5255
| ------------- | -------------------------------------------------------------------- |
5356
| Library | React, TypeScript, React Flow (`@xyflow/react`), Yjs, Zustand, Vite |
5457
| Server | Express 5, Redis (RedisJSON), WebSocket relay |
55-
| Webapp | React, TypeScript, Vite, MUI, Tailwind |
58+
| Webapp | React, TypeScript, Vite, shadcn-style UI (Base UI), Tailwind |
5659
| Storage | Redis with RedisJSON (diagrams expire after 120 days via native TTL) |
5760
| Reverse proxy | Traefik v3 (production) |
5861

docs/library/embedding/angular.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ description: Embed Apollon in an Angular host using the default standalone bundl
77
# Angular
88

99
Use the **standalone subpath** (`@tumaet/apollon`). Angular hosts get the
10-
editor with **zero peer deps** to install — React is bundled inside the
11-
tarball.
10+
editor with React bundled inside the tarball; the only peers to install are
11+
`yjs` and `y-protocols` (`npm install @tumaet/apollon yjs y-protocols`).
1212

1313
```ts
1414
import {

docs/library/embedding/install.md

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,32 @@ description: Install @tumaet/apollon — pick the standalone or /react subpath.
66

77
# Install
88

9+
`yjs` and `y-protocols` are required peer dependencies of **every** build — they
10+
power Apollon's document model and undo/redo (and live collaboration when
11+
enabled), so the editor needs them whether or not you collaborate. Keeping them
12+
external lets a host that already uses Yjs share a single instance instead of a
13+
private, possibly mismatched copy. Most package managers install missing peers
14+
automatically.
15+
916
## Standalone build (any framework)
1017

1118
```sh
12-
npm install @tumaet/apollon
19+
npm install @tumaet/apollon yjs y-protocols
1320
```
1421

1522
```ts
1623
import { ApollonEditor } from "@tumaet/apollon"
1724
import "@tumaet/apollon/style.css"
1825
```
1926

20-
No further installs — React and xyflow are bundled inside the library tarball.
27+
React, Base UI, lucide, and xyflow are bundled inside the library tarball; only
28+
`yjs` and `y-protocols` are peers you provide.
2129

2230
## Peer-dependency build (React hosts)
2331

2432
```sh
2533
npm install @tumaet/apollon \
34+
yjs y-protocols \
2635
react react-dom \
2736
@xyflow/react
2837
```
@@ -32,16 +41,45 @@ import { ApollonEditor } from "@tumaet/apollon/react"
3241
import "@tumaet/apollon/style.css"
3342
```
3443

44+
`yjs` and `y-protocols` are required for every build; the React and xyflow peers
45+
below are needed by the `/react` and `/external` builds.
46+
3547
| Peer | Range |
3648
| --------------- | --------- |
37-
| `react` | `^18.3.0` |
38-
| `react-dom` | `^18.3.0` |
39-
| `@xyflow/react` | `^12.3.0` |
49+
| `yjs` | `^13.6.0` |
50+
| `y-protocols` | `^1.0.6` |
51+
| `react` | `^19.0.0` |
52+
| `react-dom` | `^19.0.0` |
53+
| `@xyflow/react` | `^12.9.0` |
4054

4155
The `/react` subpath keeps your final bundle from shipping a second copy of
4256
React. It is also the entry that exports the `<Apollon>` React component — the
4357
recommended way to embed in React. See [React](/library/embedding/react).
4458

59+
## Fully external build (any bundler host)
60+
61+
```sh
62+
npm install @tumaet/apollon \
63+
yjs y-protocols \
64+
react react-dom \
65+
@xyflow/react
66+
```
67+
68+
```ts
69+
import { ApollonEditor } from "@tumaet/apollon/external"
70+
import "@tumaet/apollon/style.css"
71+
```
72+
73+
Same imperative `ApollonEditor` API as the default entry, but **every**
74+
dependency is external — the React family above _and_ Apollon's own runtime
75+
deps (`@base-ui/react`, `lucide-react`, `@dnd-kit`, `zustand`, `uuid`,
76+
`@chenglou/pretext`), which arrive transitively with the package. Your bundler
77+
resolves and de-duplicates each one against your app's `node_modules`, and your
78+
bundle analyzer / SBOM tooling sees them as real packages instead of code
79+
inlined invisibly into one chunk. Use it from any framework with a bundler,
80+
including non-React ones (the editor still runs on the React you provide
81+
internally; your own code never touches it).
82+
4583
## Type definitions
4684

47-
Types ship with the package (`dist/index.d.ts`) and are identical for both subpaths. Requires TypeScript 5.0+ with `moduleResolution: "bundler" | "node16" | "nodenext"`.
85+
Types ship with the package (`dist/index.d.ts`) and are identical for every subpath. Requires TypeScript 5.0+ with `moduleResolution: "bundler" | "node16" | "nodenext"`.

docs/library/embedding/vanilla.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ description: Drop Apollon into a plain HTML page with one script tag.
99
The standalone subpath works as a single ESM module loaded directly from a
1010
CDN. No build step, no bundler.
1111

12+
`yjs` and `y-protocols` are required peers, but on the CDN path esm.sh resolves
13+
and serves them from the import URL automatically — there is nothing extra to
14+
load. (With a bundler you install the peers yourself — see
15+
[Install](/library/embedding/install).)
16+
1217
```html
1318
<link rel="stylesheet" href="https://esm.sh/@tumaet/apollon@4.8.0/style.css" />
1419
<div id="apollon" style="width: 100%; height: 600px"></div>

docs/library/overview.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ Apollon ships as an npm library that any framework can embed. The public API is
1414

1515
13 UML and modeling diagram types · SVG/PNG/PDF/JSON export · optional real-time collaboration via Yjs · injectable [canvas overlay controls](/library/api/overlay-controls).
1616

17-
## Two builds, one API
17+
## Three builds, one API
1818

19-
| Subpath | React / xyflow | Bundle | When to use |
20-
| ----------------------------- | -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21-
| `@tumaet/apollon` _(default)_ | bundled | ~2.4 MB | Any framework that doesn't already have React installed — Angular (the primary use case for [Artemis](https://artemis.tum.de/)), Vue, Svelte, vanilla JS. Zero peer deps to install. |
22-
| `@tumaet/apollon/react` | externalized | ~875 KB | React 18.3 hosts that want to share their React instance with the editor and dedupe the bundle. |
19+
| Subpath | Dependencies | When to use |
20+
| ----------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21+
| `@tumaet/apollon` _(default)_ | all bundled (except Yjs) | No bundler — vanilla JS, a `<script>` tag, or a CDN. Also any framework without React installed: Angular ([Artemis](https://artemis.tum.de/)), Vue, Svelte. Self-contained; only `yjs` + `y-protocols` to install. |
22+
| `@tumaet/apollon/react` | React family external | A React 19 host that shares its own React instance with the editor and wants the `<Apollon>` component. |
23+
| `@tumaet/apollon/external` | everything external | A bundler host of any framework — Angular, Vue, Svelte, React — that wants one shared, fully auditable copy of every dependency. |
2324

24-
`peerDependenciesMeta.optional` covers all peers `npm install @tumaet/apollon` never warns about missing React.
25+
`peerDependenciesMeta.optional` covers the React-family peers (`react`, `react-dom`, `@xyflow/react`), so `npm install @tumaet/apollon` never warns about missing React. `yjs` and `y-protocols` are required peers of all builds — they power Apollon's document model and undo/redo (and live collaboration when enabled), so the editor needs them either way, and keeping them external lets a host that already uses Yjs own a single instance. Most package managers add them automatically. The `/external` entry additionally externalizes Apollon's own runtime deps (`@base-ui/react`, `lucide-react`, `@dnd-kit`, `zustand`, `uuid`, `@chenglou/pretext`), which install transitively with the package.
2526

2627
## What's next
2728

docs/library/quickstart.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ idiomatic version — but the two steps below are all Apollon needs.
1313
## 1. Install
1414

1515
```sh
16-
npm install @tumaet/apollon
16+
npm install @tumaet/apollon yjs y-protocols
1717
```
1818

19-
This is the standalone build: React and xyflow are bundled inside the tarball,
20-
so there are no peer dependencies to install. React hosts
21-
should instead use the `/react` subpath — see [Install](/library/embedding/install).
19+
This is the standalone build: React, Base UI, lucide, and xyflow are bundled
20+
inside the tarball; `yjs` and `y-protocols` are the only peers you install. They
21+
power Apollon's document model and undo/redo (and live collaboration when
22+
enabled), kept external so a host that already uses Yjs shares one instance.
23+
React hosts should instead use the `/react` subpath — see
24+
[Install](/library/embedding/install).
2225

2326
:::danger The editor MUST have an explicit height
2427
Apollon renders onto a React Flow canvas, which sizes itself to its parent. If

docs/src/pages/index.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const VANILLA_SNIPPET = `<link
7575
<div id="apollon" style="width: 100%; height: 600px"></div>
7676
7777
<script type="module">
78+
// esm.sh serves Apollon's required yjs/y-protocols peers automatically.
7879
import { ApollonEditor } from "https://esm.sh/@tumaet/apollon@4.8.0"
7980
8081
const saved = localStorage.getItem("diagram")
@@ -111,7 +112,9 @@ function Hero() {
111112
</Link>
112113
</div>
113114
<div className={styles.install}>
114-
<CodeBlock language="bash">npm install @tumaet/apollon</CodeBlock>
115+
<CodeBlock language="bash">
116+
npm install @tumaet/apollon yjs y-protocols
117+
</CodeBlock>
115118
</div>
116119
</div>
117120
</header>
@@ -174,7 +177,7 @@ function LiveDemo() {
174177
>
175178
{() => {
176179
// Lazy-require: BrowserOnly only runs this on the client,
177-
// so the editor's emotion/MUI/xyflow imports stay out of
180+
// so the editor's Base UI / xyflow imports stay out of
178181
// Docusaurus's SSR bundle.
179182
const ApollonEmbed =
180183
require("../components/ApollonEmbed").default
@@ -224,8 +227,9 @@ const WAYS: LinkCard[] = [
224227
body: (
225228
<>
226229
<code>@tumaet/apollon</code> on npm. Framework-agnostic by default;
227-
Angular hosts install <strong>zero peer deps</strong>. A{" "}
228-
<code>/react</code> subpath dedupes React when the host already has it.
230+
Angular hosts install just <code>yjs</code> + <code>y-protocols</code>.
231+
A <code>/react</code> subpath dedupes React when the host already has
232+
it.
229233
</>
230234
),
231235
to: "/library/",

docs/user/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ versioned and reviewed like any other source.
5454
you need UML modeling inside an existing application.
5555

5656
```sh
57-
npm install @tumaet/apollon
57+
npm install @tumaet/apollon yjs y-protocols
5858
```
5959

6060
| You want to... | Use this |

0 commit comments

Comments
 (0)