@graphcommerce/docs 9.1.0-canary.55 → 10.0.0-canary.56
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
CHANGED
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 10.0.0-canary.56
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#2546](https://github.com/graphcommerce-org/graphcommerce/pull/2546) [`ed9332a`](https://github.com/graphcommerce-org/graphcommerce/commit/ed9332a7f78966d932041d9a7725641edc92b28d) - ## GraphCommerce 10 - Turbopack Support
|
|
8
|
+
|
|
9
|
+
This major release brings full Turbopack compatibility, dramatically improving development speed.
|
|
10
|
+
|
|
11
|
+
### 🚀 Turbopack-Compatible Interceptor System
|
|
12
|
+
|
|
13
|
+
The entire plugin/interceptor system has been rewritten to work with Turbopack:
|
|
14
|
+
|
|
15
|
+
- **No more Webpack plugins** - Removed `InterceptorPlugin` webpack plugin entirely
|
|
16
|
+
- **File-based interception** - Original files are moved to `.original.tsx` and replaced with interceptor content
|
|
17
|
+
- **Direct imports** - Interceptors import from `.original` files instead of embedding source
|
|
18
|
+
- **New CLI commands**:
|
|
19
|
+
- `graphcommerce codegen-interceptors` - Generate interceptor files
|
|
20
|
+
- `graphcommerce cleanup-interceptors` - Reset interceptor system, restore original files
|
|
21
|
+
- **Stable file hashing** - Deterministic interceptor generation for better caching
|
|
22
|
+
|
|
23
|
+
### ⚙️ Treeshakable Configuration System
|
|
24
|
+
|
|
25
|
+
Replaced Webpack `DefinePlugin`-based `import.meta.graphCommerce` with a new generated configuration system:
|
|
26
|
+
|
|
27
|
+
- **New `codegen-config-values` command** - Generates TypeScript files with precise typing
|
|
28
|
+
- **Schema-driven** - Dynamically introspects Zod schemas to determine all available properties
|
|
29
|
+
- **Fully treeshakable** - Unused config values are eliminated from the bundle
|
|
30
|
+
- **Type-safe** - Uses `Get<GraphCommerceConfig, 'path'>` for nested property access
|
|
31
|
+
- **Separate files for nested objects** - Optimal treeshaking for complex configurations
|
|
32
|
+
|
|
33
|
+
### 🔧 withGraphCommerce Changes
|
|
34
|
+
|
|
35
|
+
- **Removed** `InterceptorPlugin` - No longer needed with file-based interception
|
|
36
|
+
- **Removed** `DefinePlugin` for `import.meta.graphCommerce` - Replaced with generated config
|
|
37
|
+
- **Removed** `@mui/*` alias rewrites - No longer required
|
|
38
|
+
- **Added** Turbopack loader rules for `.yaml`, `.yml`, and `.po` files
|
|
39
|
+
- **Added** `serverExternalPackages` for all `@whatwg-node/*` packages
|
|
40
|
+
- **Added** `optimizePackageImports` for better bundle optimization
|
|
41
|
+
- **Added** `images.qualities: [52, 75]` for Next.js image optimization
|
|
42
|
+
|
|
43
|
+
### 📦 Lingui Configuration
|
|
44
|
+
|
|
45
|
+
- **Renamed** `lingui.config.js` → `lingui.config.ts` with TypeScript support
|
|
46
|
+
- **Updated** `@graphcommerce/lingui-next/config` to TypeScript with proper exports
|
|
47
|
+
- **Simplified** formatter options
|
|
48
|
+
|
|
49
|
+
### ⚛️ React 19 & Next.js 16 Compatibility
|
|
50
|
+
|
|
51
|
+
- Updated `RefObject<T>` types for React 19 (now includes `null` by default)
|
|
52
|
+
- Replaced deprecated `React.VFC` with `React.FC`
|
|
53
|
+
- Fixed `useRef` calls to require explicit initial values
|
|
54
|
+
- Updated `MutableRefObject` usage in `framer-scroller`
|
|
55
|
+
|
|
56
|
+
### 📋 ESLint 9 Flat Config
|
|
57
|
+
|
|
58
|
+
- Migrated from legacy `.eslintrc` to new flat config format (`eslint.config.mjs`)
|
|
59
|
+
- Updated `@typescript-eslint/*` packages to v8
|
|
60
|
+
- Fixed AST selector for `SxProps` rule (`typeParameters` → `typeArguments`)
|
|
61
|
+
|
|
62
|
+
### 🔄 Apollo Client
|
|
63
|
+
|
|
64
|
+
- Fixed deprecated `name` option → `clientAwareness: { name: 'ssr' }`
|
|
65
|
+
- Updated error handling types to accept `ApolloError | null | undefined`
|
|
66
|
+
|
|
67
|
+
### ⚠️ Breaking Changes
|
|
68
|
+
|
|
69
|
+
- **Node.js 24.x not supported** - Restricted to `>=20 <24.0.0` due to [nodejs/undici#4290](https://github.com/nodejs/undici/issues/4290)
|
|
70
|
+
- **Interceptor files changed** - Original components now at `.original.tsx`
|
|
71
|
+
- **Config access changed** - Use generated config values instead of `import.meta.graphCommerce`
|
|
72
|
+
- **ESLint config format** - Must use flat config (`eslint.config.mjs`)
|
|
73
|
+
- **Lingui config** - Rename `lingui.config.js` to `lingui.config.ts`
|
|
74
|
+
|
|
75
|
+
### 🗑️ Removed
|
|
76
|
+
|
|
77
|
+
- `InterceptorPlugin` webpack plugin
|
|
78
|
+
- `configToImportMeta` utility
|
|
79
|
+
- Webpack `DefinePlugin` usage for config
|
|
80
|
+
- `@mui/*` modern alias rewrites
|
|
81
|
+
- Debug plugins (`CircularDependencyPlugin`, `DuplicatesPlugin`) ([@paales](https://github.com/paales))
|
|
82
|
+
|
|
3
83
|
## 9.1.0-canary.55
|
|
4
84
|
|
|
5
85
|
## 9.1.0-canary.54
|
package/framework/config.md
CHANGED
|
@@ -22,9 +22,9 @@ Configuration can be accessed in your project with the `import.meta.graphCommerc
|
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
24
|
import { storefrontAll, storefrontConfig, storefrontConfigDefault, useStorefrontConfig } from '@graphcommerce/next-ui'
|
|
25
|
-
|
|
25
|
+
import { cartDisplayPricesInclTax } from '@graphcommerce/next-config/config'
|
|
26
26
|
// Accessing a global value
|
|
27
|
-
const globalConf =
|
|
27
|
+
const globalConf = cartDisplayPricesInclTax
|
|
28
28
|
|
|
29
29
|
function MyComponent() {
|
|
30
30
|
// Configuration configured per storefront locale.
|
|
@@ -35,7 +35,7 @@ function MyComponent() {
|
|
|
35
35
|
|
|
36
36
|
// Or as single line
|
|
37
37
|
const scopedConfigWithFallback2 =
|
|
38
|
-
useStorefrontConfig().cartDisplayPricesInclTax ??
|
|
38
|
+
useStorefrontConfig().cartDisplayPricesInclTax ?? cartDisplayPricesInclTax
|
|
39
39
|
|
|
40
40
|
return <div>{googleRecaptchaKey}</div>
|
|
41
41
|
}
|
|
@@ -96,7 +96,7 @@ Examples:
|
|
|
96
96
|
|
|
97
97
|
#### hygraphEndpoint: string (required)
|
|
98
98
|
|
|
99
|
-
The
|
|
99
|
+
The Hygraph endpoint.
|
|
100
100
|
|
|
101
101
|
> Read-only endpoint that allows low latency and high read-throughput content delivery.
|
|
102
102
|
|
|
@@ -14,12 +14,15 @@ Example of /locales/es.po
|
|
|
14
14
|
|
|
15
15
|
...
|
|
16
16
|
|
|
17
|
+
|
|
17
18
|
msgid "Your cart is empty"
|
|
18
19
|
msgstr "Su carrito está vacío"
|
|
19
20
|
|
|
21
|
+
|
|
20
22
|
msgid "Your session is expired"
|
|
21
23
|
msgstr "Su sesión ha caducado"
|
|
22
24
|
|
|
25
|
+
|
|
23
26
|
msgid "canceled"
|
|
24
27
|
msgstr "cancelado"
|
|
25
28
|
```
|
|
@@ -31,7 +34,7 @@ component:
|
|
|
31
34
|
|
|
32
35
|
```tsx
|
|
33
36
|
<FullPageMessage
|
|
34
|
-
title={<Trans
|
|
37
|
+
title={<Trans>Your cart is empty</Trans>}
|
|
35
38
|
...
|
|
36
39
|
>
|
|
37
40
|
```
|
|
@@ -61,23 +64,21 @@ in the `<Trans>` component:
|
|
|
61
64
|
|
|
62
65
|
```tsx
|
|
63
66
|
<Typography variant='h3'>
|
|
64
|
-
<Trans
|
|
67
|
+
<Trans>Call us now</Trans>
|
|
65
68
|
</Typography>
|
|
66
69
|
```
|
|
67
70
|
|
|
68
71
|
To translate a string:
|
|
69
72
|
|
|
70
73
|
```tsx
|
|
71
|
-
<PageMeta title={
|
|
74
|
+
<PageMeta title={t`Blog`} />
|
|
72
75
|
```
|
|
73
76
|
|
|
74
|
-
_The `/* i18n */` comment is required for `lingui extract` to work properly_
|
|
75
|
-
|
|
76
77
|
Add Linqui to the component's imports:
|
|
77
78
|
|
|
78
79
|
```tsx
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
80
|
+
import { t } from '@lingui/core/macro'
|
|
81
|
+
import { Trans } from '@lingui/react/macro'
|
|
81
82
|
```
|
|
82
83
|
|
|
83
84
|
## Generating translation files with all translations
|
|
@@ -104,6 +105,7 @@ Edit the translations files to add your translation:
|
|
|
104
105
|
|
|
105
106
|
...
|
|
106
107
|
|
|
108
|
+
|
|
107
109
|
msgid "Call us now"
|
|
108
110
|
msgstr ""
|
|
109
111
|
```
|
|
@@ -126,9 +128,11 @@ The syntax in the translation files:
|
|
|
126
128
|
|
|
127
129
|
...
|
|
128
130
|
|
|
131
|
+
|
|
129
132
|
msgid "Cart"
|
|
130
133
|
msgstr "Cart"
|
|
131
134
|
|
|
135
|
+
|
|
132
136
|
msgid "Cart ({0})"
|
|
133
137
|
msgstr "Cart ({0})"
|
|
134
138
|
```
|
|
@@ -187,6 +191,7 @@ const config = {
|
|
|
187
191
|
```tsx
|
|
188
192
|
//Example from /locales/sv.po
|
|
189
193
|
|
|
194
|
+
|
|
190
195
|
msgid ""
|
|
191
196
|
msgstr ""
|
|
192
197
|
"POT-Creation-Date: 2022-03-30 14:45+0200\n"
|
|
@@ -196,12 +201,15 @@ msgstr ""
|
|
|
196
201
|
"X-Generator: @lingui/cli\n"
|
|
197
202
|
"Language: sv\n"
|
|
198
203
|
|
|
204
|
+
|
|
199
205
|
msgid "<0>{name}</0> has been added to your shopping cart!"
|
|
200
206
|
msgstr ""
|
|
201
207
|
|
|
208
|
+
|
|
202
209
|
msgid "Above <0/>"
|
|
203
210
|
msgstr ""
|
|
204
211
|
|
|
212
|
+
|
|
205
213
|
msgid "Account"
|
|
206
214
|
msgstr ""
|
|
207
215
|
|
package/getting-started/pages.md
CHANGED
|
@@ -318,7 +318,7 @@ export const getStaticPaths: GetPageStaticPaths = async ({ locales = [] }) => {
|
|
|
318
318
|
const { data } = await client.query({
|
|
319
319
|
query: PagesStaticPathsDocument,
|
|
320
320
|
variables: {
|
|
321
|
-
first:
|
|
321
|
+
first: limitSsg ? 1 : 1000,
|
|
322
322
|
urlStartsWith: 'about',
|
|
323
323
|
},
|
|
324
324
|
})
|
|
@@ -82,11 +82,13 @@ During deploy you'd have to set the theme that is being build:
|
|
|
82
82
|
Create a separate theme for each brand:
|
|
83
83
|
|
|
84
84
|
```tsx
|
|
85
|
+
import { themeName } from '@graphcommerce/next-config/config'
|
|
86
|
+
|
|
85
87
|
let theme: Theme
|
|
86
|
-
if (
|
|
88
|
+
if (themeName === 'BRAND_1') {
|
|
87
89
|
const brand1Palette = ...
|
|
88
90
|
theme = createThemeWithPalette(brand1Palette)
|
|
89
|
-
} else if (
|
|
91
|
+
} else if (themeName === 'BRAND_2') {
|
|
90
92
|
const brand2Palette = ...
|
|
91
93
|
theme = createThemeWithPalette(brand2Palette)
|
|
92
94
|
}
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@graphcommerce/docs",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/docs",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce/docs",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "10.0.0-canary.56",
|
|
6
6
|
"sideEffects": true,
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@graphcommerce/prettier-config-pwa": "^
|
|
8
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.56"
|
|
9
9
|
},
|
|
10
10
|
"prettier": "@graphcommerce/prettier-config-pwa"
|
|
11
11
|
}
|
|
@@ -3,6 +3,50 @@
|
|
|
3
3
|
Depending on the amounts of customisations you've made, there are some manual
|
|
4
4
|
steps.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## Trans and t import replacements
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
```tsx
|
|
9
|
+
import { i18n } from '@lingui/core'
|
|
10
|
+
import { Trans } from '@lingui/react'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Becomes
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { t } from '@lingui/core/macro'
|
|
17
|
+
import { Trans } from '@lingui/react/macro'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
And
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { t, Trans } from '@lingui/macro'
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Becomes
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { t } from '@lingui/core/macro'
|
|
30
|
+
import { Trans } from '@lingui/react/macro'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Translations
|
|
34
|
+
|
|
35
|
+
After changing all the imports in the step above. Please remove all occurences
|
|
36
|
+
of `#. js-lingui-generated-id` in the .po files.
|
|
37
|
+
|
|
38
|
+
Run `yarn lingui` again to extract all the new translations.
|
|
39
|
+
|
|
40
|
+
## import.meta.graphCommerce replaced by '@graphcommerce/next-config/config'
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
const jaja = import.meta.graphCommerce.cartDisplayPricesInclTax
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
becomes
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { cartDisplayPricesInclTax } from '@graphcommerce/next-config/config'
|
|
50
|
+
|
|
51
|
+
const jaja = cartDisplayPricesInclTax
|
|
52
|
+
```
|