@graphcommerce/magento-product-configurable 9.1.0-canary.54 → 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,87 @@
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
+
83
+ ## 9.1.0-canary.55
84
+
3
85
  ## 9.1.0-canary.54
4
86
 
5
87
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import type { ActionCardItemRenderProps } from '@graphcommerce/ecommerce-ui'
2
2
  import { Image } from '@graphcommerce/image'
3
3
  import { ActionCard, responsiveVal } from '@graphcommerce/next-ui'
4
- import { Trans } from '@lingui/react'
4
+ import { Trans } from '@lingui/react/macro'
5
5
  import { Button } from '@mui/material'
6
6
  import type { ConfigurableOptionValueImageFragment } from './ConfigurableOptionValueImage.gql'
7
7
 
@@ -4,7 +4,7 @@ import type { AddProductsToCartFields } from '@graphcommerce/magento-product/com
4
4
  import { useFormAddProductsToCart } from '@graphcommerce/magento-product/components'
5
5
  import { filterNonNullableKeys, nonNullable, SectionHeader } from '@graphcommerce/next-ui'
6
6
  import { useWatch } from '@graphcommerce/react-hook-form'
7
- import { i18n } from '@lingui/core'
7
+ import { t } from '@lingui/core/macro'
8
8
  import type { SxProps, Theme } from '@mui/material'
9
9
  import { Box } from '@mui/material'
10
10
  import type { ConfigurableOptionsFragment } from '../../graphql'
