Skip to content

Commit bd59a67

Browse files
authored
Support for React 19 (#2559)
<!-- How to write a good PR title: - Follow [the Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). - Give as much context as necessary and as little as possible - Prefix it with [WIP] while it’s a work in progress --> ## Self Checklist - [x] I wrote a PR title in **English** and added an appropriate **label** to the PR. - [x] I wrote the commit message in **English** and to follow [**the Conventional Commits specification**](https://www.conventionalcommits.org/en/v1.0.0/). - [x] I [added the **changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) about the changes that needed to be released. (or didn't have to) - [x] I wrote or updated **documentation** related to the changes. (or didn't have to) - [x] I wrote or updated **tests** related to the changes. (or didn't have to) - [x] I tested the changes in various browsers. (or didn't have to) - Windows: Chrome, Edge, (Optional) Firefox - macOS: Chrome, Edge, Safari, (Optional) Firefox ## Related Issue <!-- Please link to issue if one exists --> - Fixes #2558 ## Summary <!-- Please brief explanation of the changes made --> - bezier-react를 React 19 버전으로 업데이트하고, 피어 디펜던시를 업데이트합니다. React 19 버전에서는 17 버전부터 도입된 새로운 JSX tranform을 사용하므로, 이를 지원하지 않는 16.8 버전에 대한 지원은 제거했습니다. 따라서 메이저 버전을 올립니다. - bezier-icons도 마찬가지로 React 19 버전으로 업데이트하고, 옵셔널 피어디펜던시로 React 17 버전 이상을 추가했습니다. bezier-icons는 svg만 사용할 수도 있으므로 옵셔널로 두었습니다. ## Details <!-- Please elaborate description of the changes --> 몇몇 개선사항들 - bezier-react에 새로운 JSX transform을 사용합니다. 사용처에서 번들 사이즈 감소와 성능 향상이 있을 거로 예상합니다. - bezier-icons에 browserlist를 추가하여 불필요한 polyfill이 생기지 않도록 합니다. 원래 `ai.mjs` 파일에 objectSpread2 폴리필이 추가되어있었는데, 제거되었습니다. 마찬가지로 사용처에서 번들 사이즈 감소와 성능 향상이 있을 거로 예상합니다. - babel의 corejs 속성 등 불필요한 속성을 제거했습니다. ### Breaking change? (Yes/No) <!-- If Yes, please describe the impact and migration path for users --> Yes. 더 이상 React 16.8 버전을 지원하지 않습니다. ## References <!-- Please list any other resources or points the reviewer should be aware of --> - https://react.dev/blog/2024/04/25/react-19-upgrade-guide#new-jsx-transform-is-now-required - https://babeljs.io/docs/babel-preset-react#react-automatic-runtime
1 parent 8105deb commit bd59a67

File tree

222 files changed

+314
-435
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+314
-435
lines changed

.changeset/few-walls-design.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@channel.io/bezier-react': major
3+
---
4+
5+
Add support for React 19 and enable new JSX transform. Increase minimum supported React peer dependency version from 16.8 to 17.

.changeset/fifty-gorillas-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@channel.io/bezier-icons': minor
3+
---
4+
5+
Enable new JSX transform and update React peer dependency to be optional for version 17 and above

configs/tsconfig/browser.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$schema": "https://json.schemastore.org/tsconfig",
33
"extends": "@channel.io/typescript-config/web.json",
44
"compilerOptions": {
5+
"jsx": "react-jsx",
56
"allowJs": true
67
}
78
}

configs/tsconfig/node.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"compilerOptions": {
55
"module": "nodenext",
66
"moduleResolution": "nodenext",
7+
"jsx": "react-jsx",
78
"allowJs": true
89
}
910
}

packages/bezier-codemod/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
"@inkjs/ui": "^2.0.0",
3030
"ink": "^5.1.0",
3131
"meow": "^13.2.0",
32-
"react": "^18.3.1",
32+
"react": "^19.0.0",
3333
"ts-morph": "^24.0.0"
3434
},
3535
"devDependencies": {
3636
"@types/node": "^22.10.2",
37-
"@types/react": "^18.3.16",
37+
"@types/react": "^19.0.1",
3838
"eslint-config-bezier": "workspace:*",
3939
"tsconfig": "workspace:*"
4040
},

packages/bezier-codemod/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useEffect, useState } from 'react'
1+
import { useCallback, useEffect, useState } from 'react'
22

33
import {
44
Select,

packages/bezier-codemod/src/cli.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env node
2-
import React from 'react'
32

43
import { render } from 'ink'
54
import meow from 'meow'

packages/bezier-codemod/src/transforms/icon-name-to-bezier-icons/fixtures/input1.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* External dependencies */
2-
import React from 'react'
32
import { Button } from '@channel.io/bezier-react'
43

54
/* Internal dependencies */

packages/bezier-codemod/src/transforms/icon-name-to-bezier-icons/fixtures/input2.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* External dependencies */
2-
import React, { useMemo } from 'react'
2+
import { useMemo } from 'react'
33
import { Button } from '@channel.io/bezier-react'
44
import { ArrowRightIcon } from '@channel.io/bezier-icons'
55

packages/bezier-codemod/src/transforms/icon-name-to-bezier-icons/fixtures/output1.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* External dependencies */
2-
import React from 'react'
32
import { Button } from '@channel.io/bezier-react'
43
import { ArrowLeftIcon, AllIcon } from '@channel.io/bezier-icons'
54

0 commit comments

Comments
 (0)