Skip to content

Commit cb4a4b6

Browse files
Fix react 19 live build
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
1 parent d905530 commit cb4a4b6

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

.changeset/big-cycles-agree.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
"react-quill-new": minor
2+
"react-quill-new": patch
33
---
44

5-
Bump to 3.8.0 and migrate repo to pnpm + turborepo + changesets. Replace webpack bundle build with tsup and begin migrating tests to vitest (playwright browser mode).
6-
7-
5+
Migrate repo to pnpm + turborepo + changesets. Replace webpack bundle build with tsup and begin migrating tests to vitest (playwright browser mode).
6+
This might affect the compiled version of the bundle.

apps/demo/public/react19-quill2/index.html

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,30 @@
99
<body>
1010
<div id="app"></div>
1111

12-
<!-- React 19 UMD (update versions if needed) -->
13-
<script src="https://unpkg.com/react@19/umd/react.development.js" crossorigin></script>
14-
<script src="https://unpkg.com/react-dom@19/umd/react-dom.development.js" crossorigin></script>
12+
<!-- React 19 via ESM (React 19 dropped UMD builds) -->
13+
<script type="module">
14+
import React from 'https://esm.sh/react@19';
15+
import ReactDOM from 'https://esm.sh/react-dom@19';
16+
import { createRoot } from 'https://esm.sh/react-dom@19/client';
1517

16-
<!-- react-quill-new dist bundle -->
17-
<script src="/assets/react-quill.js"></script>
18-
<script src="/_shared/demo-reactquill.js"></script>
19-
<script>
20-
mountReactQuill(document.getElementById('app'), { title: 'React 19 + Quill 2' });
18+
// Expose as globals for the IIFE bundle
19+
window.React = React;
20+
window.ReactDOM = ReactDOM;
21+
window.ReactDOM.createRoot = createRoot;
22+
23+
// Load react-quill bundle
24+
const bundleScript = document.createElement('script');
25+
bundleScript.src = '/assets/react-quill.js';
26+
bundleScript.onload = () => {
27+
// Load shared demo script
28+
const demoScript = document.createElement('script');
29+
demoScript.src = '/_shared/demo-reactquill.js';
30+
demoScript.onload = () => {
31+
mountReactQuill(document.getElementById('app'), { title: 'React 19 + Quill 2' });
32+
};
33+
document.body.appendChild(demoScript);
34+
};
35+
document.body.appendChild(bundleScript);
2136
</script>
2237
</body>
2338
</html>

0 commit comments

Comments
 (0)