@graphcommerce/framer-scroller 9.1.0-canary.55 → 10.0.0-canary.57

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.57
4
+
5
+ ## 10.0.0-canary.56
6
+
7
+ ### Major Changes
8
+
9
+ - [#2546](https://github.com/graphcommerce-org/graphcommerce/pull/2546) [`ed9332a`](https://github.com/graphcommerce-org/graphcommerce/commit/ed9332a7f78966d932041d9a7725641edc92b28d) - ## GraphCommerce 10 - Turbopack Support
10
+
11
+ This major release brings full Turbopack compatibility, dramatically improving development speed.
12
+
13
+ ### 🚀 Turbopack-Compatible Interceptor System
14
+
15
+ The entire plugin/interceptor system has been rewritten to work with Turbopack:
16
+
17
+ - **No more Webpack plugins** - Removed `InterceptorPlugin` webpack plugin entirely
18
+ - **File-based interception** - Original files are moved to `.original.tsx` and replaced with interceptor content
19
+ - **Direct imports** - Interceptors import from `.original` files instead of embedding source
20
+ - **New CLI commands**:
21
+ - `graphcommerce codegen-interceptors` - Generate interceptor files
22
+ - `graphcommerce cleanup-interceptors` - Reset interceptor system, restore original files
23
+ - **Stable file hashing** - Deterministic interceptor generation for better caching
24
+
25
+ ### ⚙️ Treeshakable Configuration System
26
+
27
+ Replaced Webpack `DefinePlugin`-based `import.meta.graphCommerce` with a new generated configuration system:
28
+
29
+ - **New `codegen-config-values` command** - Generates TypeScript files with precise typing
30
+ - **Schema-driven** - Dynamically introspects Zod schemas to determine all available properties
31
+ - **Fully treeshakable** - Unused config values are eliminated from the bundle
32
+ - **Type-safe** - Uses `Get<GraphCommerceConfig, 'path'>` for nested property access
33
+ - **Separate files for nested objects** - Optimal treeshaking for complex configurations
34
+
35
+ ### 🔧 withGraphCommerce Changes
36
+
37
+ - **Removed** `InterceptorPlugin` - No longer needed with file-based interception
38
+ - **Removed** `DefinePlugin` for `import.meta.graphCommerce` - Replaced with generated config
39
+ - **Removed** `@mui/*` alias rewrites - No longer required
40
+ - **Added** Turbopack loader rules for `.yaml`, `.yml`, and `.po` files
41
+ - **Added** `serverExternalPackages` for all `@whatwg-node/*` packages
42
+ - **Added** `optimizePackageImports` for better bundle optimization
43
+ - **Added** `images.qualities: [52, 75]` for Next.js image optimization
44
+
45
+ ### 📦 Lingui Configuration
46
+
47
+ - **Renamed** `lingui.config.js` → `lingui.config.ts` with TypeScript support
48
+ - **Updated** `@graphcommerce/lingui-next/config` to TypeScript with proper exports
49
+ - **Simplified** formatter options
50
+
51
+ ### ⚛️ React 19 & Next.js 16 Compatibility
52
+
53
+ - Updated `RefObject<T>` types for React 19 (now includes `null` by default)
54
+ - Replaced deprecated `React.VFC` with `React.FC`
55
+ - Fixed `useRef` calls to require explicit initial values
56
+ - Updated `MutableRefObject` usage in `framer-scroller`
57
+
58
+ ### 📋 ESLint 9 Flat Config
59
+
60
+ - Migrated from legacy `.eslintrc` to new flat config format (`eslint.config.mjs`)
61
+ - Updated `@typescript-eslint/*` packages to v8
62
+ - Fixed AST selector for `SxProps` rule (`typeParameters` → `typeArguments`)
63
+
64
+ ### 🔄 Apollo Client
65
+
66
+ - Fixed deprecated `name` option → `clientAwareness: { name: 'ssr' }`
67
+ - Updated error handling types to accept `ApolloError | null | undefined`
68
+
69
+ ### ⚠️ Breaking Changes
70
+
71
+ - **Node.js 24.x not supported** - Restricted to `>=20 <24.0.0` due to [nodejs/undici#4290](https://github.com/nodejs/undici/issues/4290)
72
+ - **Interceptor files changed** - Original components now at `.original.tsx`
73
+ - **Config access changed** - Use generated config values instead of `import.meta.graphCommerce`
74
+ - **ESLint config format** - Must use flat config (`eslint.config.mjs`)
75
+ - **Lingui config** - Rename `lingui.config.js` to `lingui.config.ts`
76
+
77
+ ### 🗑️ Removed
78
+
79
+ - `InterceptorPlugin` webpack plugin
80
+ - `configToImportMeta` utility
81
+ - Webpack `DefinePlugin` usage for config
82
+ - `@mui/*` modern alias rewrites
83
+ - Debug plugins (`CircularDependencyPlugin`, `DuplicatesPlugin`) ([@paales](https://github.com/paales))
84
+
3
85
  ## 9.1.0-canary.55
4
86
 
5
87
  ## 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.57",
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.57",
25
+ "@graphcommerce/framer-utils": "^10.0.0-canary.57",
26
+ "@graphcommerce/image": "^10.0.0-canary.57",
27
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.57",
28
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.57",
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