-
Notifications
You must be signed in to change notification settings - Fork 382
PR 1.5 - Pin React to 18.3.1 #3152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Pin react-router and react-router-dom to exact 7.8.2 - Pin @react-router/* packages to exact 7.8.2 - Remove version ranges (~, ^) to ensure consistency - Update all packages, templates, and examples - Update package-lock.json to lock exact versions
- Add @react-router/dev and @react-router/fs-routes to root devDependencies - Ensures packages are available in root node_modules for test symlinks - Fixes CLI setup test that creates temporary directories
…2 compatibility - Add .react-router to .gitignore (generated by React Router 7.8.2) - Remove deprecated --ext flag from example lint scripts for ESLint 9 compatibility
- React Router 7.8.2 requires loaderData to be non-optional in UIMatch type - Add loaderData property to fillMatch helper in seo.test.ts
- Upgrade TypeScript to 5.9.2 across all packages - Fix enum compatibility between Storefront and Customer Account APIs - Fix Navigation type mocks in hydrogen package tests - Fix BodyInit type compatibility in cache implementation
… USDC currency (#3090) * Fix Money component compatibility with Customer Account API USDC currency The 2025-07 API update introduced USDC currency code to Customer Account API but not Storefront API, causing TypeScript errors and runtime failures. Changes: - Update Money component to accept MoneyV2 from both Storefront and Customer Account APIs via union types - Enhance useMoney hook to detect unsupported currency codes (like USDC) and gracefully fall back to decimal formatting - Add currency code suffix for unsupported currencies (e.g., "100.00 USDC") to maintain clarity - Default to 2 decimal places for USDC to reinforce its 1:1 USD peg based on industry standards Technical details: - Handle Intl.NumberFormat RangeError for cryptocurrency codes not in ISO 4217 - Add comprehensive test coverage for both API types and USDC formatting - Update TypeScript types to support both CurrencyCode enums Fixes #3089 * Add changeset for Money component USDC compatibility fix * Add build script to copy customer-account-api-types to dist Since our Money component now imports from customer-account-api-types, we need to ensure this file is copied to the dist folder during the build process. Previously, only storefront-api-types was being copied. - Replace copy-storefront-types with copy-api-types script that copies both API type files - Update build and dev:demo scripts to use the new copy-api-types script - This fixes the CI build failure where customer-account-api-types.d.ts was not found in dist * Trigger CI rebuild
Add missing dependencies to useMemo hook to satisfy react-hooks/exhaustive-deps rule
Move params initialization inside useMemo to avoid recreating on every render
…te dependencies This commit addresses critical TypeScript 5.9 compatibility issues that were blocking the React Router 7.8.x migration. The changes ensure all CI checks pass with zero errors. ## Key Changes: ### ESLint TypeScript Compatibility - Removed unused `eslint-plugin-hydrogen` package that was causing TypeScript version conflicts - Updated `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` to v8.42.0 - Pinned all ESLint-related package versions for consistency and reproducibility ### Fixed Lint Errors Across Examples - GTM example: Added missing `ready` and `subscribe` dependencies to useEffect hooks - Partytown example: Added missing `location.pathname` dependency, fixed iframe accessibility - Subscriptions example: Replaced deprecated @ts-ignore with @ts-expect-error directives - Added missing iframe title attributes for accessibility compliance ### Build Configuration - Added `dist/` to eslint ignores in skeleton template to prevent linting of built files - Standardized ESLint configuration across all examples using flat config format - Created eslint.config.js files for all examples to ensure consistent linting ### Dependencies - Added `@total-typescript/ts-reset@0.6.1` at monorepo level (pinned version) - Fixed duplicate import issue in hydrogen/src/seo/seo.ts ## Technical Details: The root cause was eslint-plugin-hydrogen depending on an older version of @typescript-eslint packages that don't support TypeScript 5.9. Since the plugin wasn't actively used in the codebase, removing it was the cleanest solution. All ESLint packages are now pinned to specific versions to prevent future compatibility issues during dependency updates. ## Testing: - ✅ All lint checks pass - ✅ All typecheck passes - ✅ No ESLint warnings about TypeScript version compatibility - ✅ All examples build successfully
These files were added during development but should not be part of the final PR: - Removed .github/pr-plans/ directory (planning documentation) - Removed .changeset/ files added during development These are internal development artifacts not needed for the React Router 7.8.x migration.
…r Customer Account enums - Configure Customer Account API codegen to reference Storefront API types for LanguageCode and CurrencyCode enums - Ensures type compatibility between APIs when passing i18n.language from Storefront to Customer Account API - Regenerate Customer Account API types with proper enum references - Resolves TypeScript errors in skeleton template account routes
- Remove CI_ISSUES_REPORT.md and PR1_STATUS.md files - Restore deleted changeset file dry-swans-relate.md - Improve comment for SellingPlanGroup type assertion
- Remove .claude/commands/shopify-cli-update.md file - Regenerate GraphQL types to ensure correctness - Add changeset for enum compatibility fix
- Resolved conflicts in codegen.ts by merging both approaches - Used typescript-lint version of customer-account-api-types.d.ts - Added CountryCode to enumValues configuration - Restored .claude/commands/shopify-cli-update.md file
|
We detected some changes in |
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
| "optionalDependencies": { | ||
| "@rollup/rollup-linux-x64-gnu": "^4.34.9" | ||
| "@rollup/rollup-linux-x64-gnu": "^4.34.9", | ||
| "@ast-grep/napi-linux-x64-gnu": "0.34.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
… API - Remove enumValues override that forced Customer Account API to use Storefront API types - Allow Customer Account API to generate its own enum types (including USDC currency) - Update Money component and useMoney hook to handle union types properly - Fix test helper to use USDC as example of Customer Account API-specific currency - This properly supports runtime values like USDC that Customer Account API can return
This file was inadvertently modified in commit 054c2b3 and should match the base branch version
- Pin React to exactly 18.3.1 (no ^ or ~) in all packages - Pin React-DOM to exactly 18.3.1 where used - This resolves React version mismatch issues in monorepo - Fixes create-hydrogen test failures due to multiple React instances
- Pin React and React-DOM to exact version 18.3.1 in all packages - Add npm overrides to force React 18.3.1 for transitive dependencies - Fixes React hook errors caused by multiple React versions - All tests now passing (381 tests across 45 files)
- Add @ast-grep/napi-linux-x64-gnu as optional dependency - Fixes CLI tests failing in Linux CI environment - Module was missing causing MODULE_NOT_FOUND errors
1943d3d to
0d90e88
Compare
Resolved conflicts: - package.json: Kept React/React-DOM pinned to 18.3.1, added from main - packages/cli/package.json: Added @remix-run/dev from main - packages/hydrogen/package.json: Kept React pinned to 18.3.1 in peerDeps - packages/hydrogen-react tests: Took main's version with USDC tests - templates/skeleton/package.json: React 18.3.1 + CLI ~3.83.3 from main - examples/express/package.json: Kept React pinned to 18.3.1 - Schema files: Accepted main's 2025-07 API versions - package-lock.json: Regenerated fresh All CI checks passing: typecheck, tests, lint, build
* feat: pin React Router to exact version 7.8.2 across monorepo - Pin react-router and react-router-dom to exact 7.8.2 - Pin @react-router/* packages to exact 7.8.2 - Remove version ranges (~, ^) to ensure consistency - Update all packages, templates, and examples - Update package-lock.json to lock exact versions * fix: hoist @react-router/dev and fs-routes to fix CLI tests - Add @react-router/dev and @react-router/fs-routes to root devDependencies - Ensures packages are available in root node_modules for test symlinks - Fixes CLI setup test that creates temporary directories * fix: update .gitignore and example lint scripts for React Router 7.8.2 compatibility - Add .react-router to .gitignore (generated by React Router 7.8.2) - Remove deprecated --ext flag from example lint scripts for ESLint 9 compatibility * fix: update UIMatch test helper for React Router 7.8.2 compatibility - React Router 7.8.2 requires loaderData to be non-optional in UIMatch type - Add loaderData property to fillMatch helper in seo.test.ts * Lint and format * Lint and format * Add changeset * fix: TypeScript 5.9 compatibility updates - Upgrade TypeScript to 5.9.2 across all packages - Fix enum compatibility between Storefront and Customer Account APIs - Fix Navigation type mocks in hydrogen package tests - Fix BodyInit type compatibility in cache implementation * [2025-07] Fix Money component compatibility with Customer Account API USDC currency (#3090) * Fix Money component compatibility with Customer Account API USDC currency The 2025-07 API update introduced USDC currency code to Customer Account API but not Storefront API, causing TypeScript errors and runtime failures. Changes: - Update Money component to accept MoneyV2 from both Storefront and Customer Account APIs via union types - Enhance useMoney hook to detect unsupported currency codes (like USDC) and gracefully fall back to decimal formatting - Add currency code suffix for unsupported currencies (e.g., "100.00 USDC") to maintain clarity - Default to 2 decimal places for USDC to reinforce its 1:1 USD peg based on industry standards Technical details: - Handle Intl.NumberFormat RangeError for cryptocurrency codes not in ISO 4217 - Add comprehensive test coverage for both API types and USDC formatting - Update TypeScript types to support both CurrencyCode enums Fixes #3089 * Add changeset for Money component USDC compatibility fix * Add build script to copy customer-account-api-types to dist Since our Money component now imports from customer-account-api-types, we need to ensure this file is copied to the dist folder during the build process. Previously, only storefront-api-types was being copied. - Replace copy-storefront-types with copy-api-types script that copies both API type files - Update build and dev:demo scripts to use the new copy-api-types script - This fixes the CI build failure where customer-account-api-types.d.ts was not found in dist * Trigger CI rebuild * Suggested money changes for PR #3090 (#3097) * fix: resolve eslint dependency issue in subscriptions example Add missing dependencies to useMemo hook to satisfy react-hooks/exhaustive-deps rule * fix: properly fix useMemo dependencies in subscriptions example Move params initialization inside useMemo to avoid recreating on every render * fix: resolve TypeScript 5.9 compatibility issues with ESLint and update dependencies This commit addresses critical TypeScript 5.9 compatibility issues that were blocking the React Router 7.8.x migration. The changes ensure all CI checks pass with zero errors. ## Key Changes: ### ESLint TypeScript Compatibility - Removed unused `eslint-plugin-hydrogen` package that was causing TypeScript version conflicts - Updated `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` to v8.42.0 - Pinned all ESLint-related package versions for consistency and reproducibility ### Fixed Lint Errors Across Examples - GTM example: Added missing `ready` and `subscribe` dependencies to useEffect hooks - Partytown example: Added missing `location.pathname` dependency, fixed iframe accessibility - Subscriptions example: Replaced deprecated @ts-ignore with @ts-expect-error directives - Added missing iframe title attributes for accessibility compliance ### Build Configuration - Added `dist/` to eslint ignores in skeleton template to prevent linting of built files - Standardized ESLint configuration across all examples using flat config format - Created eslint.config.js files for all examples to ensure consistent linting ### Dependencies - Added `@total-typescript/ts-reset@0.6.1` at monorepo level (pinned version) - Fixed duplicate import issue in hydrogen/src/seo/seo.ts ## Technical Details: The root cause was eslint-plugin-hydrogen depending on an older version of @typescript-eslint packages that don't support TypeScript 5.9. Since the plugin wasn't actively used in the codebase, removing it was the cleanest solution. All ESLint packages are now pinned to specific versions to prevent future compatibility issues during dependency updates. ## Testing: - ✅ All lint checks pass - ✅ All typecheck passes - ✅ No ESLint warnings about TypeScript version compatibility - ✅ All examples build successfully * ci: trigger CI workflows * chore: remove pr-plans and changeset files from migration branch These files were added during development but should not be part of the final PR: - Removed .github/pr-plans/ directory (planning documentation) - Removed .changeset/ files added during development These are internal development artifacts not needed for the React Router 7.8.x migration. * fix(hydrogen-react): update codegen.ts to use Storefront API types for Customer Account enums - Configure Customer Account API codegen to reference Storefront API types for LanguageCode and CurrencyCode enums - Ensures type compatibility between APIs when passing i18n.language from Storefront to Customer Account API - Regenerate Customer Account API types with proper enum references - Resolves TypeScript errors in skeleton template account routes * fix: address PR review feedback - Remove CI_ISSUES_REPORT.md and PR1_STATUS.md files - Restore deleted changeset file dry-swans-relate.md - Improve comment for SellingPlanGroup type assertion * fix: address PR review feedback - Remove .claude/commands/shopify-cli-update.md file - Regenerate GraphQL types to ensure correctness - Add changeset for enum compatibility fix * fix(hydrogen-react): restore separate enum types for Customer Account API - Remove enumValues override that forced Customer Account API to use Storefront API types - Allow Customer Account API to generate its own enum types (including USDC currency) - Update Money component and useMoney hook to handle union types properly - Fix test helper to use USDC as example of Customer Account API-specific currency - This properly supports runtime values like USDC that Customer Account API can return * chore: remove unrelated shopify-cli-update.md changes This file was inadvertently modified in commit 054c2b3 and should match the base branch version * fix: pin React and React-DOM to 18.3.1 across monorepo - Pin React to exactly 18.3.1 (no ^ or ~) in all packages - Pin React-DOM to exactly 18.3.1 where used - This resolves React version mismatch issues in monorepo - Fixes create-hydrogen test failures due to multiple React instances * fix: pin React to 18.3.1 across monorepo to resolve version conflicts - Pin React and React-DOM to exact version 18.3.1 in all packages - Add npm overrides to force React 18.3.1 for transitive dependencies - Fixes React hook errors caused by multiple React versions - All tests now passing (381 tests across 45 files) * fix: add missing ast-grep Linux x64 optional dependency for CI - Add @ast-grep/napi-linux-x64-gnu as optional dependency - Fixes CLI tests failing in Linux CI environment - Module was missing causing MODULE_NOT_FOUND errors --------- Co-authored-by: Kara Daviduik <105449131+kdaviduik@users.noreply.github.com>
WHY are these changes introduced?
During the React Router 7.8.x migration, tests were failing with React hook errors ("Invalid hook call" / "Cannot read properties of null"). Investigation revealed multiple React versions were being resolved in the monorepo:
This caused duplicate React instances, breaking hooks and causing 237+ test failures.
WHAT is this pull request doing?
This PR pins React and React-DOM to exactly version 18.3.1 across the entire monorepo to ensure a single React version:
Updated all package.json files to use exact version
18.3.1(no^or~)Added npm overrides in root package.json to force React 18.3.1 for all transitive dependencies:
HOW to test your changes?
npm installfrom the rootnpm ls react --depth=0npm testnpm run typechecknpm run buildAll tests should pass (381 tests across 45 files).
Post-merge steps
None required.
Checklist