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

feat: Upgrade to React 19 #251

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm ci
run: npm ci --legacy-peer-deps
- name: Validate
run: npm run validate
- name: Test
Expand Down
379 changes: 72 additions & 307 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"@types/karma-chrome-launcher": "^3.1.4",
"@types/karma-mocha": "^1.3.4",
"@types/mocha": "^10.0.6",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/sinon": "^17.0.3",
"@vitejs/plugin-react": "^4.3.1",
"chai-as-promised": "^8.0.0",
Expand Down Expand Up @@ -68,5 +70,10 @@
},
"workspaces": [
"packages/*"
]
],
"dependencies": {
"@testing-library/dom": "^10.2.0",
"react": "^19.0.0-rc-3563387fe3-20240621",
"react-dom": "^19.0.0-rc-3563387fe3-20240621"
}
}
4 changes: 2 additions & 2 deletions packages/react-components-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"peerDependencies": {
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "19.0.0-rc-3563387fe3-20240621",
"react-dom": "19.0.0-rc-3563387fe3-20240621"
},
"peerDependenciesMeta": {
"@types/react": {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
"peerDependencies": {
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "19.0.0-rc-3563387fe3-20240621",
"react-dom": "19.0.0-rc-3563387fe3-20240621"
},
"peerDependenciesMeta": {
"@types/react": {
Expand Down
12 changes: 6 additions & 6 deletions test/ContextMenu.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('ContextMenu', () => {
</ContextMenu>,
);

await assert(container.querySelector<HTMLDivElement>('#actor')!);
await assert(container.querySelector('#actor')!);
});

it('should use renderer property if set', async () => {
Expand All @@ -87,7 +87,7 @@ describe('ContextMenu', () => {
</ContextMenu>,
);

await assert(container.querySelector<HTMLDivElement>('#actor')!);
await assert(container.querySelector('#actor')!);
});

it('should render the given text as an item', async () => {
Expand All @@ -97,7 +97,7 @@ describe('ContextMenu', () => {
</ContextMenu>,
);

const target = container.querySelector<HTMLDivElement>('#target')!;
const target = container.querySelector('#target')!;
await openContextMenu(target);

const item = document.querySelector(`${overlayTag} ${menuItemTag}`);
Expand All @@ -112,7 +112,7 @@ describe('ContextMenu', () => {
</ContextMenu>,
);

const target = container.querySelector<HTMLDivElement>('#target')!;
const target = container.querySelector('#target')!;
await openContextMenu(target);

const item = document.querySelector(`${overlayTag} ${menuItemTag} > span`);
Expand All @@ -126,7 +126,7 @@ describe('ContextMenu', () => {
</ContextMenu>,
);

const target = container.querySelector<HTMLDivElement>('#target')!;
const target = container.querySelector('#target')!;
await openContextMenu(target);

const rootItem = document.querySelector(`${overlayTag} ${menuItemTag}`)!;
Expand All @@ -147,7 +147,7 @@ describe('ContextMenu', () => {
</ContextMenu>,
);

const target = container.querySelector<HTMLDivElement>('#target')!;
const target = container.querySelector('#target')!;
await openContextMenu(target);

const rootItem = document.querySelector<HTMLElement>(`${overlayTag} ${menuItemTag}`)!;
Expand Down
10 changes: 5 additions & 5 deletions test/MenuBar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('MenuBar', () => {
it('should render the given text as an item', async () => {
const { container } = render(<MenuBar items={[{ text: 'foo' }]} />);

const menuBar = container.querySelector<HTMLDivElement>('vaadin-menu-bar')!;
const menuBar = container.querySelector('vaadin-menu-bar')!;
await until(() => !!menuBar.querySelector(`${menuButtonTag}:not([slot])`));

const item = menuBar.querySelector(menuButtonTag);
Expand All @@ -43,7 +43,7 @@ describe('MenuBar', () => {
it('should render the given ReactElement as an item', async () => {
const { container } = render(<MenuBar items={[{ component: <span>foo</span> }]} />);

const menuBar = container.querySelector<HTMLDivElement>('vaadin-menu-bar')!;
const menuBar = container.querySelector('vaadin-menu-bar')!;
await until(() => !!menuBar.querySelector(`${menuButtonTag}:not([slot])`));

const item = menuBar.querySelector(`${menuItemTag} > span`);
Expand All @@ -55,7 +55,7 @@ describe('MenuBar', () => {
<MenuBar items={[{ text: 'parent', children: [{ component: <span>foo</span> }] }]}></MenuBar>,
);

const menuBar = container.querySelector<HTMLDivElement>('vaadin-menu-bar')!;
const menuBar = container.querySelector('vaadin-menu-bar')!;
await until(() => !!menuBar.querySelector(`${menuButtonTag}:not([slot])`));

const rootItem = menuBar.querySelector(menuButtonTag)!;
Expand All @@ -71,10 +71,10 @@ describe('MenuBar', () => {
const spy = sinon.spy();
const { container } = render(<MenuBar items={items} onItemSelected={spy}></MenuBar>);

const menuBar = container.querySelector<MenuBarElement>('vaadin-menu-bar')!;
const menuBar = container.querySelector('vaadin-menu-bar')!;
await until(() => !!menuBar.querySelector(`${menuButtonTag}:not([slot])`));

const rootItems = Array.from(menuBar.querySelectorAll<HTMLElement>(menuButtonTag));
const rootItems: HTMLElement[] = Array.from(menuBar.querySelectorAll(menuButtonTag));
rootItems[0].click();
rootItems[1].click();

Expand Down
2 changes: 1 addition & 1 deletion test/utils/findByQuerySelector.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { waitFor } from '@testing-library/react';
import { waitFor } from '@testing-library/dom';

export async function findByQuerySelector<K extends keyof HTMLElementTagNameMap>(
query: K,
Expand Down
Loading