Skip to content

Commit 91725cd

Browse files
committed
refactor(superdoc): drop UMD deprecation shim
The old superdoc.umd.js was broken for browser use (wrong external globals, ReferenceError on load). No deprecation window needed for something that didn't work. Remove emit-umd-alias.cjs, the UMD alias test, and the build:cdn pipe to it. Fix AGENTS.md to note that Yjs is inlined (only pdfjs-dist stays external).
1 parent d074039 commit 91725cd

5 files changed

Lines changed: 2 additions & 62 deletions

File tree

packages/superdoc/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Drop SuperDoc into any HTML page via `<script>` tag. No bundler, no `npm install
5151
</script>
5252
```
5353

54-
`window.SuperDoc` is the class directly. Named exports are attached as static properties (`SuperDoc.createTheme`, `SuperDoc.DOCX`, etc.). Collaboration (Yjs) and PDF viewing peers are **not** bundled — use the ESM path below if you need them.
54+
`window.SuperDoc` is the class directly. Named exports are attached as static properties (`SuperDoc.createTheme`, `SuperDoc.DOCX`, etc.). Collaboration (Yjs) is included. PDF viewing (`pdfjs-dist`) is not — use the ESM path below if you need it.
5555

5656
### ES modules + import map
5757

packages/superdoc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"postbuild": "node ./scripts/ensure-types.cjs && node ./scripts/audit-bundle.cjs",
9999
"build:es": "vite build && pnpm run postbuild",
100100
"watch:es": "vite build --watch",
101-
"build:cdn": "vite build --config vite.config.cdn.js && node ./scripts/emit-umd-alias.cjs",
101+
"build:cdn": "vite build --config vite.config.cdn.js",
102102
"watch:cdn": "vite build --watch --config vite.config.cdn.js",
103103
"clean": "rm -rf dist",
104104
"pack:local": "pnpm run pack",

packages/superdoc/scripts/emit-umd-alias.cjs

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/superdoc/tests/cdn-smoke/index.umd-alias.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/superdoc/tests/cdn-smoke/smoke.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,3 @@ test('IIFE bundle (superdoc.global.js) exposes SuperDoc class on window', async
2323

2424
expect(errors).toEqual([]);
2525
});
26-
27-
test('deprecated superdoc.umd.js alias still works and warns', async ({ page }) => {
28-
const warnings: string[] = [];
29-
page.on('console', (msg) => {
30-
if (msg.type() === 'warning') warnings.push(msg.text());
31-
});
32-
33-
await page.goto('/tests/cdn-smoke/index.umd-alias.html');
34-
35-
const ready = await page.evaluate(() => (window as any).__SUPERDOC_READY__ === true);
36-
expect(ready).toBe(true);
37-
38-
expect(warnings.some((w) => w.includes('superdoc.umd.js is deprecated'))).toBe(true);
39-
});

0 commit comments

Comments
 (0)