Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix weaverseData being cached when url search queries changes #375

Merged
merged 3 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @weaverse/core

## 3.4.1

## 3.4.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weaverse/core",
"author": "Weaverse Team",
"description": "Weaverse Core",
"version": "3.4.0",
"version": "3.4.1",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
7 changes: 7 additions & 0 deletions packages/hydrogen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @weaverse/hydrogen

## 3.4.1

### Patch Changes

- Fix weaverseData being cached when url search query change
- @weaverse/[email protected]

## 3.4.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/hydrogen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weaverse/hydrogen",
"author": "Weaverse Team",
"description": "Components, hooks, and utilities for building Shopify Hydrogen websites with Weaverse",
"version": "3.4.0",
"version": "3.4.1",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -41,7 +41,7 @@
]
},
"dependencies": {
"@weaverse/react": "3.4.0",
"@weaverse/react": "3.4.1",
"react-error-boundary": "^4.0.13"
},
"peerDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion packages/hydrogen/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ function createCachedWeaverseInstance(
if (isBrowser) {
window.__weaverses = window.__weaverses || {}
let weaverse = window.__weaverses[params.pageId]
if (!weaverse) {
if (
!weaverse ||
weaverse?.requestInfo?.pathname !== params.requestInfo.pathname ||
weaverse?.requestInfo?.search !== params.requestInfo.search
) {
weaverse = new WeaverseHydrogen(params)
window.__weaverses[params.pageId] = weaverse
}
Expand Down
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @weaverse/react

## 3.4.1

### Patch Changes

- @weaverse/[email protected]

## 3.4.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weaverse/react",
"author": "Weaverse Team",
"description": "React bindings for Weaverse",
"version": "3.4.0",
"version": "3.4.1",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -39,7 +39,7 @@
"react-dom": ">=18"
},
"dependencies": {
"@weaverse/core": "3.4.0",
"@weaverse/core": "3.4.1",
"clsx": "^2.1.1"
}
}
6 changes: 6 additions & 0 deletions packages/shopify/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @weaverse/shopify

## 3.4.1

### Patch Changes

- @weaverse/[email protected]

## 3.4.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/shopify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@weaverse/shopify",
"author": "Weaverse Team",
"description": "Weaverse Components for Shopify Online Store 2.0 Section builder",
"version": "3.4.0",
"version": "3.4.1",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"@radix-ui/react-dialog": "^1.1.1",
"@stitches/react": "^1.2.8",
"@weaverse/react": "3.4.0",
"@weaverse/react": "3.4.1",
"keen-slider": "^6.8.6"
}
}
Loading
Loading