Skip to content

Commit 29ff245

Browse files
committed
Merge branch 'main' of github.com:primer/react into refactor/update-compiler-to-v1
2 parents db8df9d + 0b559f0 commit 29ff245

File tree

15 files changed

+355
-266
lines changed

15 files changed

+355
-266
lines changed

.changeset/usemedia-ssr-warnings.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ jobs:
5555

5656
test:
5757
runs-on: ubuntu-latest
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
react-version: ['react-18', 'react-19']
5862
steps:
5963
- name: Checkout repository
6064
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
@@ -72,6 +76,8 @@ jobs:
7276
${{ runner.os }}-turbo-
7377
- name: Install dependencies
7478
run: npm ci
79+
- if: ${{ matrix.react-version == 'react-19' }}
80+
run: node script/setup-react-19.mts
7581
- name: Build
7682
run: npm run build
7783
- name: Run tests defined in vitest
@@ -81,6 +87,10 @@ jobs:
8187

8288
type-check:
8389
runs-on: ubuntu-latest
90+
strategy:
91+
fail-fast: false
92+
matrix:
93+
react-version: ['react-18', 'react-19']
8494
steps:
8595
- name: Checkout repository
8696
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
@@ -98,13 +108,19 @@ jobs:
98108
${{ runner.os }}-turbo-
99109
- name: Install dependencies
100110
run: npm ci
111+
- if: ${{ matrix.react-version == 'react-19' }}
112+
run: node script/setup-react-19.mts
101113
- name: Build project
102114
run: npm run build
103115
- name: Type check
104116
run: npm run type-check
105117

106118
examples:
107119
runs-on: ubuntu-latest
120+
strategy:
121+
fail-fast: false
122+
matrix:
123+
react-version: ['react-18', 'react-19']
108124
steps:
109125
- name: Checkout repository
110126
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
@@ -122,6 +138,8 @@ jobs:
122138
${{ runner.os }}-turbo-
123139
- name: Install dependencies
124140
run: npm ci
141+
- if: ${{ matrix.react-version == 'react-19' }}
142+
run: node script/setup-react-19.mts
125143
- name: Build
126144
run: npx turbo build
127145

examples/nextjs/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import './.next/types/routes.d.ts'
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

examples/nextjs/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
"private": true,
55
"scripts": {
66
"clean": "rimraf .next",
7-
"build": "next build --no-lint",
7+
"build": "next build",
88
"develop": "next",
99
"start": "next start",
1010
"type-check": "tsc --noEmit"
1111
},
1212
"dependencies": {
1313
"@primer/react": "38.0.0",
14-
"next": "^15.2.3",
15-
"react": "18.3.1",
16-
"react-dom": "18.3.1",
14+
"@primer/styled-react": "0.2.0",
15+
"next": "^16.0.0",
16+
"react": "^19.2.0",
17+
"react-dom": "^19.2.0",
1718
"typescript": "^5.9.2"
1819
},
1920
"devDependencies": {

examples/nextjs/src/app/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import './global.css'
22
import {ThemeProvider, BaseStyles} from '@primer/react'
3+
import type {Metadata} from 'next'
34

4-
export const metadata = {
5+
export const metadata: Metadata = {
56
title: 'Next.js',
67
description: 'Generated by Next.js',
78
}
@@ -10,7 +11,7 @@ export default function RootLayout({children}: {children: React.ReactNode}) {
1011
return (
1112
// Note: the focus-visible polyfill adds additional attributes to `html`
1213
// that cause hydration mismatch errors
13-
<html lang="en" suppressHydrationWarning>
14+
<html lang="en" data-light-theme="light" data-dark-theme="dark" data-color-mode="auto" suppressHydrationWarning>
1415
<body>
1516
<ThemeProvider colorMode="auto">
1617
<BaseStyles style={{backgroundColor: 'var(--bgColor-default)', height: '100vh'}}>{children}</BaseStyles>

examples/nextjs/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"moduleResolution": "bundler",
1616
"resolveJsonModule": true,
1717
"isolatedModules": true,
18-
"jsx": "preserve",
18+
"jsx": "react-jsx",
1919
"plugins": [
2020
{
2121
"name": "next"
@@ -27,7 +27,8 @@
2727
"next-env.d.ts",
2828
".next/types/**/*.ts",
2929
"**/*.ts",
30-
"**/*.tsx"
30+
"**/*.tsx",
31+
".next/dev/types/**/*.ts"
3132
],
3233
"exclude": [
3334
"node_modules"

examples/theming/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import './.next/types/routes.d.ts'
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

examples/theming/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"scripts": {
66
"clean": "rimraf .next",
7-
"build": "next build --no-lint",
7+
"build": "next build",
88
"develop": "next",
99
"start": "next start",
1010
"type-check": "tsc --noEmit"
@@ -14,9 +14,9 @@
1414
"@primer/react": "38.0.0",
1515
"@primer/styled-react": "0.2.0",
1616
"clsx": "^2.1.1",
17-
"next": "^15.2.3",
18-
"react": "18.3.1",
19-
"react-dom": "18.3.1",
17+
"next": "^16.0.0",
18+
"react": "^19.2.0",
19+
"react-dom": "^19.2.0",
2020
"styled-components": "5.x",
2121
"typescript": "^5.9.2"
2222
},

examples/theming/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"moduleResolution": "bundler",
1616
"resolveJsonModule": true,
1717
"isolatedModules": true,
18-
"jsx": "preserve",
18+
"jsx": "react-jsx",
1919
"plugins": [
2020
{
2121
"name": "next"
@@ -27,7 +27,8 @@
2727
"next-env.d.ts",
2828
".next/types/**/*.ts",
2929
"**/*.ts",
30-
"**/*.tsx"
30+
"**/*.tsx",
31+
".next/dev/types/**/*.ts"
3132
],
3233
"exclude": [
3334
"node_modules"

0 commit comments

Comments
 (0)