@graphcommerce/magento-cart-items 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
@@ -1,7 +1,8 @@
1
1
  import { useCrosssellItems } from '@graphcommerce/magento-cart/components/CartAdded/useCrosssellItems'
2
2
  import type { ProductListItemRenderer, ProductScrollerProps } from '@graphcommerce/magento-product'
3
3
  import { AddProductsToCartForm, ProductScroller } from '@graphcommerce/magento-product'
4
- import { Trans } from '@lingui/macro'
4
+ import { crossSellsHideCartItems } from '@graphcommerce/next-config/config'
5
+ import { Trans } from '@lingui/react/macro'
5
6
 
6
7
  export type CartItemCrosssellsProps = {
7
8
  renderer: ProductListItemRenderer
@@ -11,8 +12,8 @@ export function CartCrosssellsScroller(props: CartItemCrosssellsProps) {
11
12
  const { renderer, sx = [], title, titleProps } = props
12
13
  const [, crossSellItems] = useCrosssellItems()
13
14
 
14
- const crossSellsHideCartItems = Boolean(import.meta.graphCommerce.crossSellsHideCartItems)
15
- if (crossSellItems.length === 0 || crossSellsHideCartItems === true) return null
15
+ const hideCartItems = Boolean(crossSellsHideCartItems)
16
+ if (crossSellItems.length === 0 || hideCartItems === true) return null
16
17
 
17
18
  return (
18
19
  <AddProductsToCartForm redirect={false} snackbarProps={{ disableSuccessSnackbar: true }}>
@@ -4,7 +4,7 @@ import { productPath } from '@graphcommerce/magento-product'
4
4
  import { Money, PriceModifiersList, type PriceModifier } from '@graphcommerce/magento-store'
5
5
  import type { ActionCardProps } from '@graphcommerce/next-ui'
6
6
  import { ActionCard, actionCardImageSizes, filterNonNullableKeys } from '@graphcommerce/next-ui'
7
- import { Trans } from '@lingui/react'
7
+ import { Trans } from '@lingui/react/macro'
8
8
  import { Box, Button, Link } from '@mui/material'
9
9
  import type { CartItemFragment } from '../../Api/CartItem.gql'
10
10
  import { RemoveItemFromCart } from '../RemoveItemFromCart/RemoveItemFromCart'
@@ -152,7 +152,7 @@ export function CartItemActionCard(props: CartItemActionCardProps) {
152
152
  color='secondary'
153
153
  href={`/checkout/item/${product.url_key}?cartItemId=${uid}`}
154
154
  >
155
- <Trans id='Edit options' />
155
+ <Trans>Edit options</Trans>
156
156
  </Button>
157
157
  )}
158
158
 
@@ -169,7 +169,7 @@ export function CartItemActionCard(props: CartItemActionCardProps) {
169
169
  <>
170
170
  {priceModifiers && priceModifiers.length > 0 && (
171
171
  <PriceModifiersList
172
- label={<Trans id='Base Price'>Base price</Trans>}
172
+ label={<Trans>Base price</Trans>}
173
173
  modifiers={[...priceModifiers]}
174
174
  total={prices?.price_including_tax?.value ?? 0}
175
175
  currency={prices?.price.currency}
@@ -1,13 +1,13 @@
1
1
  import type { AddProductsToCartButtonProps } from '@graphcommerce/magento-product'
2
2
  import { AddProductsToCartButton } from '@graphcommerce/magento-product'
3
- import { Trans } from '@lingui/react'
3
+ import { Trans } from '@lingui/react/macro'
4
4
 
5
5
  export function EditCartItemButton(props: AddProductsToCartButtonProps) {
6
6
  const { children, ...rest } = props
7
7
 
8
8
  return (
9
9
  <AddProductsToCartButton color='secondary' {...rest}>
10
- <Trans id='Save changes' />
10
+ <Trans>Save changes</Trans>
11
11
  </AddProductsToCartButton>
12
12
  )
13
13
  }
@@ -1,7 +1,7 @@
1
1
  import { ApolloCartErrorSnackbar } from '@graphcommerce/magento-cart'
2
2
  import type { ButtonProps } from '@graphcommerce/next-ui'
3
3
  import { Button } from '@graphcommerce/next-ui'
4
- import { Trans } from '@lingui/react'
4
+ import { Trans } from '@lingui/react/macro'
5
5
  import type { SxProps, Theme } from '@mui/material'
6
6
  import { styled } from '@mui/material'
7
7
  import type { UseRemoveItemFromCartProps } from '../../hooks/useRemoveItemFromCart'
@@ -28,7 +28,7 @@ export function RemoveItemFromCart(props: RemoveItemFromCartProps) {
28
28
  type='submit'
29
29
  loading={formState.isSubmitting}
30
30
  >
31
- <Trans id='Remove' />
31
+ <Trans>Remove</Trans>
32
32
  </Button>
33
33
  <ApolloCartErrorSnackbar error={error} />
34
34
  </Form>
@@ -1,7 +1,7 @@
1
1
  import { ApolloCartErrorSnackbar } from '@graphcommerce/magento-cart'
2
2
  import type { FabProps } from '@graphcommerce/next-ui'
3
3
  import { Fab, iconClose } from '@graphcommerce/next-ui'
4
- import { i18n } from '@lingui/core'
4
+ import { t } from '@lingui/core/macro'
5
5
  import type { SxProps, Theme } from '@mui/material'
6
6
  import { styled } from '@mui/material'
7
7
  import type { UseRemoveItemFromCartProps } from '../../hooks/useRemoveItemFromCart'
@@ -22,7 +22,7 @@ export function RemoveItemFromCartFab(props: RemoveItemFromCartFabProps) {
22
22
  return (
23
23
  <Form noValidate onSubmit={submit} {...formProps}>
24
24
  <Fab
25
- aria-label={i18n._(/* i18n */ 'Remove Product')}
25
+ aria-label={t`Remove Product`}
26
26
  size='small'
27
27
  type='submit'
28
28
  disabled={formState.isSubmitting}
@@ -1,5 +1,5 @@
1
1
  import { Money } from '@graphcommerce/magento-store'
2
- import type { PriceModifier } from '@graphcommerce/magento-store/components/PriceModifiers'
2
+ import type { PriceModifier } from '@graphcommerce/magento-store'
3
3
  import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
4
4
  import { Box } from '@mui/material'
5
5
  import type { CartItemFragment } from '../../Api/CartItem.gql'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart-items",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.55",
5
+ "version": "10.0.0-canary.56",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -11,30 +11,33 @@
11
11
  "project": "./tsconfig.json"
12
12
  }
13
13
  },
14
+ "exports": {
15
+ ".": "./index.ts"
16
+ },
14
17
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.55",
16
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.55",
17
- "@graphcommerce/framer-next-pages": "^9.1.0-canary.55",
18
- "@graphcommerce/graphql": "^9.1.0-canary.55",
19
- "@graphcommerce/image": "^9.1.0-canary.55",
20
- "@graphcommerce/magento-cart": "^9.1.0-canary.55",
21
- "@graphcommerce/magento-customer": "^9.1.0-canary.55",
22
- "@graphcommerce/magento-product": "^9.1.0-canary.55",
23
- "@graphcommerce/magento-store": "^9.1.0-canary.55",
24
- "@graphcommerce/next-ui": "^9.1.0-canary.55",
25
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.55",
26
- "@graphcommerce/react-hook-form": "^9.1.0-canary.55",
27
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.55",
28
- "@lingui/core": "^4.2.1",
29
- "@lingui/macro": "^4.2.1",
30
- "@lingui/react": "^4.2.1",
18
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.56",
19
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.56",
20
+ "@graphcommerce/framer-next-pages": "^10.0.0-canary.56",
21
+ "@graphcommerce/graphql": "^10.0.0-canary.56",
22
+ "@graphcommerce/image": "^10.0.0-canary.56",
23
+ "@graphcommerce/magento-cart": "^10.0.0-canary.56",
24
+ "@graphcommerce/magento-customer": "^10.0.0-canary.56",
25
+ "@graphcommerce/magento-product": "^10.0.0-canary.56",
26
+ "@graphcommerce/magento-store": "^10.0.0-canary.56",
27
+ "@graphcommerce/next-ui": "^10.0.0-canary.56",
28
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.56",
29
+ "@graphcommerce/react-hook-form": "^10.0.0-canary.56",
30
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.56",
31
+ "@lingui/core": "^5",
32
+ "@lingui/macro": "^5",
33
+ "@lingui/react": "^5",
31
34
  "@mui/material": "^5.10.16",
32
35
  "framer-motion": "^11.0.0",
33
36
  "next": "*",
34
- "react": "^18.2.0",
35
- "react-dom": "^18.2.0"
37
+ "react": "^19.2.0",
38
+ "react-dom": "^19.2.0"
36
39
  },
37
40
  "devDependencies": {
38
- "type-fest": "^4.30.1"
41
+ "type-fest": "^5.3.0"
39
42
  }
40
43
  }