@@ -30,7 +30,7 @@ export type ConfigurableProductOptionProps = NonNullable<
30
30
  export function ConfigurableProductOption(props: ConfigurableProductOptionProps) {
31
31
  const {
32
32
  values,
33
- label,
33
+
34
34
  index,
35
35
  optionIndex,
36
36
  optionStartLabels,
@@ -43,6 +43,7 @@ export function ConfigurableProductOption(props: ConfigurableProductOptionProps)
43
43
  ...other
44
44
  } = props
45
45
  const fieldName = `cartItems.${index}.selected_options.${optionIndex}` as const
46
+ const label = other.label ?? ''
46
47
 
47
48
  const { control } = useFormAddProductsToCart()
48
49
 
@@ -95,7 +96,7 @@ export function ConfigurableProductOption(props: ConfigurableProductOptionProps)
95
96
  items={items}
96
97
  render={render}
97
98
  rules={{
98
- required: i18n._(/* i18n*/ 'Please select a value for {label}’', { label }),
99
+ required: t`Please select a value for ‘${label}’`,
99
100
  }}
100
101
  />
101
102
  </Box>
@@ -3,7 +3,7 @@ import type { AddToCartItemSelector } from '@graphcommerce/magento-product'
3
3
  import { useFormAddProductsToCart } from '@graphcommerce/magento-product'
4
4
  import type { ActionCardListProps } from '@graphcommerce/next-ui'
5
5
  import { filterNonNullableKeys, useLocale } from '@graphcommerce/next-ui'
6
- import { i18n } from '@lingui/core'
6
+ import { t } from '@lingui/core/macro'
7
7
  import type { SxProps, Theme } from '@mui/material'
8
8
  import { Box } from '@mui/material'
9
9
  import React, { useEffect, useMemo } from 'react'
@@ -57,7 +57,7 @@ export function ConfigurableProductOptions(props: ConfigurableProductOptionsProp
57
57
  useEffect(() => {
58
58
  if (unavailable) {
59
59
  setError(`cartItems.${index}.sku`, {
60
- message: i18n._(/* i18n */ 'Product not available in {allLabels}', { allLabels }),
60
+ message: t`Product not available in ${allLabels}`,
61
61
  })
62
62
  }
63
63
  if (!unavailable) clearErrors(`cartItems.${index}.sku`)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-product-configurable",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.54",
5
+ "version": "10.0.0-canary.56",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,30 +12,45 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.54",
16
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.54",
17
- "@graphcommerce/graphql": "^9.1.0-canary.54",
18
- "@graphcommerce/graphql-mesh": "^9.1.0-canary.54",
19
- "@graphcommerce/image": "^9.1.0-canary.54",
20
- "@graphcommerce/lingui-next": "9.1.0-canary.54",
21
- "@graphcommerce/magento-cart": "^9.1.0-canary.54",
22
- "@graphcommerce/magento-cart-items": "^9.1.0-canary.54",
23
- "@graphcommerce/magento-category": "^9.1.0-canary.54",
24
- "@graphcommerce/magento-customer": "^9.1.0-canary.54",
25
- "@graphcommerce/magento-product": "^9.1.0-canary.54",
26
- "@graphcommerce/magento-product-simple": "^9.1.0-canary.54",
27
- "@graphcommerce/magento-store": "^9.1.0-canary.54",
28
- "@graphcommerce/next-ui": "^9.1.0-canary.54",
29
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.54",
30
- "@graphcommerce/react-hook-form": "^9.1.0-canary.54",
31
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.54",
32
- "@lingui/core": "^4.2.1",
33
- "@lingui/macro": "^4.2.1",
34
- "@lingui/react": "^4.2.1",
15
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.56",
16
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.56",
17
+ "@graphcommerce/graphql": "^10.0.0-canary.56",
18
+ "@graphcommerce/graphql-mesh": "^10.0.0-canary.56",
19
+ "@graphcommerce/image": "^10.0.0-canary.56",
20
+ "@graphcommerce/lingui-next": "10.0.0-canary.56",
21
+ "@graphcommerce/magento-cart": "^10.0.0-canary.56",
22
+ "@graphcommerce/magento-cart-items": "^10.0.0-canary.56",
23
+ "@graphcommerce/magento-category": "^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-product-simple": "^10.0.0-canary.56",
27
+ "@graphcommerce/magento-store": "^10.0.0-canary.56",
28
+ "@graphcommerce/next-ui": "^10.0.0-canary.56",
29
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.56",
30
+ "@graphcommerce/react-hook-form": "^10.0.0-canary.56",
31
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.56",
32
+ "@lingui/core": "^5",
33
+ "@lingui/macro": "^5",
34
+ "@lingui/react": "^5",
35
35
  "@mui/material": "^5.10.16",
36
36
  "framer-motion": "^11.0.0",
37
37
  "next": "*",
38
- "react": "^18.2.0",
39
- "react-dom": "^18.2.0"
38
+ "react": "^19.2.0",
39
+ "react-dom": "^19.2.0"
40
+ },
41
+ "exports": {
42
+ ".": "./index.ts",
43
+ "./hooks": "./hooks/index.ts",
44
+ "./plugins/ConfigurableCartItemActionCard": "./plugins/ConfigurableCartItemActionCard.tsx",
45
+ "./plugins/Configurable_cartItemToCartItemInput": "./plugins/Configurable_cartItemToCartItemInput.ts",
46
+ "./plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd": "./plugins/ConfigurableProductPage/ConfigurableProductPageJsonLd.tsx",
47
+ "./plugins/ConfigurableProductPage/ConfigurableProductPageDescription": "./plugins/ConfigurableProductPage/ConfigurableProductPageDescription.tsx",
48
+ "./plugins/ConfigurableProductPage/ConfigurableProductPageGallery": "./plugins/ConfigurableProductPage/ConfigurableProductPageGallery.tsx",
49
+ "./plugins/ConfigurableProductPage/ConfigurableProductPageMeta": "./plugins/ConfigurableProductPage/ConfigurableProductPageMeta.tsx",
50
+ "./plugins/ConfigurableProductPage/ConfigurableProductPageName": "./plugins/ConfigurableProductPage/ConfigurableProductPageName.tsx",
51
+ "./plugins/ConfigurableProductPage/ConfigurableProductPagePrice": "./plugins/ConfigurableProductPage/ConfigurableProductPagePrice.tsx",
52
+ "./plugins/ConfigurableProductPage/ConfigurableProductPagePriceLowest": "./plugins/ConfigurableProductPage/ConfigurableProductPagePriceLowest.tsx",
53
+ "./plugins/ConfigurableProductPage/ConfigurableProductPagePriceTiers": "./plugins/ConfigurableProductPage/ConfigurableProductPagePriceTiers.tsx",
54
+ "./plugins/ConfigurableProductPage/ConfigurableProductShortDescription": "./plugins/ConfigurableProductPage/ConfigurableProductShortDescription.tsx"
40
55
  }
41
56
  }
@@ -4,6 +4,7 @@ import {
4
4
  } from '@graphcommerce/magento-cart-items'
5
5
  import type { PriceModifier } from '@graphcommerce/magento-store'
6
6
  import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
7
+ import { configurableVariantValues } from '@graphcommerce/next-config/config'
7
8
  import { filterNonNullableKeys, isTypename } from '@graphcommerce/next-ui'
8
9
 
9
10
  export const config: PluginConfig = {
@@ -31,11 +32,11 @@ export function CartItemActionCard(props: PluginProps<CartItemActionCardProps>)
31
32
  ...rest.cartItem,
32
33
  product: {
33
34
  ...rest.cartItem.product,
34
- name: import.meta.graphCommerce.configurableVariantValues?.content
35
+ name: configurableVariantValues?.content
35
36
  ? rest.cartItem.configured_variant.name
36
37
  : rest.cartItem.product.name,
37
38
  thumbnail: rest.cartItem.configured_variant.thumbnail,
38
- // url_key: import.meta.graphCommerce.configurableVariantValues?.url
39
+ // url_key: configurableVariantValues?.url
39
40
  // ? rest.cartItem.configured_variant.url_key
40
41
  // : rest.cartItem.product.url_key,
41
42
  },
@@ -1,5 +1,6 @@
1
1
  import type { ApolloClient } from '@graphcommerce/graphql'
2
2
  import type { AddProductsToCartFormProps } from '@graphcommerce/magento-product'
3
+ import { configurableVariantForSimple } from '@graphcommerce/next-config/config'
3
4
  import { filterNonNullableKeys, findByTypename, nonNullable } from '@graphcommerce/next-ui'
4
5
  import { GetConfigurableOptionsSelectionDocument } from '../graphql'
5
6
  import type { DefaultConfigurableOptionsSelectionFragment } from './DefaultConfigurableOptionsSelection.gql'
@@ -30,10 +31,7 @@ export async function defaultConfigurableOptionsSelection<Q extends BaseQuery =
30
31
  const simple = query?.products?.items?.find((p) => p?.url_key === urlKey)
31
32
  const configurable = findByTypename(query?.products?.items, 'ConfigurableProduct')
32
33
 
33
- if (
34
- simple?.__typename === 'SimpleProduct' &&
35
- !import.meta.graphCommerce.configurableVariantForSimple
36
- ) {
34
+ if (simple?.__typename === 'SimpleProduct' && !configurableVariantForSimple) {
37
35
  const product = query?.products?.items?.find((p) => p?.url_key === urlKey)
38
36
  return { ...query, products: { ...query?.products, items: [product] }, defaultValues: {} }
39
37
  }