Skip to content

Conversation

Copy link

Copilot AI commented Oct 25, 2025

Updates project dependencies to support React 19 while maintaining backward compatibility with React 16-18.

Dependencies

  • React: ^16.9.23^19.0.0 (types: 19.2.2)
  • TypeScript: 3.8.25.9.3
  • Rollup: 1.31.14.52.5
  • Storybook: 5.3.148.5.3
  • peerDependencies: ^16.0.0^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0

Build System

  • Replaced deprecated rollup-plugin-typescript2 with @rollup/plugin-typescript
  • Created standalone tsconfig.json (removed @samuelmeuli/tsconfig dependency)
  • Fixed TS strict mode errors with definite assignment assertions

Storybook Migration

Storybook 8's export-order-loader parses files before babel transformation, causing JSX syntax errors. Workaround:

// Before (fails to parse)
decorators: [(Story) => <div><Story /></div>]

// After (uses createElement)
decorators: [(Story) => React.createElement('div', null, React.createElement(Story))]

Migrated to modern CSF format with separate main.js and preview.jsx configuration files.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • storybook.js.org
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/react-magnifier/react-magnifier/node_modules/.bin/storybook build --output-dir ./dist-storybook/ (dns block)
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/react-magnifier/react-magnifier/node_modules/.bin/storybook dev --port 3000 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Update dependencies and convert to typescript</issue_title>
<issue_description>Convert project to typescript and update dependencies for supporting react 19</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits October 25, 2025 07:05
- Update React and React types to ^19.0.0
- Update TypeScript to ^5.9.3
- Update all dev dependencies (Rollup, ESLint, Prettier, etc.)
- Update peerDependencies to support React 16-19
- Replace deprecated rollup-plugin-typescript2 with @rollup/plugin-typescript
- Add standalone tsconfig.json without deprecated @samuelmeuli/tsconfig
- Fix TypeScript strict mode errors (definite assignment assertions)
- Update build scripts for modern Storybook
- Add missing Storybook dependencies and babel presets

Co-authored-by: bianchimro <234869+bianchimro@users.noreply.github.com>
- Remove babel config to use Storybook's default babel setup
- Convert story files to use React.createElement instead of JSX to avoid export-order-loader parsing issues
- Move decorator to preview.jsx using createElement API
- Rename preview to .jsx extension
- Successfully build both main library and Storybook

Co-authored-by: bianchimro <234869+bianchimro@users.noreply.github.com>
Co-authored-by: bianchimro <234869+bianchimro@users.noreply.github.com>
Copilot AI changed the title [WIP] Update project dependencies and convert to TypeScript Update dependencies for React 19 support Oct 25, 2025
Copilot AI requested a review from bianchimro October 25, 2025 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update dependencies and convert to typescript

2 participants