Skip to content

chore(deps): Q2 2026 dependency upgrade epic (#18)#20

Merged
smartlabsAT merged 11 commits into
mainfrom
epic/dependency-updates-q2-2026
May 22, 2026
Merged

chore(deps): Q2 2026 dependency upgrade epic (#18)#20
smartlabsAT merged 11 commits into
mainfrom
epic/dependency-updates-q2-2026

Conversation

@smartlabsAT
Copy link
Copy Markdown
Owner

@smartlabsAT smartlabsAT commented May 12, 2026

Summary

Comprehensive Q2 2026 dependency upgrade for react-resize-detector-context. Brings the library to the current stable line of React, MUI, TypeScript, Vitest, ESLint, and Storybook, plus all tooling. Adds a Playwright e2e safety net so future upgrades can be validated end-to-end against built Storybook stories.

Resolves the full set of sub-issues tracked under Epic #18.

What changed

# Package Before After
#10 react / react-dom (+ types) 18.3.1 19.2.x
#11 storybook + framework/addons 8.6.14 10.3.x
#12 typescript 5.9.3 6.0.x
#13 vitest / @vitest/coverage-v8 (+ vite 8 peer) 2.1.9 4.1.x
#14 eslint / @eslint/js (via @eslint-react migration) 9.39.x 10.3.x
#15 @mui/material (devDep, + @emotion/react) 6.4.3 9.0.x
#16 release-it, lefthook, jsdom, @types/node 17 / 1 / 25 / 22 20 / 2 / 29 / 25
#17 typescript-eslint, @storybook/test (minor/patch) 8.54.x / 8.6.14 8.59.x / 8.6.15
@playwright/test (new) 1.60.x

Notable code changes (beyond pure version bumps)

  • tsconfig.json: explicit types: ["node"] (TS 6 stopped auto-including) and ignoreDeprecations: "6.0" (tsup passes the now-deprecated baseUrl internally to its DTS generator).
  • vitest.config.mts: exclude: [..., 'tests/e2e/**'] so Vitest doesn't pick up Playwright specs.
  • eslint.config.mjs: replaced eslint-plugin-react (no ESLint 10 support yet) with @eslint-react/eslint-plugin and dropped eslint-plugin-react-hooks (now redundant — @eslint-react ships both rules-of-hooks and exhaustive-deps).
  • src/BreakpointContext.tsx: real bug fix — added missing shouldLog dependency to the width-vs-smallest-breakpoint useEffect; adopted React 19 idioms internally (<BreakpointContext value={...}> instead of .Provider, use(BreakpointContext) instead of useContext(...)). Public API unchanged.
  • Playwright: dedicated Storybook port 6010 via pnpm storybook:e2e so the e2e runner doesn't collide with other local Storybooks on 6006.
  • Lefthook v2.1: detected stale husky core.hooksPath and was reset via --reset-hooks-path during install. The .husky/ directory and husky devDep are left for a follow-up cleanup PR — out of scope for this dep upgrade.

Breaking change for consumers

  • engines.node: >=18.0.0>=20.0.0. Node 18 reached EOL on 2025-04-30, and Vitest 4 / React 19 / @types/node 25 require Node 20+.
  • peerDependencies for react / react-dom remain >=17 (the lib doesn't use any React-19-only API; consumer compatibility is preserved).

Test plan

pnpm install
pnpm typecheck
pnpm lint
pnpm test:ci          # 17 unit tests (Vitest 4 + jsdom 29)
pnpm build            # tsup
pnpm storybook:build  # static Storybook 10
pnpm test:e2e:install # one-time on a fresh machine (Chromium download)
pnpm test:e2e         # 5 Playwright specs vs. Storybook on :6010

Current branch state: typecheck ✓, lint ✓ (0 warnings), tests 17/17 ✓, build ✓, storybook:build ✓, e2e 5/5 ✓.

Sub-issues closed by this PR

Closes #10
Closes #11
Closes #12
Closes #13
Closes #14
Closes #15
Closes #16
Closes #17

Closes #18

- Adds @playwright/test 1.60.0 with Chromium-only project
- Dedicated Storybook port 6010 via pnpm storybook:e2e (avoids
  collisions with other Storybooks running on the default 6006)
- Smoke specs verify both stories render without unexpected
  console errors (BreakpointProvider's "Element width is 0"
  init log filtered as known benign)
- Behavioral specs verify breakpoint label at narrow / wide
  viewports and that resize triggers a label update
- vitest excludes tests/e2e/** so Vitest and Playwright don't
  collide on .spec.ts files
- .gitignore: playwright-report/, test-results/, playwright/.cache/
- Bumps engines.node 18 -> 20 (Node 18 EOL since 2025-04-30,
  required for Vitest 4 / React 19 / etc.)

Foundation for the Q2 2026 dependency upgrade epic.

Refs #18
- typescript-eslint: ^8.54.0 -> ^8.59.3
- @storybook/test: 8.6.14 -> 8.6.15

Backward-compatible minor/patch updates.

Refs #17, #18
…e) (#16)

- release-it: 17.11.0 -> ^20.0.1 (spans v18, v19, v20; --dry-run --ci OK)
- lefthook: 1.10.1 -> ^2.1.6 (config format unchanged, our setup compatible)
- jsdom: 25.0.1 -> ^29.1.1 (compatible with Vitest 2; future-proofs Vitest 4)
- @types/node: 22.10.5 -> ^25.7.0 (Node 25 type surface)

Side effect: lefthook v2.1 detected stale husky core.hooksPath
('.husky/_'); ran 'lefthook install --reset-hooks-path' to unset.
.husky/ directory and husky devDep cleanup left for a separate PR.

Refs #16, #18
- typescript: 5.9.3 -> ^6.0.3

tsconfig.json:
- Added "types": ["node"] — TS 6 no longer auto-includes
  @types/node when project files reference globals like 'process';
  this restores the implicit behavior we relied on.
- Added "ignoreDeprecations": "6.0" — tsup's internal DTS
  generator passes baseUrl, which is deprecated in TS 6 and slated
  for removal in TS 7. Silencing here is safe; tsup will need to
  drop the deprecated option before our TS 7 upgrade.

Refs #12, #18
- vitest: ^2.1.9 -> ^4.1.6
- @vitest/coverage-v8: 2.1.9 -> ^4.1.6
- vite: added as ^8.0.12 devDep (Vitest 4 dropped support for
  Vite 5; needs Vite ^6 || ^7 || ^8 as peer)

No vitest.config.mts changes required — our config (environment
'jsdom', setupFiles, exclude, coverage include/exclude) is fully
compatible. Vitest 4 changed default coverage behavior to always
exclude test files, which matches what we want.

Refs #13, #18
- react: 18.3.1 -> ^19.2.6
- react-dom: 18.3.1 -> ^19.2.6
- @types/react: 18.3.13 -> ^19.2.14
- @types/react-dom: 18.3.1 -> ^19.2.3
- Removed react-test-renderer (deprecated in React 19; not used in this project)
- Removed @types/react-test-renderer (corresponding types)

No source code migrations required:
- BreakpointContext.tsx uses no forwardRef / no defaultProps on
  function components / no useRef without arg / no
  react-test-renderer. Context.Provider syntax retained
  (still supported in 19; refactor to <Context value={...}>
  is purely cosmetic).
- react-resize-detector ^12.3.0 already declares peer
  '^18.0.0 || ^19.0.0' — no upstream change needed.
- peerDependencies kept at react/react-dom >=17 to maximize
  consumer compatibility; the lib doesn't use any React 19-only API.

Storybook 8 renders correctly under React 19 (verified via
storybook:build + e2e suite).

Refs #10, #18
- @mui/material: ^6.4.3 -> ^9.0.1 (upstream skipped v8; this spans
  the v6->v7 breaking changes and the v7->v9 jump)
- @emotion/react: added as ^11.14.0 (now a required peer of MUI 9;
  was previously only present transitively)

Stories use only stable MUI primitives (Box, Container, Card,
CardContent, Typography, LinearProgress, useTheme) — no API
changes required. Storybook 8 builds cleanly with MUI 9, and the
Playwright e2e suite confirms both stories still render correctly
across the upgrade.

Refs #15, #18
- storybook: 8.6.14 -> 10.3.6
- @storybook/react-webpack5: 8.6.14 -> 10.3.6
- @storybook/addon-links: 8.6.14 -> 10.3.6
- @storybook/addon-docs: added 10.3.6 (now required for autodocs)
- @storybook/addon-webpack5-compiler-swc: 2.0.0 -> 4.0.3
- eslint-plugin-storybook: added 10.3.6
- Removed packages consolidated into core in Storybook 9:
  @storybook/react, @storybook/blocks, @storybook/addon-essentials,
  @storybook/addon-interactions, @storybook/test

Upgrade was performed in two passes via the official CLI
(8 -> 9 -> 10 — Storybook only allows one major at a time):
  pnpm dlx storybook@9 upgrade --yes
  pnpm dlx storybook@latest upgrade --yes

Config migrations applied automatically:
- .storybook/main.ts: dropped addon-essentials/interactions; added
  addon-docs; removed top-level docs.autodocs (now configured per
  story via tags).
- .storybook/preview.ts: switched type import from @storybook/react
  to @storybook/react-webpack5 (framework-based config).
- src/stories/BreakpointContext.stories.tsx: same type import switch.
- eslint.config.mjs: appended eslint-plugin-storybook flat
  recommended config.

Story IDs and iframe URL pattern unchanged across the upgrade —
existing Playwright e2e suite continues to pass without
modification.

Note: the CLI re-formatted main.ts and eslint.config.mjs (spaces
vs tabs); functional changes only, no behavior impact.

Refs #11, #18
- eslint: ^9.39.2 -> ^10.3.0
- @eslint/js: ^9.39.2 -> ^10.0.1
- Replaced eslint-plugin-react ^7.37.5 with @eslint-react/eslint-plugin ^5.7.6
- Removed eslint-plugin-react-hooks (redundant — @eslint-react ships
  both rules-of-hooks and exhaustive-deps under its own namespace)

Background: eslint-plugin-react@7.37.5 (latest) only supports
ESLint up to 9.7; upstream ESLint 10 work tracked in jsx-eslint/
eslint-plugin-react#3977 has no release yet. @eslint-react is the
actively maintained modern alternative with native ESLint 10
support (peer eslint ^10.3.0).

Config:
- Switched eslint.config.mjs to use eslintReact.configs[
  'recommended-typescript'] (TS-native rules excluded).
- Scoped @eslint-react config to **/*.{ts,tsx}.

Source fixes surfaced by the new ruleset:
- BreakpointContext.tsx: added missing 'shouldLog' dep to the
  width/breakpoint useEffect (real bug — devMode toggling at
  runtime wouldn't have re-evaluated the log gate).
- Adopted React 19 idioms cleanly: <BreakpointContext> instead of
  <BreakpointContext.Provider>, and use(BreakpointContext) instead
  of useContext(BreakpointContext). Public API and behavior are
  unchanged; internal nodes only.

All 17 unit tests + 5 e2e tests pass, build and storybook:build
unchanged.

Closes #14, refs #18
Three CI failures surfaced after the engines.node>=20 bump and the
dep upgrades:

- ci.yml: matrix included 18.x. Vitest 4 imports node:util.styleText
  (Node 20.12+ only), so test (18.x) crashed at startup. Matrix is
  now [20.x, 22.x]; pnpm action-setup bumped v2->v4 and pinned to v10.
  codecov-action also bumped v3->v5 (v3 is deprecated and was hitting
  rate-limit 429s without a token; v5 supports CODECOV_TOKEN).

- main.yml (Test & Build): used pnpm/action-setup@v4 with
  version: latest, which now resolves to pnpm 11 — requires Node
  22.13+ but the job installed Node 20. Pinned pnpm to v10 and bumped
  setup-node to Node 22 for headroom. Also fixed the typecheck step
  from `pnpm tsc` to `pnpm typecheck` so it actually uses our
  configured tsc --noEmit script.

- publish.yml: same `version: latest` pnpm trap as main.yml; pinned
  to v10 and Node 22.

- release.yml: pnpm/action-setup@v2 with version 9 still works on
  Node 20, but updated for consistency to v4/v10 on Node 22.

These are CI plumbing changes that follow from the engines bump in
the foundation commit (5b98936); kept in a separate commit because
they touch workflow files rather than runtime dependencies.

Refs #18
Manual version bump on the epic branch (release-it normally handles
this, but doing it here so the PR shipping Epic #18 lands with the
correct version and CHANGELOG entry).

CHANGELOG documents the full Q2 2026 dependency upgrade: Playwright
e2e suite, Node 20+ engines, React 19, Storybook 10, MUI 9,
TypeScript 6, Vitest 4, ESLint 10 (via @eslint-react migration),
plus tooling and CI updates. The shouldLog dep fix in
BreakpointContext is listed under Fixed.

Refs #18
@smartlabsAT smartlabsAT merged commit 36599b7 into main May 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant