Skip to content
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

Upgrade paste to react 19 #4258

Merged
merged 33 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
47ad1e1
feat(core): update react version to 19
PixeledCode Feb 28, 2025
1b1bacf
feat(core): address TS errors
PixeledCode Feb 28, 2025
30029e6
feat(core): update yarn lock
PixeledCode Mar 1, 2025
7cf28df
feat(core): update button tests
PixeledCode Mar 3, 2025
0bf4b3d
feat(core): format
PixeledCode Mar 3, 2025
abb7dd3
feat(core): import JSX type
PixeledCode Mar 3, 2025
7620ea9
feat(core): format
PixeledCode Mar 3, 2025
7c8214a
feat(core): update type docs
PixeledCode Mar 3, 2025
97038cd
feat(website): update to next 15
PixeledCode Mar 3, 2025
0df2ffb
feat(core): update package json of website
PixeledCode Mar 3, 2025
7158061
feat(core): run codemod
PixeledCode Mar 4, 2025
9144946
feat(core): update emotion
PixeledCode Mar 4, 2025
9c77098
feat(core): replace ReactChild with ReactNode
PixeledCode Mar 4, 2025
8fbeb19
feat(core): fix api path
PixeledCode Mar 4, 2025
71cb06b
feat(core): replace css with style
PixeledCode Mar 4, 2025
5f0f6cc
React 19 intersection (#4262)
PixeledCode Mar 6, 2025
d64c0e7
Merge branch 'main' into upgrade-react-19
PixeledCode Mar 6, 2025
e83002f
feat(core): update typedocs
PixeledCode Mar 6, 2025
650d33e
feat(website): fix build
PixeledCode Mar 6, 2025
d883c1f
feat(button): fix reset button
PixeledCode Mar 7, 2025
2efb751
feat(core): remove react 16 tests
PixeledCode Mar 7, 2025
c369526
feat(core): update doc
PixeledCode Mar 7, 2025
ac728e0
feat(core): update yarn file for tests
PixeledCode Mar 7, 2025
00c3755
feat(core): update testing-library for react 18 tests
PixeledCode Mar 7, 2025
9fe4d44
feat(core): update yarn file
PixeledCode Mar 7, 2025
af4404e
feat(core): update importd
PixeledCode Mar 7, 2025
d5bf0dc
feat(storybook): working stories (#4265)
krisantrobus Mar 7, 2025
9f769c5
fix(types): add correct types for react 19 codemod changes (#4266)
krisantrobus Mar 10, 2025
901184c
feat(core): remove react 16 from peer dependencies
PixeledCode Mar 11, 2025
5ce4089
Merge branch 'main' into upgrade-react-19
PixeledCode Mar 18, 2025
8b74e15
feat(core): add changeset
PixeledCode Mar 18, 2025
b35c968
Update changeset
PixeledCode Mar 19, 2025
d10bb6c
feat(core): update changeset
PixeledCode Mar 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
120 changes: 120 additions & 0 deletions .changeset/forty-planes-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
"@twilio-paste/account-switcher": major
"@twilio-paste/ai-chat-log": major
"@twilio-paste/alert": major
"@twilio-paste/alert-dialog": major
"@twilio-paste/anchor": major
"@twilio-paste/avatar": major
"@twilio-paste/badge": major
"@twilio-paste/base-radio-checkbox": major
"@twilio-paste/blockquote": major
"@twilio-paste/breadcrumb": major
"@twilio-paste/button": major
"@twilio-paste/button-group": major
"@twilio-paste/callout": major
"@twilio-paste/card": major
"@twilio-paste/chart-provider": major
"@twilio-paste/chat-composer": major
"@twilio-paste/chat-log": major
"@twilio-paste/checkbox": major
"@twilio-paste/code-block": major
"@twilio-paste/combobox": major
"@twilio-paste/corner-ornament": major
"@twilio-paste/data-grid": major
"@twilio-paste/date-picker": major
"@twilio-paste/description-list": major
"@twilio-paste/detail-text": major
"@twilio-paste/disclosure": major
"@twilio-paste/display-heading": major
"@twilio-paste/display-pill-group": major
"@twilio-paste/editable-code-block": major
"@twilio-paste/example-text": major
"@twilio-paste/file-picker": major
"@twilio-paste/file-uploader": major
"@twilio-paste/form": major
"@twilio-paste/form-pill-group": major
"@twilio-paste/heading": major
"@twilio-paste/help-text": major
"@twilio-paste/in-page-navigation": major
"@twilio-paste/inline-code": major
"@twilio-paste/inline-control-group": major
"@twilio-paste/input": major
"@twilio-paste/input-box": major
"@twilio-paste/keyboard-key": major
"@twilio-paste/label": major
"@twilio-paste/list": major
"@twilio-paste/menu": major
"@twilio-paste/meter": major
"@twilio-paste/minimizable-dialog": major
"@twilio-paste/modal": major
"@twilio-paste/page-header": major
"@twilio-paste/pagination": major
"@twilio-paste/paragraph": major
"@twilio-paste/popover": major
"@twilio-paste/product-switcher": major
"@twilio-paste/progress-bar": major
"@twilio-paste/progress-steps": major
"@twilio-paste/radio-button-group": major
"@twilio-paste/radio-group": major
"@twilio-paste/screen-reader-only": major
"@twilio-paste/select": major
"@twilio-paste/separator": major
"@twilio-paste/side-modal": major
"@twilio-paste/side-panel": major
"@twilio-paste/sidebar": major
"@twilio-paste/skeleton-loader": major
"@twilio-paste/slider": major
"@twilio-paste/spinner": major
"@twilio-paste/status": major
"@twilio-paste/summary-detail": major
"@twilio-paste/switch": major
"@twilio-paste/table": major
"@twilio-paste/tabs": major
"@twilio-paste/textarea": major
"@twilio-paste/time-picker": major
"@twilio-paste/timeline": major
"@twilio-paste/toast": major
"@twilio-paste/tooltip": major
"@twilio-paste/topbar": major
"@twilio-paste/truncate": major
"@twilio-paste/user-dialog": major
"@twilio-paste/visual-picker": major
"@twilio-paste/core": major
"@twilio-paste/aspect-ratio": major
"@twilio-paste/flex": major
"@twilio-paste/grid": major
"@twilio-paste/media-object": major
"@twilio-paste/stack": major
"@twilio-paste/box": major
"@twilio-paste/combobox-primitive": major
"@twilio-paste/disclosure-primitive": major
"@twilio-paste/listbox-primitive": major
"@twilio-paste/menu-primitive": major
"@twilio-paste/modal-dialog-primitive": major
"@twilio-paste/non-modal-dialog-primitive": major
"@twilio-paste/sibling-box": major
"@twilio-paste/tabs-primitive": major
"@twilio-paste/text": major
"@twilio-paste/tooltip-primitive": major
"@twilio-paste/customization": major
"@twilio-paste/icons": major
"@twilio-paste/animation-library": major
"@twilio-paste/clipboard-copy-library": major
"@twilio-paste/code-editor-library": major
"@twilio-paste/data-visualization-library": major
"@twilio-paste/dropdown-library": major
"@twilio-paste/lexical-library": major
"@twilio-paste/react-spectrum-library": major
"@twilio-paste/react-textarea-autosize-library": major
"@twilio-paste/reakit-library": major
"@twilio-paste/styling-library": major
"@twilio-paste/syntax-highlighter-library": major
"@twilio-paste/uid-library": major
"@twilio-paste/style-props": major
"@twilio-paste/theme": major
"@twilio-paste/types": major
"@twilio-paste/utils": major
"@twilio-paste/token-contrast-checker": minor
---

[account-switcher, ai-chat-log, alert, alert-dialog, anchor, avatar, badge, base-radio-checkbox, blockquote, breadcrumb, button, button-group, callout, card, chart-provider, chat-composer, chat-log, checkbox, code-block, combobox, corner-ornament, data-grid, date-picker, description-list, detail-text, disclosure, display-heading, display-pill-group, editable-code-block, example-text, file-picker, file-uploader, form, form-pill-group, heading, help-text, in-page-navigation, inline-code, inline-control-group, input, input-box, keyboard-key, label, list, menu, meter, minimizable-dialog, modal, page-header, pagination, paragraph, popover, product-switcher, progress-bar, progress-steps, radio-button-group, radio-group, screen-reader-only, select, separator, side-modal, side-panel, sidebar, skeleton-loader, slider, spinner, status, summary-detail, switch, table, tabs, textarea, time-picker, timeline, toast, tooltip, topbar, truncate, user-dialog, visual-picker, core, aspect-ratio, flex, grid, media-object, stack, box, combobox-primitive, disclosure-primitive, listbox-primitive, menu-primitive, modal-dialog-primitive, non-modal-dialog-primitive, sibling-box, tabs-primitive, text, tooltip-primitive, customization, icons, animation-library, clipboard-copy-library, code-editor-library, data-visualization-library, dropdown-library, lexical-library, react-spectrum-library, react-textarea-autosize-library, reakit-library, styling-library, syntax-highlighter-library, uid-library, style-props, theme, token-contrast-checker, types, utils]: Upgrade to react 19 and drop support for react 16
4 changes: 2 additions & 2 deletions .danger/__fixtures__/mock_package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"@twilio-paste/design-tokens": "^8.0.0",
"@twilio-paste/styling-library": "^1.0.0",
"@twilio-paste/types": "^3.1.1",
"react": "^16.8.6 || ^17.0.2",
"react-dom": "^16.8.6 || ^17.0.2"
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@twilio-paste/animation-library": "^0.3.7",
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
parserOptions: {
project: "./tsconfig.json",
},
plugins: ["eslint-comments", "jest", "unicorn", "promise", "@emotion/eslint-plugin", "paste-internal"],
plugins: ["eslint-comments", "jest", "unicorn", "promise", "@emotion/eslint-plugin", "paste-internal", "storybook"],
extends: [
"twilio-react",
"twilio-ts",
Expand Down
33 changes: 16 additions & 17 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
run: yarn lint

tests:
name: Test repository using React 18
name: Test repository using React 19
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand Down Expand Up @@ -162,8 +162,8 @@ jobs:
- name: Run tests
run: yarn test

react17_tests:
name: Test repository using React 17
react18_tests:
name: Test repository using React 18
runs-on: ubuntu-latest
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
Expand Down Expand Up @@ -202,19 +202,18 @@ jobs:
- name: Build packages
run: yarn build

- name: Install React 17
- name: Install React 18
run: |
yarn add @types/react@^17.0.0 react@^17.0.2 react-dom@^17.0.2
yarn set resolution react@npm:^18.0.0 ^17.0.2
yarn set resolution @types/react@npm:^18.0.0 ^17.0.31
yarn set resolution react-dom@npm:^18.0.0 ^17.0.2
yarn set resolution @testing-library/react@npm:^13.4.0 ^12.1.4
yarn add @types/react@^18.0.27 react@^18.0.0 react-dom@^18.0.0
yarn set resolution react@npm:^19.0.0 ^18.0.0
yarn set resolution @types/react@npm:^19.0.0 ^18.0.27
yarn set resolution react-dom@npm:^19.0.0 ^18.0.0

- name: Run tests
run: yarn test

react16_tests:
name: Test repository using React 16
react17_tests:
name: Test repository using React 17
runs-on: ubuntu-latest
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
Expand Down Expand Up @@ -253,13 +252,13 @@ jobs:
- name: Build packages
run: yarn build

- name: Install React 16
- name: Install React 17
run: |
yarn add @types/react@^16.0.0 react@^16.8.6 react-dom@^16.8.6
yarn set resolution react@npm:^18.0.0 ^16.8.6
yarn set resolution @types/react@npm:^18.0.0 ^16.0.0
yarn set resolution react-dom@npm:^18.0.0 ^16.8.6
yarn set resolution @testing-library/react@npm:^13.4.0 ^12.1.4
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this since react 18 works with latest version of @testing-library/react

yarn add @types/react@^17.0.0 react@^17.0.2 react-dom@^17.0.2
yarn set resolution react@npm:^19.0.0 ^17.0.2
yarn set resolution @types/react@npm:^19.0.0 ^17.0.31
yarn set resolution react-dom@npm:^19.0.0 ^17.0.2
yarn set resolution @testing-library/react@npm:^16.2.0 ^12.1.4

- name: Run tests
run: yarn test
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ cypress/downloads
out
.vscode-test

.nx/cache
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after rebuilding some directory other than cache was being added in git

.nx
3 changes: 2 additions & 1 deletion .storybook/addons/google-analytics/register.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { addons } = require("@storybook/addons");
const { addons } = require("@storybook/manager-api");

const isChromatic = require("chromatic/isChromatic").default;
const { STORY_ERRORED, STORY_MISSING, STORY_RENDERED } = require("@storybook/core-events");
const ReactGA = require("react-ga");
Expand Down
7 changes: 7 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import path from "path";
import type { StorybookConfig } from "@storybook/react-vite";
import { mergeConfig } from "vite";
import turbosnap from "vite-plugin-turbosnap";

const config: StorybookConfig = {
stories: [
"../packages/**/*.stories.@(js|jsx|ts|tsx|mdx)",
Expand All @@ -22,7 +23,9 @@ const config: StorybookConfig = {
typescript: {
// enable type checking
check: true,
reactDocgen: "react-docgen-typescript",
},

async viteFinal(config, { configType }) {
const isTest = process.env.NODE_ENV === "test";
return mergeConfig(config, {
Expand Down Expand Up @@ -57,5 +60,9 @@ const config: StorybookConfig = {
},
});
},

docs: {
autodocs: false,
},
};
export default config;
1 change: 0 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ export const decorators = [

export const parameters = {
isTestEnvironment,
actions: { argTypesRegex: "^on[A-Z].*" },
viewport: {
viewports: INITIAL_VIEWPORTS,
},
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ When a package has a peer dependency on another internal package in the mono rep
{
"name": "button",
"peerDependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6"
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@twilio-paste/box": "^0.0.1",
"@twilio-paste/theme": "^0.0.1",
"@twilio-paste/design-tokens": "^0.0.1",
Expand Down
10 changes: 5 additions & 5 deletions internal-docs/engineering/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
- [Build system packages](#build-system-packages)
- [Type Check](#type-check)
- [Lint](#lint)
- [Test React 18](#test-react-18)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: yay documentation! 👏

- [Test React 17](#test-react-17)
- [Test React 16](#test-react-16)
- [Code formatting checks](#code-formatting-checks)
- [Categorize the PR using labels](#categorize-the-pr-using-labels)
- [Danger checks](#danger-checks)
Expand Down Expand Up @@ -47,13 +47,13 @@ This job downloads the build cache of the monorepo, and then runs the Typescript

This job downloads the build cache of the monorepo, and then runs ESLint.

### Test React 17
### Test React 18

This job downloads the build cache of the monorepo, and then runs our Jest test suite using React 17.
This job downloads the build cache of the monorepo, and then runs our Jest test suite using React 18.

### Test React 16
### Test React 17

This job downloads the build cache of the monorepo, and then runs our Jest test suite using React 16.
This job downloads the build cache of the monorepo, and then runs our Jest test suite using React 17.

### Code formatting checks

Expand Down
35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,29 +121,28 @@
"@octokit/graphql-schema": "^14.39.1",
"@percy/cli": "^1.10.1",
"@percy/cypress": "^3.1.2",
"@storybook/addon-a11y": "7.6.4",
"@storybook/addon-actions": "7.6.4",
"@storybook/addon-essentials": "7.6.4",
"@storybook/addon-interactions": "7.6.4",
"@storybook/addon-links": "7.6.4",
"@storybook/addons": "7.6.4",
"@storybook/cli": "7.6.4",
"@storybook/react": "7.6.4",
"@storybook/react-vite": "7.6.4",
"@storybook/test-runner": "0.16.0",
"@storybook/testing-library": "0.2.2",
"@storybook/addon-a11y": "^8.6.4",
"@storybook/addon-actions": "^8.6.4",
"@storybook/addon-essentials": "^8.6.4",
"@storybook/addon-interactions": "^8.6.4",
"@storybook/addon-links": "^8.6.4",
"@storybook/cli": "^8.6.4",
"@storybook/manager-api": "^8.6.4",
"@storybook/react": "^8.6.4",
"@storybook/react-vite": "^8.6.4",
"@storybook/test-runner": "^0.22.0",
"@swc/core": "^1.2.160",
"@swc/jest": "^0.2.20",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/react": "^16.2.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^13.5.0",
"@twilio-labs/svg-to-react": "^2.1.1",
"@types/browser-sync": "^2.26.3",
"@types/color": "^3.0.0",
"@types/jest": "^24.0.18",
"@types/node": "^20.0.0",
"@types/react": "^18.0.27",
"@types/react": "^19.0.8",
"@types/react-color": "^3.0.6",
"@types/react-github-button": "^0.1.1",
"@types/react-helmet": "^6.1.6",
Expand Down Expand Up @@ -176,14 +175,14 @@
"eslint-config-twilio-ts": "2.0.0",
"eslint-plugin-cypress": "2.12.1",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-import": "2.27.2",
"eslint-plugin-jest": "26.1.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": "6.0.0",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.4.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-storybook": "0.8.0",
"eslint-plugin-unicorn": "40.1.0",
"evergreen-ui": "^7.0.0",
"git-branch-is": "^3.0.0",
Expand All @@ -205,15 +204,15 @@
"plop": "^3.0.0",
"precise-commits": "^1.0.2",
"prettier": "^2.8.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-ga": "^3.3.0",
"react-helmet": "^6.1.0",
"react-router-dom": "6.2.1",
"search-in-file": "^1.2.2",
"shelljs": "^0.8.5",
"start-server-and-test": "^2.0.3",
"storybook": "7.6.4",
"storybook": "^8.6.4",
"terser": "^5.14.2",
"theo": "^8.1.5",
"tslib": "^2.0.3",
Expand Down
Loading
Loading