@shopify/hydrogen 2026.4.7 → 2026.4.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/development/index.cjs +57 -38
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +57 -38
- package/dist/development/index.js.map +1 -1
- package/dist/production/index.cjs +51 -51
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +55 -55
- package/dist/production/index.js.map +1 -1
- package/dist/vite/chunk-IHK6YKEW.js +80 -0
- package/dist/vite/dev-tooling-guard.d.ts +10 -0
- package/dist/vite/dev-tooling-guard.js +8 -0
- package/dist/vite/plugin.js +4 -0
- package/package.json +6 -6
|
@@ -8,6 +8,7 @@ var loadScript = require('@shopify/hydrogen-react/load-script');
|
|
|
8
8
|
var graphqlClient = require('@shopify/graphql-client');
|
|
9
9
|
var cookie = require('worktop/cookie');
|
|
10
10
|
var cspBuilder = require('content-security-policy-builder');
|
|
11
|
+
var isSafeRichTextUrl = require('@shopify/hydrogen-react/is-safe-rich-text-url');
|
|
11
12
|
|
|
12
13
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
13
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -490,7 +491,7 @@ function getPrivacyBanner() {
|
|
|
490
491
|
}
|
|
491
492
|
|
|
492
493
|
// package.json
|
|
493
|
-
var version = "2026.4.
|
|
494
|
+
var version = "2026.4.9";
|
|
494
495
|
|
|
495
496
|
// src/analytics-manager/ShopifyAnalytics.tsx
|
|
496
497
|
function getCustomerPrivacyRequired() {
|
|
@@ -1874,7 +1875,7 @@ function generateUUID() {
|
|
|
1874
1875
|
}
|
|
1875
1876
|
|
|
1876
1877
|
// src/version.ts
|
|
1877
|
-
var LIB_VERSION = "2026.4.
|
|
1878
|
+
var LIB_VERSION = "2026.4.9";
|
|
1878
1879
|
|
|
1879
1880
|
// src/utils/graphql.ts
|
|
1880
1881
|
function minifyQuery(string) {
|
|
@@ -3558,7 +3559,7 @@ function useOptimisticCart(cart) {
|
|
|
3558
3559
|
}
|
|
3559
3560
|
|
|
3560
3561
|
// src/changelogHandler.ts
|
|
3561
|
-
var DEFAULT_GITHUB_CHANGELOG_URL = "https://raw.githubusercontent.com/Shopify/hydrogen/
|
|
3562
|
+
var DEFAULT_GITHUB_CHANGELOG_URL = "https://raw.githubusercontent.com/Shopify/hydrogen/2026-04/docs/changelog.json";
|
|
3562
3563
|
async function changelogHandler({
|
|
3563
3564
|
request,
|
|
3564
3565
|
changelogUrl
|
|
@@ -3846,20 +3847,29 @@ function toHexString(byteArray) {
|
|
|
3846
3847
|
}
|
|
3847
3848
|
|
|
3848
3849
|
// src/utils/get-redirect-url.ts
|
|
3849
|
-
function
|
|
3850
|
+
function getRedirectPathFromSearchParams(requestUrl, origin) {
|
|
3850
3851
|
if (!requestUrl) return;
|
|
3851
|
-
const
|
|
3852
|
-
const
|
|
3853
|
-
const
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3852
|
+
const url = new URL(requestUrl);
|
|
3853
|
+
const param = url.searchParams.get("return_to") ? "return_to" : "redirect";
|
|
3854
|
+
const redirectTo = url.searchParams.get(param);
|
|
3855
|
+
if (!redirectTo) return;
|
|
3856
|
+
const redirectPath = getSameOriginPath(redirectTo, origin ?? url.origin);
|
|
3857
|
+
if (!redirectPath) {
|
|
3858
|
+
console.warn(
|
|
3859
|
+
`Ignoring ${param} because it isn't a same-origin path. Tried to redirect from ${url.pathname}${url.search} to ${redirectTo}`
|
|
3860
|
+
);
|
|
3861
|
+
}
|
|
3862
|
+
return redirectPath;
|
|
3863
|
+
}
|
|
3864
|
+
function getSameOriginPath(target, origin) {
|
|
3865
|
+
if (!target) return void 0;
|
|
3866
|
+
try {
|
|
3867
|
+
const url = target.startsWith("/") ? new URL(target, origin) : new URL(target);
|
|
3868
|
+
if (url.origin !== origin) return void 0;
|
|
3869
|
+
const path = `${url.pathname}${url.search}${url.hash}`;
|
|
3870
|
+
return path.startsWith("//") ? void 0 : path;
|
|
3871
|
+
} catch {
|
|
3872
|
+
return void 0;
|
|
3863
3873
|
}
|
|
3864
3874
|
}
|
|
3865
3875
|
function isLocalPath(requestUrl, redirectUrl) {
|
|
@@ -4200,7 +4210,11 @@ function createCustomerAccountClient({
|
|
|
4200
4210
|
codeVerifier: verifier,
|
|
4201
4211
|
state,
|
|
4202
4212
|
nonce,
|
|
4203
|
-
redirectPath:
|
|
4213
|
+
redirectPath: (
|
|
4214
|
+
// The same HTTPS origin the OAuth `redirect_uri` uses, so an http
|
|
4215
|
+
// `request.url` still matches the https pages customers browse.
|
|
4216
|
+
getRedirectPathFromSearchParams(request.url, httpsOrigin) || getSameOriginPath(getHeader(request, "Referer"), httpsOrigin) || defaultRedirectPath
|
|
4217
|
+
)
|
|
4204
4218
|
});
|
|
4205
4219
|
loginUrl.searchParams.append("code_challenge", challenge);
|
|
4206
4220
|
loginUrl.searchParams.append("code_challenge_method", "S256");
|
|
@@ -4355,7 +4369,9 @@ function createCustomerAccountClient({
|
|
|
4355
4369
|
refreshToken: refresh_token,
|
|
4356
4370
|
idToken: id_token
|
|
4357
4371
|
});
|
|
4358
|
-
return redirect(
|
|
4372
|
+
return redirect(
|
|
4373
|
+
getSameOriginPath(redirectPath, httpsOrigin) || defaultRedirectPath
|
|
4374
|
+
);
|
|
4359
4375
|
},
|
|
4360
4376
|
setBuyer,
|
|
4361
4377
|
getBuyer,
|
|
@@ -5256,16 +5272,19 @@ var RichText = function(props) {
|
|
|
5256
5272
|
{
|
|
5257
5273
|
...props,
|
|
5258
5274
|
components: {
|
|
5259
|
-
link: ({ node }) =>
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5275
|
+
link: ({ node }) => {
|
|
5276
|
+
if (!isSafeRichTextUrl.isSafeRichTextUrl(node.url)) return node.children;
|
|
5277
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5278
|
+
reactRouter.Link,
|
|
5279
|
+
{
|
|
5280
|
+
to: node.url,
|
|
5281
|
+
title: node.title,
|
|
5282
|
+
target: node.target,
|
|
5283
|
+
prefetch: "intent",
|
|
5284
|
+
children: node.children
|
|
5285
|
+
}
|
|
5286
|
+
);
|
|
5287
|
+
},
|
|
5269
5288
|
...props.components
|
|
5270
5289
|
}
|
|
5271
5290
|
}
|
|
@@ -5350,12 +5369,12 @@ var graphiqlLoader = async function graphiqlLoader2({
|
|
|
5350
5369
|
|
|
5351
5370
|
<link
|
|
5352
5371
|
rel="stylesheet"
|
|
5353
|
-
href="https://esm.sh/graphiql/dist/style.css"
|
|
5372
|
+
href="https://esm.sh/graphiql@5.4.0/dist/style.css"
|
|
5354
5373
|
/>
|
|
5355
5374
|
|
|
5356
5375
|
<link
|
|
5357
5376
|
rel="stylesheet"
|
|
5358
|
-
href="https://esm.sh/@graphiql/plugin-explorer/dist/style.css"
|
|
5377
|
+
href="https://esm.sh/@graphiql/plugin-explorer@5.1.5/dist/style.css"
|
|
5359
5378
|
/>
|
|
5360
5379
|
<script type="importmap">
|
|
5361
5380
|
{
|
|
@@ -5367,10 +5386,10 @@ var graphiqlLoader = async function graphiqlLoader2({
|
|
|
5367
5386
|
|
|
5368
5387
|
"graphql": "https://esm.sh/graphql@16.11.0",
|
|
5369
5388
|
|
|
5370
|
-
"graphiql": "https://esm.sh/graphiql?standalone&external=react,react-dom,@graphiql/react,graphql",
|
|
5371
|
-
"@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer?standalone&external=react,@graphiql/react,graphql",
|
|
5372
|
-
"@graphiql/react": "https://esm.sh/@graphiql/react?standalone&external=react,react-dom,graphql",
|
|
5373
|
-
"@graphiql/toolkit": "https://esm.sh/@graphiql/toolkit?standalone&external=graphql"
|
|
5389
|
+
"graphiql": "https://esm.sh/graphiql@5.4.0?standalone&external=react,react-dom,@graphiql/react,graphql",
|
|
5390
|
+
"@graphiql/plugin-explorer": "https://esm.sh/@graphiql/plugin-explorer@5.1.5?standalone&external=react,@graphiql/react,graphql",
|
|
5391
|
+
"@graphiql/react": "https://esm.sh/@graphiql/react@0.39.1?standalone&external=react,react-dom,graphql",
|
|
5392
|
+
"@graphiql/toolkit": "https://esm.sh/@graphiql/toolkit@0.12.1?standalone&external=graphql"
|
|
5374
5393
|
}
|
|
5375
5394
|
}
|
|
5376
5395
|
</script>
|
|
@@ -5385,9 +5404,9 @@ var graphiqlLoader = async function graphiqlLoader2({
|
|
|
5385
5404
|
import {explorerPlugin} from '@graphiql/plugin-explorer';
|
|
5386
5405
|
import {ToolbarButton} from '@graphiql/react';
|
|
5387
5406
|
|
|
5388
|
-
import createJSONWorker from 'https://esm.sh/monaco-editor/esm/vs/language/json/json.worker.js?worker';
|
|
5389
|
-
import createGraphQLWorker from 'https://esm.sh/monaco-graphql/esm/graphql.worker.js?worker';
|
|
5390
|
-
import createEditorWorker from 'https://esm.sh/monaco-editor/esm/vs/editor/editor.worker.js?worker';
|
|
5407
|
+
import createJSONWorker from 'https://esm.sh/monaco-editor@0.52.2/esm/vs/language/json/json.worker.js?worker';
|
|
5408
|
+
import createGraphQLWorker from 'https://esm.sh/monaco-graphql@1.9.0/esm/graphql.worker.js?worker';
|
|
5409
|
+
import createEditorWorker from 'https://esm.sh/monaco-editor@0.52.2/esm/vs/editor/editor.worker.js?worker';
|
|
5391
5410
|
import {parse, print} from 'graphql';
|
|
5392
5411
|
|
|
5393
5412
|
globalThis.MonacoEnvironment = {
|
|
@@ -5679,7 +5698,7 @@ async function storefrontRedirect(options) {
|
|
|
5679
5698
|
matchQueryParams
|
|
5680
5699
|
);
|
|
5681
5700
|
}
|
|
5682
|
-
const redirectTo =
|
|
5701
|
+
const redirectTo = getRedirectPathFromSearchParams(request.url);
|
|
5683
5702
|
if (redirectTo) {
|
|
5684
5703
|
return createRedirectResponse(
|
|
5685
5704
|
redirectTo,
|