@graphcommerce/framer-scroller 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,7 @@
1
1
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies
3
3
  import { extendableComponent } from '@graphcommerce/next-ui/Styles'
4
- import { i18n } from '@lingui/core'
4
+ import { t } from '@lingui/core/macro'
5
5
  import type { FabProps } from '@mui/material'
6
6
  import { Fab, styled } from '@mui/material'
7
7
  import { m } from 'framer-motion'
@@ -39,7 +39,7 @@ export function ScrollerDot(props: ScrollerDotProps) {
39
39
  scrollTo({ x: positions.x[idx] ?? 0, y: positions.y[idx] ?? 0 })
40
40
  }}
41
41
  className={classes.dot}
42
- aria-label={i18n._(/* i18n */ 'Navigate to item {0}', { 0: idx + 1 })}
42
+ aria-label={t`Navigate to item ${idx + 1}`}
43
43
  sx={{
44
44
  boxShadow: 'none',
45
45
  background: 'transparent',
@@ -67,8 +67,8 @@ function useObserveItems(scrollerRef: ReactHtmlRefObject, items: MotionValue<Ite
67
67
  }
68
68
 
69
69
  export function ScrollerProvider(props: ScrollerProviderProps) {
70
- const scrollerRef = useRef<HTMLDivElement>()
71
- const running = useRef<PlaybackControls>()
70
+ const scrollerRef = useRef<HTMLDivElement | null>(null)
71
+ const running = useRef<PlaybackControls | null>(null)
72
72
  const scroll = useElementScroll(scrollerRef)
73
73
 
74
74
  const {
@@ -94,7 +94,7 @@ export function ScrollerProvider(props: ScrollerProviderProps) {
94
94
  // Cancel any running animations to prevent onComplete to be ran
95
95
  const stop = useCallback(() => {
96
96
  running.current?.stop()
97
- running.current = undefined
97
+ running.current = null
98
98
  }, [])
99
99
 
100
100
  // Register any running animations so they become cancelable
@@ -225,7 +225,6 @@ export function ScrollerProvider(props: ScrollerProviderProps) {
225
225
 
226
226
  // Skip child if it doesn't intersect the parent's opposite axis (it can never be in view)
227
227
  if (excludeOffAxis && !domRectIntersects(parentRect, childRect, orthogonalAxis)) {
228
- // eslint-disable-next-line no-continue
229
228
  continue
230
229
  }
231
230
 
@@ -2,9 +2,9 @@ import { useConstant, useMotionValueValue } from '@graphcommerce/framer-utils'
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies
3
3
  import { extendableComponent } from '@graphcommerce/next-ui/Styles'
4
4
  import type { SxProps, Theme } from '@mui/material'
5
- import type { HTMLMotionProps, MotionValue, PanHandlers, PanInfo } from 'framer-motion'
5
+ import type { HTMLMotionProps, PanHandlers, PanInfo } from 'framer-motion'
6
6
  import { motionValue, useTransform } from 'framer-motion'
7
- import type { MouseEventHandler, ReactHTML } from 'react'
7
+ import type { MouseEventHandler } from 'react'
8
8
  import type React from 'react'
9
9
  import { useEffect, useState } from 'react'
10
10
  import { isHTMLMousePointerEvent } from '../utils/isHTMLMousePointerEvent'
@@ -13,7 +13,7 @@ import { scrollSnapTypeDirection } from '../utils/scrollSnapTypeDirection'
13
13
  import { useScrollerContext } from './useScrollerContext'
14
14
  import { useVelocitySnapTo } from './useVelocitySnapTo'
15
15
 
16
- export type ScrollableProps<TagName extends keyof ReactHTML = 'div'> = Omit<
16
+ export type ScrollableProps<TagName extends React.HTMLElementType = 'div'> = Omit<
17
17
  HTMLMotionProps<TagName>,
18
18
  'children'
19
19
  > & {
@@ -41,7 +41,7 @@ const { withState } = extendableComponent<OwnerProps, typeof name, typeof parts>
41
41
 
42
42
  /** Make any HTML */
43
43
  export function useScroller<
44
- TagName extends keyof ReactHTML = 'div',
44
+ TagName extends React.HTMLElementType = 'div',
45
45
  E extends HTMLElement = HTMLElement,
46
46
  >(props: ScrollableProps<TagName>, forwardedRef: React.ForwardedRef<E>) {
47
47
  const { hideScrollbar = false, children, grid = false, disableDrag, ...divProps } = props
@@ -123,7 +123,7 @@ export function useScroller<
123
123
  }
124
124
 
125
125
  const ref: React.RefCallback<E> = (el) => {
126
- scrollerRef.current = el ?? undefined
126
+ scrollerRef.current = el
127
127
  if (typeof forwardedRef === 'function') forwardedRef(el)
128
128
  else if (forwardedRef) forwardedRef.current = el
129
129
  }
@@ -21,7 +21,7 @@ const closest = (counts: number[], target: number) =>
21
21
  : undefined
22
22
 
23
23
  export const useVelocitySnapTo = (
24
- ref: React.RefObject<HTMLElement> | React.MutableRefObject<HTMLElement | undefined>,
24
+ ref: React.RefObject<HTMLElement | null> | React.MutableRefObject<HTMLElement | null | undefined>,
25
25
  ) => {
26
26
  const { disableSnap, enableSnap, register, getScrollSnapPositions, scrollSnap, scroll } =
27
27
  useScrollerContext()
package/package.json CHANGED
@@ -2,11 +2,14 @@
2
2
  "name": "@graphcommerce/framer-scroller",
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
  "scripts": {
8
8
  "dev": "tsc -W"
9
9
  },
10
+ "exports": {
11
+ ".": "./index.ts"
12
+ },
10
13
  "prettier": "@graphcommerce/prettier-config-pwa",
11
14
  "eslintConfig": {
12
15
  "extends": "@graphcommerce/eslint-config-pwa",
@@ -18,17 +21,17 @@
18
21
  "popmotion": "11.0.5"
19
22
  },
20
23
  "peerDependencies": {
21
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.55",
22
- "@graphcommerce/framer-utils": "^9.1.0-canary.55",
23
- "@graphcommerce/image": "^9.1.0-canary.55",
24
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.55",
25
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.55",
26
- "@lingui/core": "^4.2.1",
27
- "@lingui/react": "^4.2.1",
24
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.56",
25
+ "@graphcommerce/framer-utils": "^10.0.0-canary.56",
26
+ "@graphcommerce/image": "^10.0.0-canary.56",
27
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.56",
28
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.56",
29
+ "@lingui/core": "^5",
30
+ "@lingui/react": "^5",
28
31
  "@mui/material": "^5.10.16",
29
32
  "framer-motion": "^11.0.0",
30
33
  "next": "*",
31
- "react": "^18.2.0",
32
- "react-dom": "^18.2.0"
34
+ "react": "^19.2.0",
35
+ "react-dom": "^19.2.0"
33
36
  }
34
37
  }
package/types.ts CHANGED
@@ -16,7 +16,7 @@ export type ScrollSnapProps = {
16
16
  scrollSnapStop: ScrollSnapStop
17
17
  }
18
18
 
19
- export type ReactHtmlRefObject = React.MutableRefObject<HTMLElement | undefined>
19
+ export type ReactHtmlRefObject = React.MutableRefObject<HTMLElement | null>
20
20
 
21
21
  export type SnapPositionDirection = 'left' | 'right' | 'up' | 'down'
22
22