@uniformdev/canvas-next-rsc-shared 19.158.0 → 19.159.0

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/dist/index.d.mts CHANGED
@@ -20,17 +20,24 @@ type UniformServerConfig = {
20
20
  * Cache mode for manifest data.
21
21
  *
22
22
  */
23
- manifestCache?: CacheMode;
23
+ manifestCache?: CacheMode & {
24
+ bypassCache?: boolean;
25
+ };
24
26
  /**
25
27
  * Cache mode for canvas data.
26
28
  *
27
29
  */
28
- canvasCache?: CacheMode;
30
+ canvasCache?: CacheMode & {
31
+ disableSWR?: boolean;
32
+ bypassCache?: boolean;
33
+ };
29
34
  /**
30
35
  * Cache mode for project map data.
31
36
  *
32
37
  */
33
- projectMapCache?: CacheMode;
38
+ projectMapCache?: CacheMode & {
39
+ bypassCache?: boolean;
40
+ };
34
41
  /**
35
42
  * Options for Uniform Context
36
43
  */
@@ -80,6 +87,16 @@ type UniformServerConfig = {
80
87
  */
81
88
  vercelVisualEditing?: boolean;
82
89
  };
90
+ ppr?: {
91
+ /**
92
+ * Whether or not to wrap personalization components in a suspense boundary.
93
+ */
94
+ personalizationSuspense?: boolean;
95
+ /**
96
+ * Whether or not to wrap test components in a suspense boundary.
97
+ */
98
+ testSuspense?: boolean;
99
+ };
83
100
  };
84
101
 
