@graphcommerce/magento-customer 4.11.5 → 4.11.7
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/CHANGELOG.md +17 -0
- package/hooks/useCustomerSession.ts +15 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.11.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`1f2e14ba8`](https://github.com/graphcommerce-org/graphcommerce/commit/1f2e14ba8b674b87257a123e8cb215157890eb22), [`fc32b9ab3`](https://github.com/graphcommerce-org/graphcommerce/commit/fc32b9ab3818eb99c546a89e7f42045a6fbfba81)]:
|
|
8
|
+
- @graphcommerce/react-hook-form@3.3.5
|
|
9
|
+
- @graphcommerce/ecommerce-ui@1.5.3
|
|
10
|
+
|
|
11
|
+
## 4.11.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`0c21c5c23`](https://github.com/graphcommerce-org/graphcommerce/commit/0c21c5c233ebab15f6629c234e3de1cc8c0452e1), [`de8925aa9`](https://github.com/graphcommerce-org/graphcommerce/commit/de8925aa910b191c62041530c68c697a58a1e52d), [`f5eae0afd`](https://github.com/graphcommerce-org/graphcommerce/commit/f5eae0afdbd474b1f81c450425ffadf2d025187a)]:
|
|
16
|
+
- @graphcommerce/next-ui@4.28.0
|
|
17
|
+
- @graphcommerce/ecommerce-ui@1.5.2
|
|
18
|
+
- @graphcommerce/magento-store@4.3.1
|
|
19
|
+
|
|
3
20
|
## 4.11.5
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -16,12 +16,24 @@ export type UseCustomerSessionReturn =
|
|
|
16
16
|
query: QueryResult<CustomerTokenQuery, CustomerTokenQueryVariables>
|
|
17
17
|
} & Partial<Omit<NonNullable<CustomerTokenQuery['customerToken']>, '__typename'>>
|
|
18
18
|
|
|
19
|
-
export function useCustomerSession(
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
export function useCustomerSession(options: UseCustomerSessionOptions = {}) {
|
|
20
|
+
/**
|
|
21
|
+
* We current always assume the initial render is during hydration.
|
|
22
|
+
*
|
|
23
|
+
* How can we determine we're not actually hydrating? Classically you could just use some global
|
|
24
|
+
* state to track this because when the initial render is done, we're not hydrating anymore.
|
|
25
|
+
*
|
|
26
|
+
* However, <Suspense/> can be used to defer the rendering to a later moment. This means that the
|
|
27
|
+
* useCustomerSession hook is called later and we're still in the hydration phase for this
|
|
28
|
+
* component while other components are rendering for the second time.
|
|
29
|
+
*/
|
|
22
30
|
const { hydration = false } = options
|
|
23
31
|
const [hydrating, setHydrating] = useState(!hydration)
|
|
24
32
|
|
|
33
|
+
/**
|
|
34
|
+
* After the initital render we are definitely sure we're not hydrating anymore so we can flip the
|
|
35
|
+
* switch and rerender.
|
|
36
|
+
*/
|
|
25
37
|
useIsomorphicLayoutEffect(() => startTransition(() => setHydrating(false)), [])
|
|
26
38
|
|
|
27
39
|
const skip = hydrating
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-customer",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.11.
|
|
5
|
+
"version": "4.11.7",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"type-fest": "^2.12.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphcommerce/ecommerce-ui": "1.5.
|
|
22
|
+
"@graphcommerce/ecommerce-ui": "1.5.3",
|
|
23
23
|
"@graphcommerce/framer-utils": "3.2.0",
|
|
24
24
|
"@graphcommerce/graphql": "3.4.8",
|
|
25
25
|
"@graphcommerce/graphql-mesh": "4.2.0",
|
|
26
26
|
"@graphcommerce/image": "3.1.9",
|
|
27
27
|
"@graphcommerce/magento-graphql": "3.1.8",
|
|
28
|
-
"@graphcommerce/magento-store": "4.3.
|
|
29
|
-
"@graphcommerce/next-ui": "4.
|
|
30
|
-
"@graphcommerce/react-hook-form": "3.3.
|
|
28
|
+
"@graphcommerce/magento-store": "4.3.1",
|
|
29
|
+
"@graphcommerce/next-ui": "4.28.0",
|
|
30
|
+
"@graphcommerce/react-hook-form": "3.3.5"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@lingui/react": "^3.13.2",
|