@uniformdev/canvas-next-rsc 20.8.1 → 20.8.2-alpha.21
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.esm.js +24 -11
- package/dist/index.js +28 -15
- package/dist/index.mjs +24 -11
- package/package.json +13 -12
package/dist/index.esm.js
CHANGED
|
@@ -529,10 +529,17 @@ var retrieveRoute = async ({ params, searchParams: providedSearchParams, skipPre
|
|
|
529
529
|
let result;
|
|
530
530
|
for (let i = 0; i < states.length; i++) {
|
|
531
531
|
const state = states[i];
|
|
532
|
-
const
|
|
532
|
+
const releaseIdFromSearchParams = determineReleaseId({
|
|
533
533
|
searchParams,
|
|
534
534
|
state
|
|
535
535
|
});
|
|
536
|
+
const releaseIdFromFetchOptions = fetchOptions == null ? void 0 : fetchOptions.releaseId;
|
|
537
|
+
if (releaseIdFromSearchParams && releaseIdFromFetchOptions && releaseIdFromSearchParams !== releaseIdFromFetchOptions) {
|
|
538
|
+
console.warn(
|
|
539
|
+
"retrieveRoute: releaseId provided in both searchParams and fetchOptions, using fetchOptions"
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
const releaseId = releaseIdFromFetchOptions != null ? releaseIdFromFetchOptions : releaseIdFromSearchParams;
|
|
536
543
|
try {
|
|
537
544
|
result = await retrieveRouteByPath({
|
|
538
545
|
path: value,
|
|
@@ -631,19 +638,24 @@ var ContextUpdateTrigger = ({ path }) => {
|
|
|
631
638
|
|
|
632
639
|
// src/components/PersonalizeClientWrapper.tsx
|
|
633
640
|
import { PersonalizeClient } from "@uniformdev/canvas-next-rsc-client";
|
|
634
|
-
import { runPersonalization } from "@uniformdev/canvas-next-rsc-shared";
|
|
635
641
|
import React3 from "react";
|
|
636
642
|
var PersonalizeClientWrapper = (props) => {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
643
|
+
return /* @__PURE__ */ React3.createElement(
|
|
644
|
+
PersonalizeClient,
|
|
645
|
+
{
|
|
646
|
+
component: props.component,
|
|
647
|
+
count: props.count,
|
|
648
|
+
slots: props.slots,
|
|
649
|
+
trackingEventName: props.trackingEventName,
|
|
650
|
+
algorithm: props.algorithm,
|
|
651
|
+
indexes: []
|
|
652
|
+
}
|
|
653
|
+
);
|
|
642
654
|
};
|
|
643
655
|
|
|
644
656
|
// src/components/PersonalizeServer.ts
|
|
645
657
|
import { CANVAS_PERSONALIZE_SLOT } from "@uniformdev/canvas";
|
|
646
|
-
import { runPersonalization
|
|
658
|
+
import { runPersonalization } from "@uniformdev/canvas-next-rsc-shared";
|
|
647
659
|
import { unstable_noStore as noStore } from "next/cache";
|
|
648
660
|
import { createElement, Fragment } from "react";
|
|
649
661
|
|
|
@@ -660,7 +672,7 @@ var PersonalizeServer = (props) => {
|
|
|
660
672
|
if ((_a = getServerConfig().ppr) == null ? void 0 : _a.personalizationSuspense) {
|
|
661
673
|
noStore();
|
|
662
674
|
}
|
|
663
|
-
const { indexes, event } =
|
|
675
|
+
const { indexes, event } = runPersonalization(props);
|
|
664
676
|
const slot = (_b = props.slots) == null ? void 0 : _b[CANVAS_PERSONALIZE_SLOT];
|
|
665
677
|
const components = indexes.map((index) => {
|
|
666
678
|
const component = slot.items[index];
|
|
@@ -675,10 +687,10 @@ var PersonalizeServer = (props) => {
|
|
|
675
687
|
|
|
676
688
|
// src/components/PersonalizeServerHybrid.tsx
|
|
677
689
|
import { PersonalizeClient as PersonalizeClient2 } from "@uniformdev/canvas-next-rsc-client";
|
|
678
|
-
import { runPersonalization as
|
|
690
|
+
import { runPersonalization as runPersonalization2 } from "@uniformdev/canvas-next-rsc-shared";
|
|
679
691
|
import React5 from "react";
|
|
680
692
|
var PersonalizeServerHybrid = (props) => {
|
|
681
|
-
const { indexes } =
|
|
693
|
+
const { indexes } = runPersonalization2(props);
|
|
682
694
|
return /* @__PURE__ */ React5.createElement(
|
|
683
695
|
PersonalizeClient2,
|
|
684
696
|
{
|
|
@@ -686,6 +698,7 @@ var PersonalizeServerHybrid = (props) => {
|
|
|
686
698
|
count: props.count,
|
|
687
699
|
slots: props.slots,
|
|
688
700
|
trackingEventName: props.trackingEventName,
|
|
701
|
+
algorithm: props.algorithm,
|
|
689
702
|
indexes
|
|
690
703
|
}
|
|
691
704
|
);
|
package/dist/index.js
CHANGED
|
@@ -457,7 +457,7 @@ async function generateStaticParams() {
|
|
|
457
457
|
// src/components/UniformComposition.ts
|
|
458
458
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
459
459
|
var import_canvas_next_rsc_client8 = require("@uniformdev/canvas-next-rsc-client");
|
|
460
|
-
var
|
|
460
|
+
var import_canvas_next_rsc_shared6 = require("@uniformdev/canvas-next-rsc-shared");
|
|
461
461
|
var import_core = require("@uniformdev/canvas-react/core");
|
|
462
462
|
var import_headers3 = require("next/headers");
|
|
463
463
|
var import_navigation = require("next/navigation");
|
|
@@ -557,10 +557,17 @@ var retrieveRoute = async ({ params, searchParams: providedSearchParams, skipPre
|
|
|
557
557
|
let result;
|
|
558
558
|
for (let i = 0; i < states.length; i++) {
|
|
559
559
|
const state = states[i];
|
|
560
|
-
const
|
|
560
|
+
const releaseIdFromSearchParams = determineReleaseId({
|
|
561
561
|
searchParams,
|
|
562
562
|
state
|
|
563
563
|
});
|
|
564
|
+
const releaseIdFromFetchOptions = fetchOptions == null ? void 0 : fetchOptions.releaseId;
|
|
565
|
+
if (releaseIdFromSearchParams && releaseIdFromFetchOptions && releaseIdFromSearchParams !== releaseIdFromFetchOptions) {
|
|
566
|
+
console.warn(
|
|
567
|
+
"retrieveRoute: releaseId provided in both searchParams and fetchOptions, using fetchOptions"
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
const releaseId = releaseIdFromFetchOptions != null ? releaseIdFromFetchOptions : releaseIdFromSearchParams;
|
|
564
571
|
try {
|
|
565
572
|
result = await retrieveRouteByPath({
|
|
566
573
|
path: value,
|
|
@@ -659,19 +666,24 @@ var ContextUpdateTrigger = ({ path }) => {
|
|
|
659
666
|
|
|
660
667
|
// src/components/PersonalizeClientWrapper.tsx
|
|
661
668
|
var import_canvas_next_rsc_client3 = require("@uniformdev/canvas-next-rsc-client");
|
|
662
|
-
var import_canvas_next_rsc_shared3 = require("@uniformdev/canvas-next-rsc-shared");
|
|
663
669
|
var import_react3 = __toESM(require("react"));
|
|
664
670
|
var PersonalizeClientWrapper = (props) => {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
671
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
672
|
+
import_canvas_next_rsc_client3.PersonalizeClient,
|
|
673
|
+
{
|
|
674
|
+
component: props.component,
|
|
675
|
+
count: props.count,
|
|
676
|
+
slots: props.slots,
|
|
677
|
+
trackingEventName: props.trackingEventName,
|
|
678
|
+
algorithm: props.algorithm,
|
|
679
|
+
indexes: []
|
|
680
|
+
}
|
|
681
|
+
);
|
|
670
682
|
};
|
|
671
683
|
|
|
672
684
|
// src/components/PersonalizeServer.ts
|
|
673
685
|
var import_canvas5 = require("@uniformdev/canvas");
|
|
674
|
-
var
|
|
686
|
+
var import_canvas_next_rsc_shared3 = require("@uniformdev/canvas-next-rsc-shared");
|
|
675
687
|
var import_cache = require("next/cache");
|
|
676
688
|
var import_react5 = require("react");
|
|
677
689
|
|
|
@@ -688,7 +700,7 @@ var PersonalizeServer = (props) => {
|
|
|
688
700
|
if ((_a = getServerConfig().ppr) == null ? void 0 : _a.personalizationSuspense) {
|
|
689
701
|
(0, import_cache.unstable_noStore)();
|
|
690
702
|
}
|
|
691
|
-
const { indexes, event } = (0,
|
|
703
|
+
const { indexes, event } = (0, import_canvas_next_rsc_shared3.runPersonalization)(props);
|
|
692
704
|
const slot = (_b = props.slots) == null ? void 0 : _b[import_canvas5.CANVAS_PERSONALIZE_SLOT];
|
|
693
705
|
const components = indexes.map((index) => {
|
|
694
706
|
const component = slot.items[index];
|
|
@@ -703,10 +715,10 @@ var PersonalizeServer = (props) => {
|
|
|
703
715
|
|
|
704
716
|
// src/components/PersonalizeServerHybrid.tsx
|
|
705
717
|
var import_canvas_next_rsc_client5 = require("@uniformdev/canvas-next-rsc-client");
|
|
706
|
-
var
|
|
718
|
+
var import_canvas_next_rsc_shared4 = require("@uniformdev/canvas-next-rsc-shared");
|
|
707
719
|
var import_react6 = __toESM(require("react"));
|
|
708
720
|
var PersonalizeServerHybrid = (props) => {
|
|
709
|
-
const { indexes } = (0,
|
|
721
|
+
const { indexes } = (0, import_canvas_next_rsc_shared4.runPersonalization)(props);
|
|
710
722
|
return /* @__PURE__ */ import_react6.default.createElement(
|
|
711
723
|
import_canvas_next_rsc_client5.PersonalizeClient,
|
|
712
724
|
{
|
|
@@ -714,6 +726,7 @@ var PersonalizeServerHybrid = (props) => {
|
|
|
714
726
|
count: props.count,
|
|
715
727
|
slots: props.slots,
|
|
716
728
|
trackingEventName: props.trackingEventName,
|
|
729
|
+
algorithm: props.algorithm,
|
|
717
730
|
indexes
|
|
718
731
|
}
|
|
719
732
|
);
|
|
@@ -721,7 +734,7 @@ var PersonalizeServerHybrid = (props) => {
|
|
|
721
734
|
|
|
722
735
|
// src/components/TestServer.ts
|
|
723
736
|
var import_canvas6 = require("@uniformdev/canvas");
|
|
724
|
-
var
|
|
737
|
+
var import_canvas_next_rsc_shared5 = require("@uniformdev/canvas-next-rsc-shared");
|
|
725
738
|
var import_cache2 = require("next/cache");
|
|
726
739
|
var import_react8 = require("react");
|
|
727
740
|
|
|
@@ -738,7 +751,7 @@ var TestServer = async (props) => {
|
|
|
738
751
|
if ((_a = getServerConfig().ppr) == null ? void 0 : _a.testSuspense) {
|
|
739
752
|
(0, import_cache2.unstable_noStore)();
|
|
740
753
|
}
|
|
741
|
-
const { index, event } = (0,
|
|
754
|
+
const { index, event } = (0, import_canvas_next_rsc_shared5.runTest)(props);
|
|
742
755
|
if (index === null || event === null) {
|
|
743
756
|
return null;
|
|
744
757
|
}
|
|
@@ -785,7 +798,7 @@ var UniformComposition = async ({
|
|
|
785
798
|
});
|
|
786
799
|
}
|
|
787
800
|
const awaitedParams = await props.params;
|
|
788
|
-
const { value: path } = (0,
|
|
801
|
+
const { value: path } = (0, import_canvas_next_rsc_shared6.resolvePath)({
|
|
789
802
|
params: awaitedParams
|
|
790
803
|
});
|
|
791
804
|
if (!route || route.type === "notFound") {
|
package/dist/index.mjs
CHANGED
|
@@ -529,10 +529,17 @@ var retrieveRoute = async ({ params, searchParams: providedSearchParams, skipPre
|
|
|
529
529
|
let result;
|
|
530
530
|
for (let i = 0; i < states.length; i++) {
|
|
531
531
|
const state = states[i];
|
|
532
|
-
const
|
|
532
|
+
const releaseIdFromSearchParams = determineReleaseId({
|
|
533
533
|
searchParams,
|
|
534
534
|
state
|
|
535
535
|
});
|
|
536
|
+
const releaseIdFromFetchOptions = fetchOptions == null ? void 0 : fetchOptions.releaseId;
|
|
537
|
+
if (releaseIdFromSearchParams && releaseIdFromFetchOptions && releaseIdFromSearchParams !== releaseIdFromFetchOptions) {
|
|
538
|
+
console.warn(
|
|
539
|
+
"retrieveRoute: releaseId provided in both searchParams and fetchOptions, using fetchOptions"
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
const releaseId = releaseIdFromFetchOptions != null ? releaseIdFromFetchOptions : releaseIdFromSearchParams;
|
|
536
543
|
try {
|
|
537
544
|
result = await retrieveRouteByPath({
|
|
538
545
|
path: value,
|
|
@@ -631,19 +638,24 @@ var ContextUpdateTrigger = ({ path }) => {
|
|
|
631
638
|
|
|
632
639
|
// src/components/PersonalizeClientWrapper.tsx
|
|
633
640
|
import { PersonalizeClient } from "@uniformdev/canvas-next-rsc-client";
|
|
634
|
-
import { runPersonalization } from "@uniformdev/canvas-next-rsc-shared";
|
|
635
641
|
import React3 from "react";
|
|
636
642
|
var PersonalizeClientWrapper = (props) => {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
643
|
+
return /* @__PURE__ */ React3.createElement(
|
|
644
|
+
PersonalizeClient,
|
|
645
|
+
{
|
|
646
|
+
component: props.component,
|
|
647
|
+
count: props.count,
|
|
648
|
+
slots: props.slots,
|
|
649
|
+
trackingEventName: props.trackingEventName,
|
|
650
|
+
algorithm: props.algorithm,
|
|
651
|
+
indexes: []
|
|
652
|
+
}
|
|
653
|
+
);
|
|
642
654
|
};
|
|
643
655
|
|
|
644
656
|
// src/components/PersonalizeServer.ts
|
|
645
657
|
import { CANVAS_PERSONALIZE_SLOT } from "@uniformdev/canvas";
|
|
646
|
-
import { runPersonalization
|
|
658
|
+
import { runPersonalization } from "@uniformdev/canvas-next-rsc-shared";
|
|
647
659
|
import { unstable_noStore as noStore } from "next/cache";
|
|
648
660
|
import { createElement, Fragment } from "react";
|
|
649
661
|
|
|
@@ -660,7 +672,7 @@ var PersonalizeServer = (props) => {
|
|
|
660
672
|
if ((_a = getServerConfig().ppr) == null ? void 0 : _a.personalizationSuspense) {
|
|
661
673
|
noStore();
|
|
662
674
|
}
|
|
663
|
-
const { indexes, event } =
|
|
675
|
+
const { indexes, event } = runPersonalization(props);
|
|
664
676
|
const slot = (_b = props.slots) == null ? void 0 : _b[CANVAS_PERSONALIZE_SLOT];
|
|
665
677
|
const components = indexes.map((index) => {
|
|
666
678
|
const component = slot.items[index];
|
|
@@ -675,10 +687,10 @@ var PersonalizeServer = (props) => {
|
|
|
675
687
|
|
|
676
688
|
// src/components/PersonalizeServerHybrid.tsx
|
|
677
689
|
import { PersonalizeClient as PersonalizeClient2 } from "@uniformdev/canvas-next-rsc-client";
|
|
678
|
-
import { runPersonalization as
|
|
690
|
+
import { runPersonalization as runPersonalization2 } from "@uniformdev/canvas-next-rsc-shared";
|
|
679
691
|
import React5 from "react";
|
|
680
692
|
var PersonalizeServerHybrid = (props) => {
|
|
681
|
-
const { indexes } =
|
|
693
|
+
const { indexes } = runPersonalization2(props);
|
|
682
694
|
return /* @__PURE__ */ React5.createElement(
|
|
683
695
|
PersonalizeClient2,
|
|
684
696
|
{
|
|
@@ -686,6 +698,7 @@ var PersonalizeServerHybrid = (props) => {
|
|
|
686
698
|
count: props.count,
|
|
687
699
|
slots: props.slots,
|
|
688
700
|
trackingEventName: props.trackingEventName,
|
|
701
|
+
algorithm: props.algorithm,
|
|
689
702
|
indexes
|
|
690
703
|
}
|
|
691
704
|
);
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc",
|
|
3
|
-
"version": "20.8.
|
|
3
|
+
"version": "20.8.2-alpha.21+42bfa4ce42",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
7
7
|
"dev": "tsup --watch",
|
|
8
8
|
"lint": "eslint \"src/**/*.{ts,tsx}\" --fix",
|
|
9
|
-
"test": "jest --maxWorkers=1 --passWithNoTests"
|
|
9
|
+
"test": "jest --maxWorkers=1 --passWithNoTests",
|
|
10
|
+
"document": "api-extractor run --local"
|
|
10
11
|
},
|
|
11
12
|
"sideEffects": false,
|
|
12
13
|
"main": "dist/index.js",
|
|
@@ -61,15 +62,15 @@
|
|
|
61
62
|
"react-dom": "18.3.1"
|
|
62
63
|
},
|
|
63
64
|
"dependencies": {
|
|
64
|
-
"@uniformdev/canvas": "20.8.
|
|
65
|
-
"@uniformdev/canvas-next-rsc-client": "^20.8.
|
|
66
|
-
"@uniformdev/canvas-next-rsc-shared": "^20.8.
|
|
67
|
-
"@uniformdev/canvas-react": "20.8.
|
|
68
|
-
"@uniformdev/context": "20.8.
|
|
69
|
-
"@uniformdev/project-map": "20.8.
|
|
70
|
-
"@uniformdev/redirect": "20.8.
|
|
71
|
-
"@uniformdev/richtext": "20.8.
|
|
72
|
-
"@uniformdev/webhooks": "20.8.
|
|
65
|
+
"@uniformdev/canvas": "20.8.2-alpha.21+42bfa4ce42",
|
|
66
|
+
"@uniformdev/canvas-next-rsc-client": "^20.8.2-alpha.21+42bfa4ce42",
|
|
67
|
+
"@uniformdev/canvas-next-rsc-shared": "^20.8.2-alpha.21+42bfa4ce42",
|
|
68
|
+
"@uniformdev/canvas-react": "20.8.2-alpha.21+42bfa4ce42",
|
|
69
|
+
"@uniformdev/context": "20.8.2-alpha.21+42bfa4ce42",
|
|
70
|
+
"@uniformdev/project-map": "20.8.2-alpha.21+42bfa4ce42",
|
|
71
|
+
"@uniformdev/redirect": "20.8.2-alpha.21+42bfa4ce42",
|
|
72
|
+
"@uniformdev/richtext": "20.8.2-alpha.21+42bfa4ce42",
|
|
73
|
+
"@uniformdev/webhooks": "20.8.2-alpha.21+42bfa4ce42",
|
|
73
74
|
"@vercel/edge-config": "^0.4.0",
|
|
74
75
|
"encoding": "^0.1.13",
|
|
75
76
|
"server-only": "^0.0.1",
|
|
@@ -86,5 +87,5 @@
|
|
|
86
87
|
"publishConfig": {
|
|
87
88
|
"access": "public"
|
|
88
89
|
},
|
|
89
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "42bfa4ce42d4efdd35192096f1d4c23577e6cf2b"
|
|
90
91
|
}
|