@rogieking/figui3 11.6.11 → 11.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,6 +29,35 @@ import "@rogieking/figui3/fig-editor.js";
29
29
 
30
30
  `fig-editor.js` imports `fig.js`. Still import `fig-editor.css`.
31
31
 
32
+ ### Bundler registration
33
+
34
+ Editor internals include registration-only modules: importing them defines custom
35
+ elements even when they export no values. Bundlers must preserve those module
36
+ side effects.
37
+
38
+ If core controls render but palette or gradient editors do not open, check:
39
+
40
+ ```js
41
+ customElements.get("fig-popup-palette");
42
+ ```
43
+
44
+ An `undefined` result after importing `fig-editor.js` means the editor
45
+ registration module was removed, usually by tree-shaking. Upgrade FigUI3 first.
46
+ For affected older releases, use this temporary Vite workaround:
47
+
48
+ ```ts
49
+ import { defineConfig } from "vite";
50
+
51
+ export default defineConfig({
52
+ optimizeDeps: { esbuildOptions: { treeShaking: false } },
53
+ build: { rollupOptions: { treeshake: false } },
54
+ });
55
+ ```
56
+
57
+ Remove the workaround after upgrading to a release whose package metadata marks
58
+ all JavaScript and CSS files as side-effectful. See the shared
59
+ [React guide](../figui3/react.md#bundler-registration) for details.
60
+
32
61
  Registered tags:
33
62
 
34
63
  | Tag | Role |
@@ -32,6 +32,41 @@ await import("@rogieking/figui3/fig-lab.js");
32
32
 
33
33
  SSR (Next/Remix/Astro): import the JS only on the client.
34
34
 
35
+ ## Bundler registration
36
+
37
+ FigUI3 JavaScript includes registration-only modules. Their imports define
38
+ custom elements even when they export no values, so bundlers must preserve
39
+ their side effects.
40
+
41
+ When core components work but an editor is missing, diagnose registration after
42
+ importing `fig-editor.js`:
43
+
44
+ ```js
45
+ customElements.get("fig-popup-palette");
46
+ ```
47
+
48
+ An `undefined` result means a registration module was not evaluated, usually
49
+ because an affected FigUI3 package version let the bundler tree-shake it.
50
+ Upgrade FigUI3 first. As a temporary Vite workaround for affected versions,
51
+ disable dependency and production tree-shaking:
52
+
53
+ ```ts
54
+ import { defineConfig } from "vite";
55
+
56
+ export default defineConfig({
57
+ optimizeDeps: { esbuildOptions: { treeShaking: false } },
58
+ build: { rollupOptions: { treeshake: false } },
59
+ });
60
+ ```
61
+
62
+ Remove this workaround after upgrading. Corrected releases declare:
63
+
64
+ ```json
65
+ {
66
+ "sideEffects": ["**/*.js", "**/*.css"]
67
+ }
68
+ ```
69
+
35
70
  ## JSX types
36
71
 
37
72
  ```ts
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [11.6.12]
6
+
7
+ ### Changed
8
+
9
+ - Preserved all JavaScript registration modules and CSS files during bundler tree-shaking.
10
+ - Documented editor registration diagnosis and a temporary Vite workaround for older affected releases.
11
+
5
12
  ## [11.6.11]
6
13
 
7
14
  ### Fixed