@graphcommerce/ecommerce-ui 10.0.0-canary.68 β†’ 10.0.0

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,129 @@
1
1
  # @graphcommerce/ecommerce-ui
2
2
 
3
+ ## 10.0.0
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
+
83
+ - [#2557](https://github.com/graphcommerce-org/graphcommerce/pull/2557) [`ceaadd8`](https://github.com/graphcommerce-org/graphcommerce/commit/ceaadd87f0648982a068a3b07b1fa149c9127f49) - ## Material UI v5 β†’ v7 Migration
84
+
85
+ This release upgrades Material UI from v5 to v7 with full CSS variables support. ([@paales](https://github.com/paales))
86
+
87
+ - [#2565](https://github.com/graphcommerce-org/graphcommerce/pull/2565) [`c96dfcd`](https://github.com/graphcommerce-org/graphcommerce/commit/c96dfcdca981baca387c270ad9e2b9515cdd00cc) - Updated to Apollo Client 4 ([@paales](https://github.com/paales))
88
+
89
+ ### Patch Changes
90
+
91
+ - [`026114e`](https://github.com/graphcommerce-org/graphcommerce/commit/026114ece325d8f675ba8820c6b63345e48532fa) - Sovle issue where showValid would be forwarded to the textField element ([@paales](https://github.com/paales))
92
+
93
+ - [#2530](https://github.com/graphcommerce-org/graphcommerce/pull/2530) [`fe48501`](https://github.com/graphcommerce-org/graphcommerce/commit/fe4850106abebe1fe113e08e38623ebfd5481c1d) - Make sure the increment step of the NumberInputField rounds to the nearest step. ([@paales](https://github.com/paales))
94
+
95
+ - [#2538](https://github.com/graphcommerce-org/graphcommerce/pull/2538) [`9b96d69`](https://github.com/graphcommerce-org/graphcommerce/commit/9b96d69d2aba2779e1875ffb068096087582f10d) - fix issue where stepper could have values such as 8,10000000000 inste… ([@FrankHarland](https://github.com/FrankHarland))
96
+
97
+ - [`ea7af54`](https://github.com/graphcommerce-org/graphcommerce/commit/ea7af54048506228b6fde04d3bba764358b7f7e0) - Round step increment also max to two decimals as we might else get very long numbers ([@paales](https://github.com/paales))
98
+
99
+ - [`5a9adde`](https://github.com/graphcommerce-org/graphcommerce/commit/5a9addee16aa9dc8f4ce6f8fa4b3fe6c11b90d8f) - FormElements now are now disabled when the whole form is disabled. ([@paales](https://github.com/paales))
100
+
101
+ - [#2567](https://github.com/graphcommerce-org/graphcommerce/pull/2567) [`0af3466`](https://github.com/graphcommerce-org/graphcommerce/commit/0af34663f882ad9906dc13ae6c835c158598b945) - Fix NumberFieldElement plus button decreasing the number instead of increasing ([@paales](https://github.com/paales))
102
+
103
+ - [#2541](https://github.com/graphcommerce-org/graphcommerce/pull/2541) [`09e67d6`](https://github.com/graphcommerce-org/graphcommerce/commit/09e67d6cb266ed4714a209ef90e49c3963962604) - Fix issue where setting required on the controller caused the form to submit without variables ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
104
+
105
+ - [#2470](https://github.com/graphcommerce-org/graphcommerce/pull/2470) [`910e6aa`](https://github.com/graphcommerce-org/graphcommerce/commit/910e6aab024a925bb042cf17968b2ab826f97d88) - Refactor the FormComponents for better TypeScript checking performance. ([@paales](https://github.com/paales))
106
+
107
+ - [#2493](https://github.com/graphcommerce-org/graphcommerce/pull/2493) [`2d22429`](https://github.com/graphcommerce-org/graphcommerce/commit/2d2242932b7e07fa970c1dae1685487832f864d7) - Always log the networkError during development to the console. ([@paales](https://github.com/paales))
108
+
109
+ - [#2499](https://github.com/graphcommerce-org/graphcommerce/pull/2499) [`7c7d6e4`](https://github.com/graphcommerce-org/graphcommerce/commit/7c7d6e4976d263f4139ce1de2caf47e7f49a2bf8) - Solve issue where an individual item in the ActionCardListForm couldn't be disabed. Resulting in configurable options on the product page to be selectable while they shouldn't be. ([@paales](https://github.com/paales))
110
+
111
+ ## 10.0.0-canary.72
112
+
113
+ ## 10.0.0-canary.71
114
+
115
+ ## 10.0.0-canary.70
116
+
117
+ ### Major Changes
118
+
119
+ - [#2565](https://github.com/graphcommerce-org/graphcommerce/pull/2565) [`c96dfcd`](https://github.com/graphcommerce-org/graphcommerce/commit/c96dfcdca981baca387c270ad9e2b9515cdd00cc) - Updated to Apollo Client 4 ([@paales](https://github.com/paales))
120
+
121
+ ## 10.0.0-canary.69
122
+
123
+ ### Patch Changes
124
+
125
+ - [#2567](https://github.com/graphcommerce-org/graphcommerce/pull/2567) [`0af3466`](https://github.com/graphcommerce-org/graphcommerce/commit/0af34663f882ad9906dc13ae6c835c158598b945) - Fix NumberFieldElement plus button decreasing the number instead of increasing ([@paales](https://github.com/paales))
126
+
3
127
  ## 10.0.0-canary.68
4
128
 
5
129
  ### Major Changes
@@ -1,5 +1,6 @@
1
- import type { ApolloError } from '@graphcommerce/graphql'
2
1
  import { extendableComponent } from '@graphcommerce/next-ui/Styles/extendableComponent'
2
+ import type { ErrorLike } from '@apollo/client'
3
+ import { CombinedGraphQLErrors } from '@apollo/client/errors'
3
4
  import type { AlertProps, SxProps, Theme } from '@mui/material'
4
5
  import { Alert, Box } from '@mui/material'
5
6
  import { maskNetworkError } from './maskNetworkError'
@@ -7,7 +8,7 @@ import { maskNetworkError } from './maskNetworkError'
7
8
  const { classes, selectors } = extendableComponent('ApolloErrorAlert', ['root', 'alert'] as const)
8
9
 
9
10
  export type ApolloErrorAlertProps = {
10
- error?: ApolloError | null
11
+ error?: ErrorLike | null
11
12
  graphqlErrorAlertProps?: Omit<AlertProps, 'severity'>
12
13
  networkErrorAlertProps?: Omit<AlertProps, 'severity'>
13
14
  sx?: SxProps<Theme>
@@ -15,48 +16,50 @@ export type ApolloErrorAlertProps = {
15
16
  export function ApolloErrorAlert(props: ApolloErrorAlertProps) {
16
17
  const { error, graphqlErrorAlertProps, networkErrorAlertProps, sx } = props
17
18
 
19
+ if (!error) return null
20
+
21
+ // Check if this is a CombinedGraphQLErrors
22
+ const isGraphQLError = CombinedGraphQLErrors.is(error)
23
+ const graphQLErrors = isGraphQLError ? error.errors : []
24
+
18
25
  return (
19
- <>
20
- {error && (
21
- <Box key='alerts'>
22
- <Box sx={sx} className={classes.root}>
23
- {error.graphQLErrors.map((e, index) => (
24
- // eslint-disable-next-line react/no-array-index-key
25
- <Box key={index}>
26
- <div className={classes.alert}>
27
- <Alert
28
- severity='error'
29
- {...graphqlErrorAlertProps}
30
- sx={(theme) => ({
31
- borderRadius: theme.shape.borderRadius * 1,
32
- marginTop: 0.5,
33
- })}
34
- >
35
- {e.message}
36
- </Alert>
37
- </div>
38
- </Box>
39
- ))}
40
- {error.networkError && (
41
- <Box key='networkError'>
42
- <Box
43
- sx={(theme) => ({
44
- paddingTop: theme.spacings.xxs,
45
- paddingBottom: theme.spacings.xxs,
46
- })}
47
- className={classes.alert}
48
- key='networkError'
49
- >
50
- <Alert severity='error' {...networkErrorAlertProps}>
51
- {maskNetworkError(error.networkError)}
52
- </Alert>
53
- </Box>
54
- </Box>
55
- )}
26
+ <Box key='alerts'>
27
+ <Box sx={sx} className={classes.root}>
28
+ {graphQLErrors.map((e, index) => (
29
+ // eslint-disable-next-line react/no-array-index-key
30
+ <Box key={index}>
31
+ <div className={classes.alert}>
32
+ <Alert
33
+ severity='error'
34
+ {...graphqlErrorAlertProps}
35
+ sx={(theme) => ({
36
+ borderRadius: theme.shape.borderRadius * 1,
37
+ marginTop: 0.5,
38
+ })}
39
+ >
40
+ {e.message}
41
+ </Alert>
42
+ </div>
43
+ </Box>
44
+ ))}
45
+ {!isGraphQLError && error && (
46
+ <Box key='networkError'>
47
+ <Box
48
+ sx={(theme) => ({
49
+ paddingTop: theme.spacings.xxs,
50
+ paddingBottom: theme.spacings.xxs,
51
+ })}
52
+ className={classes.alert}
53
+ key='networkError'
54
+ >
55
+ <Alert severity='error' {...networkErrorAlertProps}>
56
+ {maskNetworkError(error)}
57
+ </Alert>
58
+ </Box>
56
59
  </Box>
57
- </Box>
58
- )}
59
- </>
60
+ )}
61
+ </Box>
62
+ </Box>
60
63
  )
61
64
  }
62
65
 
@@ -1,13 +1,14 @@
1
- import type { ApolloError } from '@graphcommerce/graphql'
2
1
  import type { FullPageMessageProps } from '@graphcommerce/next-ui'
3
2
  import { FullPageMessage } from '@graphcommerce/next-ui'
3
+ import type { ErrorLike } from '@apollo/client'
4
+ import { CombinedGraphQLErrors } from '@apollo/client/errors'
4
5
  import { Trans } from '@lingui/react/macro'
5
6
  import type { AlertProps } from '@mui/material'
6
7
  import { ApolloErrorAlert } from './ApolloErrorAlert'
7
8
  import { maskNetworkError } from './maskNetworkError'
8
9
 
9
10
  export type ApolloErrorFullPageProps = {
10
- error: ApolloError
11
+ error: ErrorLike
11
12
  graphqlErrorAlertProps?: Omit<AlertProps, 'severity'>
12
13
  networkErrorAlertProps?: Omit<AlertProps, 'severity'>
13
14
  } & Omit<FullPageMessageProps, 'title' | 'description'>
@@ -21,14 +22,17 @@ export function ApolloErrorFullPage(props: ApolloErrorFullPageProps) {
21
22
  ...fullPageMessageProps
22
23
  } = props
23
24
 
24
- const errorCount = (error?.graphQLErrors?.length ?? 0) + (error?.networkError ? 1 : 0)
25
+ // Check if this is a CombinedGraphQLErrors
26
+ const isGraphQLError = CombinedGraphQLErrors.is(error)
27
+ const graphQLErrors = isGraphQLError ? error.errors : []
28
+ const errorCount = graphQLErrors.length + (isGraphQLError ? 0 : 1)
25
29
 
26
30
  if (errorCount === 0) return null
27
31
 
28
32
  if (errorCount === 1) {
29
33
  return (
30
34
  <FullPageMessage
31
- title={error?.graphQLErrors?.[0]?.message ?? maskNetworkError(error.networkError)}
35
+ title={graphQLErrors[0]?.message ?? maskNetworkError(error)}
32
36
  {...fullPageMessageProps}
33
37
  >
34
38
  {children}
@@ -1,10 +1,11 @@
1
- import type { ApolloError } from '@graphcommerce/graphql'
2
1
  import type { ErrorSnackbarProps } from '@graphcommerce/next-ui'
3
2
  import { ErrorSnackbar } from '@graphcommerce/next-ui'
3
+ import type { ErrorLike } from '@apollo/client'
4
+ import { CombinedGraphQLErrors } from '@apollo/client/errors'
4
5
  import { maskNetworkError } from './maskNetworkError'
5
6
 
6
7
  export type ApolloErrorSnackbarProps = {
7
- error?: ApolloError | null
8
+ error?: ErrorLike | null
8
9
  } & Pick<ErrorSnackbarProps, 'action' | 'onClose'>
9
10
 
10
11
  export function ApolloErrorSnackbar(props: ApolloErrorSnackbarProps) {
@@ -12,11 +13,15 @@ export function ApolloErrorSnackbar(props: ApolloErrorSnackbarProps) {
12
13
 
13
14
  if (!error) return null
14
15
 
16
+ // Check if this is a CombinedGraphQLErrors
17
+ const isGraphQLError = CombinedGraphQLErrors.is(error)
18
+ const graphQLErrors = isGraphQLError ? error.errors : []
19
+
15
20
  return (
16
21
  <ErrorSnackbar variant='pill' severity='error' {...passedProps} open={!!error}>
17
22
  <>
18
- {error.graphQLErrors.map((e) => e.message).join(', ')}
19
- {maskNetworkError(error.networkError)}
23
+ {graphQLErrors.map((e) => e.message).join(', ')}
24
+ {!isGraphQLError && maskNetworkError(error)}
20
25
  </>
21
26
  </ErrorSnackbar>
22
27
  )
@@ -1,24 +1,15 @@
1
- import type { ServerError, ServerParseError } from '@graphcommerce/graphql'
1
+ import type { ErrorLike } from '@apollo/client'
2
+ import { ServerError, ServerParseError } from '@apollo/client/errors'
2
3
  import { Trans } from '@lingui/react/macro'
3
4
 
4
- function isServerError(error: Error | ServerParseError | ServerError | null): error is ServerError {
5
- return 'name' in (error as ServerError)
6
- }
7
-
8
- function isServerParseError(
9
- error: Error | ServerParseError | ServerError | null,
10
- ): error is ServerParseError {
11
- return 'bodyText' in (error as ServerParseError)
12
- }
13
-
14
- export function maskNetworkError(networkError: Error | ServerParseError | ServerError | null) {
15
- if (!networkError) return null
5
+ export function maskNetworkError(error: ErrorLike | null) {
6
+ if (!error) return null
16
7
 
17
8
  if (process.env.NODE_ENV === 'development') {
18
- console.log(networkError)
9
+ console.log(error)
19
10
  }
20
11
 
21
- if (isServerParseError(networkError) || isServerError(networkError)) {
12
+ if (ServerParseError.is(error) || ServerError.is(error)) {
22
13
  return <Trans>Something went wrong on the server, please try again later.</Trans>
23
14
  }
24
15
 
@@ -167,7 +167,7 @@ function NumberFieldElementBase(props: NumberFieldElementProps) {
167
167
  onClick={() => {
168
168
  if (valueAsNumber >= (inputProps.max ?? Infinity)) return
169
169
  // Round to nearest step with precision fix
170
- const newValue = roundToPrecision(Math.round((valueAsNumber - step) / step) * step)
170
+ const newValue = roundToPrecision(Math.round((valueAsNumber + step) / step) * step)
171
171
  onChange(newValue)
172
172
  }}
173
173
  sx={sxx(
@@ -1,10 +1,10 @@
1
- import type { QueryResult } from '@graphcommerce/graphql'
1
+ import type { ApolloClient, useQuery } from '@graphcommerce/graphql'
2
2
  import { useIsSSR } from '@graphcommerce/next-ui'
3
3
  import React from 'react'
4
4
 
5
5
  export type WaitForQueriesProps = {
6
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
- waitFor: QueryResult<any, any> | boolean | (QueryResult<any, any> | boolean)[] | undefined
7
+ waitFor: useQuery.Result<any, any> | boolean | (useQuery.Result<any, any> | boolean)[] | undefined
8
8
  children: React.ReactNode
9
9
  fallback?: React.ReactNode
10
10
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/ecommerce-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.0-canary.68",
5
+ "version": "10.0.0",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,12 +12,12 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.68",
16
- "@graphcommerce/graphql": "^10.0.0-canary.68",
17
- "@graphcommerce/next-ui": "^10.0.0-canary.68",
18
- "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.68",
19
- "@graphcommerce/react-hook-form": "^10.0.0-canary.68",
20
- "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.68",
15
+ "@graphcommerce/eslint-config-pwa": "^10.0.0",
16
+ "@graphcommerce/graphql": "^10.0.0",
17
+ "@graphcommerce/next-ui": "^10.0.0",
18
+ "@graphcommerce/prettier-config-pwa": "^10.0.0",
19
+ "@graphcommerce/react-hook-form": "^10.0.0",
20
+ "@graphcommerce/typescript-config-pwa": "^10.0.0",
21
21
  "@lingui/core": "^5",
22
22
  "@lingui/macro": "^5",
23
23
  "@lingui/react": "^5",