85
102
  type PageParameters = {
@@ -172,10 +189,10 @@ declare const runTest: ({ test, component, contextInstance, }: TestProps & {
172
189
  slotName: string | undefined;
173
190
  slotIndex: number | undefined;
174
191
  } & {
175
- contextInstance: Pick<ContextInstance, 'test'> | undefined;
192
+ contextInstance: Pick<ContextInstance, 'test' | 'manifest'> | undefined;
176
193
  }) => {
177
194
  index: number | null;
178
- event: TestEvent;
195
+ event: TestEvent | null;
179
196
  };
180
197
 
181
198
  type ResolvePathResult = {
package/dist/index.d.ts CHANGED
@@ -20,17 +20,24 @@ type UniformServerConfig = {
20
20
  * Cache mode for manifest data.
21
21
  *
22
22
  */
23
- manifestCache?: CacheMode;
23
+ manifestCache?: CacheMode & {
24
+ bypassCache?: boolean;
25
+ };
24
26
  /**
25
27
  * Cache mode for canvas data.
26
28
  *
27
29
  */
28
- canvasCache?: CacheMode;
30
+ canvasCache?: CacheMode & {
31
+ disableSWR?: boolean;
32
+ bypassCache?: boolean;
33
+ };
29
34
  /**
30
35
  * Cache mode for project map data.
31
36
  *
32
37
  */
33
- projectMapCache?: CacheMode;
38
+ projectMapCache?: CacheMode & {
39
+ bypassCache?: boolean;
40
+ };
34
41
  /**
35
42
  * Options for Uniform Context
36
43
  */
@@ -80,6 +87,16 @@ type UniformServerConfig = {
80
87
  */
81
88
  vercelVisualEditing?: boolean;
82
89
  };
90
+ ppr?: {
91
+ /**
92
+ * Whether or not to wrap personalization components in a suspense boundary.
93
+ */
94
+ personalizationSuspense?: boolean;
95
+ /**
96
+ * Whether or not to wrap test components in a suspense boundary.
97
+ */
98
+ testSuspense?: boolean;
99
+ };
83
100
  };
84
101
 
85
102
  type PageParameters = {
@@ -172,10 +189,10 @@ declare const runTest: ({ test, component, contextInstance, }: TestProps & {
172
189
  slotName: string | undefined;
173
190
  slotIndex: number | undefined;
174
191
  } & {
175
- contextInstance: Pick<ContextInstance, 'test'> | undefined;
192
+ contextInstance: Pick<ContextInstance, 'test' | 'manifest'> | undefined;
176
193
  }) => {
177
194
  index: number | null;
178
- event: TestEvent;
195
+ event: TestEvent | null;
179
196
  };
180
197
 
181
198
  type ResolvePathResult = {
package/dist/index.esm.js CHANGED
@@ -192,11 +192,19 @@ var runTest = ({
192
192
  component,
193
193
  contextInstance
194
194
  }) => {
195
- var _a;
196
- const slot = ((_a = component.slots) == null ? void 0 : _a[CANVAS_TEST_SLOT]) || [];
195
+ var _a, _b;
196
+ const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
197
+ if (!isTestDefined && process.env.NODE_ENV !== "production") {
198
+ console.warn(`Test "${test}" is not defined in Uniform manifest.`);
199
+ return {
200
+ index: null,
201
+ event: null
202
+ };
203
+ }
204
+ const slot = ((_b = component.slots) == null ? void 0 : _b[CANVAS_TEST_SLOT]) || [];
197
205
  const componentVariations = slot.map((v, i) => {
198
- var _a2, _b, _c;
199
- const contextTag = (_b = (_a2 = v.parameters) == null ? void 0 : _a2[CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b.value;
206
+ var _a2, _b2, _c;
207
+ const contextTag = (_b2 = (_a2 = v.parameters) == null ? void 0 : _a2[CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b2.value;
200
208
  const id = (_c = contextTag == null ? void 0 : contextTag.id) != null ? _c : "testId" in v ? v.testId : `ab-${i}-${v.type}`;
201
209
  return {
202
210
  id,
package/dist/index.js CHANGED
@@ -222,11 +222,19 @@ var runTest = ({
222
222
  component,
223
223
  contextInstance
224
224
  }) => {
225
- var _a;
226
- const slot = ((_a = component.slots) == null ? void 0 : _a[import_canvas2.CANVAS_TEST_SLOT]) || [];
225
+ var _a, _b;
226
+ const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
227
+ if (!isTestDefined && process.env.NODE_ENV !== "production") {
228
+ console.warn(`Test "${test}" is not defined in Uniform manifest.`);
229
+ return {
230
+ index: null,
231
+ event: null
232
+ };
233
+ }
234
+ const slot = ((_b = component.slots) == null ? void 0 : _b[import_canvas2.CANVAS_TEST_SLOT]) || [];
227
235
  const componentVariations = slot.map((v, i) => {
228
- var _a2, _b, _c;
229
- const contextTag = (_b = (_a2 = v.parameters) == null ? void 0 : _a2[import_canvas2.CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b.value;
236
+ var _a2, _b2, _c;
237
+ const contextTag = (_b2 = (_a2 = v.parameters) == null ? void 0 : _a2[import_canvas2.CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b2.value;
230
238
  const id = (_c = contextTag == null ? void 0 : contextTag.id) != null ? _c : "testId" in v ? v.testId : `ab-${i}-${v.type}`;
231
239
  return {
232
240
  id,
package/dist/index.mjs CHANGED
@@ -192,11 +192,19 @@ var runTest = ({
192
192
  component,
193
193
  contextInstance
194
194
  }) => {
195
- var _a;
196
- const slot = ((_a = component.slots) == null ? void 0 : _a[CANVAS_TEST_SLOT]) || [];
195
+ var _a, _b;
196
+ const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
197
+ if (!isTestDefined && process.env.NODE_ENV !== "production") {
198
+ console.warn(`Test "${test}" is not defined in Uniform manifest.`);
199
+ return {
200
+ index: null,
201
+ event: null
202
+ };
203
+ }
204
+ const slot = ((_b = component.slots) == null ? void 0 : _b[CANVAS_TEST_SLOT]) || [];
197
205
  const componentVariations = slot.map((v, i) => {
198
- var _a2, _b, _c;
199
- const contextTag = (_b = (_a2 = v.parameters) == null ? void 0 : _a2[CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b.value;
206
+ var _a2, _b2, _c;
207
+ const contextTag = (_b2 = (_a2 = v.parameters) == null ? void 0 : _a2[CANVAS_TEST_VARIANT_PARAM]) == null ? void 0 : _b2.value;
200
208
  const id = (_c = contextTag == null ? void 0 : contextTag.id) != null ? _c : "testId" in v ? v.testId : `ab-${i}-${v.type}`;
201
209
  return {
202
210
  id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc-shared",
3
- "version": "19.158.0",
3
+ "version": "19.159.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -32,8 +32,8 @@
32
32
  "react-dom": "18.2.0"
33
33
  },
34
34
  "dependencies": {
35
- "@uniformdev/canvas": "19.158.0",
36
- "@uniformdev/context": "19.158.0"
35
+ "@uniformdev/canvas": "19.159.0",
36
+ "@uniformdev/context": "19.159.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=16.14.0"
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "f0be15ed3518c8d3d02e320d9b9a2f5175d30d1b"
49
+ "gitHead": "49ed8744113d885f24c96d819a6e1dd1896b6ce0"
50
50
  }