@splithub/next 0.1.8 → 0.1.9
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/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/package.json +3 -3
package/dist/client.cjs
CHANGED
|
@@ -39,7 +39,7 @@ var import_react2 = require("react");
|
|
|
39
39
|
var import_react3 = require("@splithub/react");
|
|
40
40
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
41
|
function SplitHubNextProvider({ remoteOverrides, remote, ...props }) {
|
|
42
|
-
const remoteOptions =
|
|
42
|
+
const remoteOptions = { waitMs: 0, ...remote ?? {}, ...remoteOverrides !== void 0 ? { overrides: remoteOverrides } : {} };
|
|
43
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.SplitHubProvider, { ...props, remote: remoteOptions });
|
|
44
44
|
}
|
|
45
45
|
function Exposure({ id }) {
|
package/dist/client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.tsx"],"sourcesContent":["'use client';\n\nimport type { RemoteOverrides } from '@splithub/core';\nimport { SplitHubProvider, useSplitHub, type SplitHubProviderProps } from '@splithub/react';\nimport { useEffect } from 'react';\n\nexport { SplitHubProvider, useSplitHub, Experiment, Variant, useVariant, useValue, useTrack, usePageview } from '@splithub/react';\n\nexport interface SplitHubNextProviderProps extends SplitHubProviderProps {\n /** Overrides the server applied (`(await getSplitHub(config)).overrides`), so client and server agree. */\n remoteOverrides?: RemoteOverrides | null;\n}\n\n/**\n * Same as SplitHubProvider; pass `visitorId` from the server layout so SSR\n * and hydration agree:\n *\n * ```tsx\n * // app/layout.tsx (server component)\n * const sh = await getSplitHub(config);\n * <SplitHubNextProvider config={config} visitorId={sh.visitorId ?? undefined} remoteOverrides={sh.overrides}>{children}</SplitHubNextProvider>\n * ```\n */\nexport function SplitHubNextProvider({ remoteOverrides, remote, ...props }: SplitHubNextProviderProps) {\n const remoteOptions =
|
|
1
|
+
{"version":3,"sources":["../src/client.tsx"],"sourcesContent":["'use client';\n\nimport type { RemoteOverrides } from '@splithub/core';\nimport { SplitHubProvider, useSplitHub, type SplitHubProviderProps } from '@splithub/react';\nimport { useEffect } from 'react';\n\nexport { SplitHubProvider, useSplitHub, Experiment, Variant, useVariant, useValue, useTrack, usePageview } from '@splithub/react';\n\nexport interface SplitHubNextProviderProps extends SplitHubProviderProps {\n /** Overrides the server applied (`(await getSplitHub(config)).overrides`), so client and server agree. */\n remoteOverrides?: RemoteOverrides | null;\n}\n\n/**\n * Same as SplitHubProvider; pass `visitorId` from the server layout so SSR\n * and hydration agree:\n *\n * ```tsx\n * // app/layout.tsx (server component)\n * const sh = await getSplitHub(config);\n * <SplitHubNextProvider config={config} visitorId={sh.visitorId ?? undefined} remoteOverrides={sh.overrides}>{children}</SplitHubNextProvider>\n * ```\n */\nexport function SplitHubNextProvider({ remoteOverrides, remote, ...props }: SplitHubNextProviderProps) {\n // The HTML is already decided on the server: never wait for overrides here, or the\n // first client render (control) would disagree with it.\n const remoteOptions = { waitMs: 0, ...(remote ?? {}), ...(remoteOverrides !== undefined ? { overrides: remoteOverrides } : {}) };\n return <SplitHubProvider {...props} remote={remoteOptions} />;\n}\n\n/** Records an exposure for an experiment rendered by a Server Component. */\nexport function Exposure({ id }: { id: string }) {\n const client = useSplitHub();\n useEffect(() => {\n client.exposure(id);\n }, [client, id]);\n return null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAA0E;AAC1E,IAAAA,gBAA0B;AAE1B,IAAAA,gBAAgH;AAqBvG;AAJF,SAAS,qBAAqB,EAAE,iBAAiB,QAAQ,GAAG,MAAM,GAA8B;AAGrG,QAAM,gBAAgB,EAAE,QAAQ,GAAG,GAAI,UAAU,CAAC,GAAI,GAAI,oBAAoB,SAAY,EAAE,WAAW,gBAAgB,IAAI,CAAC,EAAG;AAC/H,SAAO,4CAAC,iCAAkB,GAAG,OAAO,QAAQ,eAAe;AAC7D;AAGO,SAAS,SAAS,EAAE,GAAG,GAAmB;AAC/C,QAAM,aAAS,0BAAY;AAC3B,+BAAU,MAAM;AACd,WAAO,SAAS,EAAE;AAAA,EACpB,GAAG,CAAC,QAAQ,EAAE,CAAC;AACf,SAAO;AACT;","names":["import_react"]}
|
package/dist/client.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useEffect } from "react";
|
|
|
7
7
|
import { SplitHubProvider as SplitHubProvider2, useSplitHub as useSplitHub2, Experiment, Variant, useVariant, useValue, useTrack, usePageview } from "@splithub/react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
function SplitHubNextProvider({ remoteOverrides, remote, ...props }) {
|
|
10
|
-
const remoteOptions =
|
|
10
|
+
const remoteOptions = { waitMs: 0, ...remote ?? {}, ...remoteOverrides !== void 0 ? { overrides: remoteOverrides } : {} };
|
|
11
11
|
return /* @__PURE__ */ jsx(SplitHubProvider, { ...props, remote: remoteOptions });
|
|
12
12
|
}
|
|
13
13
|
function Exposure({ id }) {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.tsx"],"sourcesContent":["'use client';\n\nimport type { RemoteOverrides } from '@splithub/core';\nimport { SplitHubProvider, useSplitHub, type SplitHubProviderProps } from '@splithub/react';\nimport { useEffect } from 'react';\n\nexport { SplitHubProvider, useSplitHub, Experiment, Variant, useVariant, useValue, useTrack, usePageview } from '@splithub/react';\n\nexport interface SplitHubNextProviderProps extends SplitHubProviderProps {\n /** Overrides the server applied (`(await getSplitHub(config)).overrides`), so client and server agree. */\n remoteOverrides?: RemoteOverrides | null;\n}\n\n/**\n * Same as SplitHubProvider; pass `visitorId` from the server layout so SSR\n * and hydration agree:\n *\n * ```tsx\n * // app/layout.tsx (server component)\n * const sh = await getSplitHub(config);\n * <SplitHubNextProvider config={config} visitorId={sh.visitorId ?? undefined} remoteOverrides={sh.overrides}>{children}</SplitHubNextProvider>\n * ```\n */\nexport function SplitHubNextProvider({ remoteOverrides, remote, ...props }: SplitHubNextProviderProps) {\n const remoteOptions =
|
|
1
|
+
{"version":3,"sources":["../src/client.tsx"],"sourcesContent":["'use client';\n\nimport type { RemoteOverrides } from '@splithub/core';\nimport { SplitHubProvider, useSplitHub, type SplitHubProviderProps } from '@splithub/react';\nimport { useEffect } from 'react';\n\nexport { SplitHubProvider, useSplitHub, Experiment, Variant, useVariant, useValue, useTrack, usePageview } from '@splithub/react';\n\nexport interface SplitHubNextProviderProps extends SplitHubProviderProps {\n /** Overrides the server applied (`(await getSplitHub(config)).overrides`), so client and server agree. */\n remoteOverrides?: RemoteOverrides | null;\n}\n\n/**\n * Same as SplitHubProvider; pass `visitorId` from the server layout so SSR\n * and hydration agree:\n *\n * ```tsx\n * // app/layout.tsx (server component)\n * const sh = await getSplitHub(config);\n * <SplitHubNextProvider config={config} visitorId={sh.visitorId ?? undefined} remoteOverrides={sh.overrides}>{children}</SplitHubNextProvider>\n * ```\n */\nexport function SplitHubNextProvider({ remoteOverrides, remote, ...props }: SplitHubNextProviderProps) {\n // The HTML is already decided on the server: never wait for overrides here, or the\n // first client render (control) would disagree with it.\n const remoteOptions = { waitMs: 0, ...(remote ?? {}), ...(remoteOverrides !== undefined ? { overrides: remoteOverrides } : {}) };\n return <SplitHubProvider {...props} remote={remoteOptions} />;\n}\n\n/** Records an exposure for an experiment rendered by a Server Component. */\nexport function Exposure({ id }: { id: string }) {\n const client = useSplitHub();\n useEffect(() => {\n client.exposure(id);\n }, [client, id]);\n return null;\n}\n"],"mappings":";;;;AAGA,SAAS,kBAAkB,mBAA+C;AAC1E,SAAS,iBAAiB;AAE1B,SAAS,oBAAAA,mBAAkB,eAAAC,cAAa,YAAY,SAAS,YAAY,UAAU,UAAU,mBAAmB;AAqBvG;AAJF,SAAS,qBAAqB,EAAE,iBAAiB,QAAQ,GAAG,MAAM,GAA8B;AAGrG,QAAM,gBAAgB,EAAE,QAAQ,GAAG,GAAI,UAAU,CAAC,GAAI,GAAI,oBAAoB,SAAY,EAAE,WAAW,gBAAgB,IAAI,CAAC,EAAG;AAC/H,SAAO,oBAAC,oBAAkB,GAAG,OAAO,QAAQ,eAAe;AAC7D;AAGO,SAAS,SAAS,EAAE,GAAG,GAAmB;AAC/C,QAAM,SAAS,YAAY;AAC3B,YAAU,MAAM;AACd,WAAO,SAAS,EAAE;AAAA,EACpB,GAAG,CAAC,QAAQ,EAAE,CAAC;AACf,SAAO;AACT;","names":["SplitHubProvider","useSplitHub"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splithub/next",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "SplitHub for Next.js: middleware, server components, redirect tests and the route for your own database.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"react": ">=18"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@splithub/core": "0.1.
|
|
38
|
-
"@splithub/react": "0.1.
|
|
37
|
+
"@splithub/core": "0.1.9",
|
|
38
|
+
"@splithub/react": "0.1.9"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/react": "^18.3.12",
|