Skip to content

Commit 9725532

Browse files
Upgrade React and Babel for Next.js 16 compatibility (#1156)
* Initial plan * Upgrade React and Babel to fix Next.js 16 peer dependency errors Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com> * Update Node.js version to 20 in CI workflow * Upgrade Node.js version from 18 to 20 in CI --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
1 parent 8c639ad commit 9725532

File tree

5 files changed

+3359
-3021
lines changed

5 files changed

+3359
-3021
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-node@v3
1414
with:
15-
node-version: 18
15+
node-version: 20
1616
- run: yarn
1717
- name: Building
1818
run: yarn build
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v3
3131
- uses: actions/setup-node@v3
3232
with:
33-
node-version: 18
33+
node-version: 20
3434
- uses: actions/download-artifact@v4
3535
with:
3636
name: octicons-build
@@ -52,7 +52,7 @@ jobs:
5252
- uses: actions/checkout@v3
5353
- uses: actions/setup-node@v3
5454
with:
55-
node-version: 18
55+
node-version: 20
5656
- uses: actions/download-artifact@v4
5757
with:
5858
name: octicons-build
@@ -76,7 +76,7 @@ jobs:
7676
- uses: actions/checkout@v3
7777
- uses: actions/setup-node@v3
7878
with:
79-
node-version: 18
79+
node-version: 20
8080
- uses: actions/download-artifact@v4
8181
with:
8282
name: octicons-build

lib/octicons_react/__tests__/tree-shaking.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ test('tree shaking single export', async () => {
5050
})
5151

5252
const bundleSize = Buffer.byteLength(output[0].code.trim()) / 1000
53-
expect(`${bundleSize}kB`).toMatchInlineSnapshot(`"6.292kB"`)
53+
expect(`${bundleSize}kB`).toMatchInlineSnapshot(`"6.084kB"`)
5454
})

lib/octicons_react/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@
4040
"primer"
4141
],
4242
"devDependencies": {
43-
"@babel/core": "7.19.1",
44-
"@babel/generator": "7.19.0",
45-
"@babel/preset-env": "7.19.1",
46-
"@babel/preset-react": "7.18.6",
47-
"@babel/types": "7.19.0",
43+
"@babel/core": "^7.22.0",
44+
"@babel/generator": "^7.22.0",
45+
"@babel/preset-env": "^7.22.0",
46+
"@babel/preset-react": "^7.22.0",
47+
"@babel/types": "^7.22.0",
4848
"@github/prettier-config": "0.0.4",
4949
"@primer/components": "27.0.0",
5050
"@rollup/plugin-babel": "5.3.1",
5151
"@rollup/plugin-commonjs": "22.0.2",
5252
"@rollup/plugin-node-resolve": "14.1.0",
5353
"@rollup/plugin-virtual": "2.1.0",
5454
"@testing-library/jest-dom": "^5.16.5",
55-
"@testing-library/react": "^12.1.5",
56-
"@types/react": "^18.0.20",
55+
"@testing-library/react": "^13.4.0",
56+
"@types/react": "^18.2.0",
5757
"babel-jest": "29.0.3",
5858
"eslint": "^6.5.1",
5959
"eslint-plugin-github": "4.1.3",
@@ -64,8 +64,8 @@
6464
"jest": "^29.0.3",
6565
"jest-environment-jsdom": "29.0.3",
6666
"next": "^16.1.5",
67-
"react": "^17.0.2",
68-
"react-dom": "^17.0.2",
67+
"react": "^18.2.0",
68+
"react-dom": "^18.2.0",
6969
"rimraf": "3.0.2",
7070
"rollup": "^2.79.0",
7171
"styled-components": "^4.2.0",

lib/octicons_react/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import pkg from '../package.json'
44
// eslint-disable-next-line import/no-namespace
55
import * as Octicons from '../'
66

7-
// eslint-disable-next-line no-unused-vars
7+
// eslint-disable-next-line no-unused-vars, import/namespace
88
const {default: _Octicon, ...iconsByName} = Octicons
99

1010
export default function App() {

0 commit comments

Comments
 (0)