@snowcone-app/ui 0.10.14 → 0.10.16
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.
- package/CHANGELOG.md +18 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/personalization/PersonalizationProvider.tsx +7 -3
- package/src/personalization/__tests__/PersonalizationProvider.canvas-import.test.tsx +35 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`6477622`](https://github.com/snowcone-app/snowcone-monorepo/commit/6477622b9a429a09aec41881db1ac1dd0b73dad2)]:
|
|
8
|
+
- @snowcone-app/sdk@0.31.0
|
|
9
|
+
|
|
10
|
+
## 0.10.15
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#5365](https://github.com/snowcone-app/snowcone-monorepo/pull/5365) [`fd949e6`](https://github.com/snowcone-app/snowcone-monorepo/commit/fd949e6cef3687fd676c866c407da5c37534c674) Thanks [@kevinsproles](https://github.com/kevinsproles)! - Smaller first load for pages that show a canvas or a product.
|
|
15
|
+
- canvas: the print-export Web Worker's code (about 1 MB, 227K gzip) now loads with `import()` on the first export
|
|
16
|
+
instead of with the package, so a page that merely shows an editor or a product no longer downloads it up front.
|
|
17
|
+
Exports work as before; only the first one waits for the code.
|
|
18
|
+
- ui: `PersonalizationProvider` calls `canvasImport` only when the product has personalization fields, so a product
|
|
19
|
+
without them never loads the canvas.
|
|
20
|
+
|
|
3
21
|
## 0.10.14
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -16718,9 +16718,10 @@ function PersonalizationProvider({
|
|
|
16718
16718
|
const [BridgeComponent, setBridgeComponent] = (0, import_react69.useState)(
|
|
16719
16719
|
cachedBridgeComponent
|
|
16720
16720
|
);
|
|
16721
|
+
const hasFields = fields.length > 0;
|
|
16721
16722
|
(0, import_react69.useEffect)(() => {
|
|
16722
16723
|
if (CanvasComponent && BridgeComponent) return;
|
|
16723
|
-
if (!canvasImport) return;
|
|
16724
|
+
if (!canvasImport || !hasFields) return;
|
|
16724
16725
|
if (!canvasLoadPromise) {
|
|
16725
16726
|
canvasLoadPromise = canvasImport().then((mod) => {
|
|
16726
16727
|
cachedCanvasComponent = mod.SnowconeCanvas || mod.default;
|
|
@@ -16735,7 +16736,7 @@ function PersonalizationProvider({
|
|
|
16735
16736
|
setBridgeComponent(() => cachedBridgeComponent);
|
|
16736
16737
|
}
|
|
16737
16738
|
});
|
|
16738
|
-
}, [CanvasComponent, BridgeComponent, canvasImport]);
|
|
16739
|
+
}, [CanvasComponent, BridgeComponent, canvasImport, hasFields]);
|
|
16739
16740
|
const realtimeEnabledRef = (0, import_react69.useRef)(false);
|
|
16740
16741
|
(0, import_react69.useEffect)(() => {
|
|
16741
16742
|
return () => {
|