Skip to content

Commit

Permalink
Merge pull request #375 from Weaverse/dev
Browse files Browse the repository at this point in the history
Fix `weaverseData` being cached when url search queries changes
  • Loading branch information
hta218 authored Aug 15, 2024
2 parents 1fea7ea + c681fdc commit 9a4b72e
Show file tree
Hide file tree
Showing 10 changed files with 1,084 additions and 9,763 deletions.
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/react@3.4.1

## 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/core@3.4.1

## 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/react@3.4.1

## 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

0 comments on commit 9a4b72e

Please sign in to comment.