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(deps): add support for react 18 #322

Merged
merged 24 commits into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
36e97cd
feat(peer-deps): add react and react-dom 18 (#321)
100terres Apr 11, 2022
4fa731f
test(dev-deps): migrate from enzyme to @testing-library/react (#323)
100terres Apr 14, 2022
3b22dae
chore(deps): bump multiple deps and dev-deps (#392)
100terres Aug 20, 2022
5cae0bd
chore(test): setup jest test to run against the last three major vers…
100terres Aug 21, 2022
2d6fba4
chore(storybook): disable telemetry (#392)
100terres Aug 20, 2022
7106efa
chore(storybook): enable strict mode (#392)
100terres Aug 20, 2022
82c111e
chore(deps): support react-redux@8 (#392)
100terres Aug 20, 2022
89c7d07
feat(registry): drop ansyc registry clean for react 18+ (#392)
100terres Aug 20, 2022
dc92b26
fix: make sure the droppable exsist in the registry before notify a r…
100terres Aug 20, 2022
ed0e9c2
fix(react): prevent automatic batching for some state changes (#392)
100terres Aug 20, 2022
e728b7a
test: adjust test to work for react 16, 17 and 18 (#392)
100terres Aug 20, 2022
142563e
chore: update sizes snapshot (#392)
100terres Aug 20, 2022
b990622
chore(type): fix react-virtualized type (library does not support rea…
100terres Aug 20, 2022
26bf701
chore(dev-deps): bump cypress and fix specs (#392)
100terres Aug 20, 2022
5ce1957
chore(test): fix issue when running test with react major version env…
100terres Aug 21, 2022
66d5374
chore(dev-deps): bump all eslint related packages (#395)
100terres Aug 21, 2022
40bd6bc
chore(dev-deps): bump all babel related packages (#395)
100terres Aug 21, 2022
b7e5a2f
chore(dev-deps): bump styling related packages (#395)
100terres Aug 21, 2022
811fb88
chore(dev-deps): bump rollup related packages (#395)
100terres Aug 21, 2022
ee38217
chore(dev-deps): bump node to 16.17.0 (#395)
100terres Aug 21, 2022
e73a8fc
chore(dev-deps): bump support packages (#395)
100terres Aug 21, 2022
525fb63
chore(dev-deps): bump commit and release packages (#395)
100terres Aug 21, 2022
68fe9b8
chore(dev-deps): bump prettier (#395)
100terres Aug 21, 2022
b9e7240
chore: release 15.0.0-beta.0
100terres Aug 21, 2022
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
21 changes: 14 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ commands:
jobs:
install:
docker:
- image: cimg/node:16.14.2-browsers
- image: cimg/node:16.17.0-browsers
working_directory: ~/repo
environment:
- CYPRESS_CACHE_FOLDER: '~/repo/node_modules/.cache/Cypress'
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:

validate:
docker:
- image: cimg/node:16.14.2-browsers
- image: cimg/node:16.17.0-browsers
working_directory: ~/repo
steps:
- checkout
Expand All @@ -65,9 +65,12 @@ jobs:

test-unit:
docker:
- image: cimg/node:16.14.2-browsers
- image: cimg/node:16.17.0-browsers
working_directory: ~/repo
resource_class: medium+
parameters:
react-major-version:
type: string
steps:
- checkout
- pnpm
Expand All @@ -81,13 +84,14 @@ jobs:
command: pnpm test
environment:
JEST_JUNIT_OUTPUT: 'test-reports/junit/js-test-results.xml'
REACT_MAJOR_VERSION: << parameters.react-major-version >>

- store_test_results:
path: test-reports/junit

test-bundle:
docker:
- image: cimg/node:16.14.2-browsers
- image: cimg/node:16.17.0-browsers
working_directory: ~/repo
steps:
- checkout
Expand All @@ -103,7 +107,7 @@ jobs:

build:
docker:
- image: cimg/node:16.14.2-browsers
- image: cimg/node:16.17.0-browsers
working_directory: ~/repo
steps:
- checkout
Expand All @@ -124,7 +128,7 @@ jobs:

test-browser:
docker:
- image: cimg/node:16.14.2-browsers
- image: cimg/node:16.17.0-browsers
working_directory: ~/repo
environment:
- CYPRESS_CACHE_FOLDER: '~/repo/node_modules/.cache/Cypress'
Expand Down Expand Up @@ -153,7 +157,7 @@ jobs:

test-a11y:
docker:
- image: cimg/node:16.14.2-browsers
- image: cimg/node:16.17.0-browsers
working_directory: ~/repo
steps:
- browser-tools/install-chrome
Expand Down Expand Up @@ -187,6 +191,9 @@ workflows:
requires:
- install
- test-unit:
matrix:
parameters:
react-major-version: ['16', '17', '18']
requires:
- install
- test-bundle:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 16.14.2
node-version: 16.17.0

- name: Cache pnpm modules
uses: actions/cache@v3
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.14.2
16.17.0
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
strict-peer-dependencies=false

24 changes: 12 additions & 12 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"dnd.js": {
"bundled": 375284,
"minified": 135837,
"gzipped": 40524
"bundled": 340503,
"minified": 125035,
"gzipped": 37311
},
"dnd.min.js": {
"bundled": 306859,
"minified": 108429,
"gzipped": 31342
"bundled": 302346,
"minified": 107277,
"gzipped": 30915
},
"dnd.esm.js": {
"bundled": 242252,
"minified": 126027,
"gzipped": 32831,
"bundled": 242968,
"minified": 126368,
"gzipped": 32917,
"treeshaked": {
"rollup": {
"code": 20995,
"import_statements": 561
"code": 21062,
"import_statements": 577
},
"webpack": {
"code": 24433
"code": 24501
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
require('dotenv').config();

module.exports = {
addons: [
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'storybook-addon-performance/register',
],
addons: ['@storybook/addon-essentials', '@storybook/addon-storysource'],
check: true,
checkOptions: {
tsconfig: '../stories/tsconfig.json',
},
core: {
disableTelemetry: true,
},
reactOptions: {
strictMode: true,
},
stories: [
'../stories/**/*.stories.mdx',
'../stories/**/*.stories.@(js|jsx|ts|tsx)',
Expand Down
15 changes: 5 additions & 10 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
import '@atlaskit/css-reset';

import { DecoratorFn } from '@storybook/react';
import React from 'react';
import { withPerformance } from 'storybook-addon-performance';
import { resetData } from '../stories/src/data';
import GlobalStyles from './custom-decorators/global-styles';
import welcomeMessage from './welcome-message';

welcomeMessage();

export const decorators = [
(Story: React.ElementType, { id }: { id: string }) => {
export const decorators: DecoratorFn[] = [
(story, { id }: { id: string }) => {
resetData(id);

return <Story key={id} />;
return story({ key: id });
},
(Story: React.ElementType): React.ReactElement => (
<GlobalStyles>
<Story />
</GlobalStyles>
),
withPerformance,
(story) => <GlobalStyles>{story()}</GlobalStyles>,
];

export const parameters = {
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@


## [15.0.0-beta.0](https://github.com/react-forked/dnd/compare/v14.0.2...v15.0.0-beta.0) (2022-08-21)


### Docs 📃

* **readme:** fix storybook link ([#346](https://github.com/react-forked/dnd/issues/346)) ([a892bba](https://github.com/react-forked/dnd/commit/a892bba4402120087270083e44d1bca3961ac266))


### Features 🔥

* **peer-deps:** add react and react-dom 18 ([#321](https://github.com/react-forked/dnd/issues/321)) ([36e97cd](https://github.com/react-forked/dnd/commit/36e97cd6307466187696ea152215fd857474ab00)), closes [#319](https://github.com/react-forked/dnd/issues/319)
* **registry:** drop ansyc registry clean for react 18+ ([#392](https://github.com/react-forked/dnd/issues/392)) ([89c7d07](https://github.com/react-forked/dnd/commit/89c7d073e5a0fd801eab916be74a966aac69a775))


### Bug Fixes 🛠

* make sure the droppable exsist in the registry before notify a removal ([#392](https://github.com/react-forked/dnd/issues/392)) ([dc92b26](https://github.com/react-forked/dnd/commit/dc92b269b587ab5b02a79e9c078f3c897362fa19))
* **react:** prevent automatic batching for some state changes ([#392](https://github.com/react-forked/dnd/issues/392)) ([ed0e9c2](https://github.com/react-forked/dnd/commit/ed0e9c259a350f6c29ccb4137af7f94e3e8c1c44))


### Tests 🧪

* adjust test to work for react 16, 17 and 18 ([#392](https://github.com/react-forked/dnd/issues/392)) ([e728b7a](https://github.com/react-forked/dnd/commit/e728b7a2f61ef9685a66e52d308a03aee3206b49))
* **dev-deps:** migrate from enzyme to @testing-library/react ([#323](https://github.com/react-forked/dnd/issues/323)) ([4fa731f](https://github.com/react-forked/dnd/commit/4fa731faa261dab39c2b5eb5bc484549b1105d0f))


### Others 🔧

* **deps:** bump multiple deps and dev-deps ([#392](https://github.com/react-forked/dnd/issues/392)) ([3b22dae](https://github.com/react-forked/dnd/commit/3b22dae75d6f920fe8dba55dfcb5778c75c491de))
* **deps:** support react-redux@8 ([#392](https://github.com/react-forked/dnd/issues/392)) ([82c111e](https://github.com/react-forked/dnd/commit/82c111e90dd84a082f37a84fe4af5ff54f2b7aad))
* **dev-deps:** bump all babel related packages ([#395](https://github.com/react-forked/dnd/issues/395)) ([40bd6bc](https://github.com/react-forked/dnd/commit/40bd6bc5d62cf224ce04b8dfa8c2002b8a7aa32c))
* **dev-deps:** bump all eslint related packages ([#395](https://github.com/react-forked/dnd/issues/395)) ([66d5374](https://github.com/react-forked/dnd/commit/66d5374b79b26fb9374ff9c960cf09d58cbd5a82))
* **dev-deps:** bump commit and release packages ([#395](https://github.com/react-forked/dnd/issues/395)) ([525fb63](https://github.com/react-forked/dnd/commit/525fb63b4a862d61e9ea54d186097cb8daf6c6a2))
* **dev-deps:** bump cypress and fix specs ([#392](https://github.com/react-forked/dnd/issues/392)) ([26bf701](https://github.com/react-forked/dnd/commit/26bf70112dbb99682e369a55ffc0a4332951ddf9))
* **dev-deps:** bump node to 16.17.0 ([#395](https://github.com/react-forked/dnd/issues/395)) ([ee38217](https://github.com/react-forked/dnd/commit/ee38217d3cbd466f1317c650a969dd140ef0d7d8))
* **dev-deps:** bump prettier ([#395](https://github.com/react-forked/dnd/issues/395)) ([68fe9b8](https://github.com/react-forked/dnd/commit/68fe9b8129b76191da5cbb1e0d3e715f540b5866))
* **dev-deps:** bump rollup related packages ([#395](https://github.com/react-forked/dnd/issues/395)) ([811fb88](https://github.com/react-forked/dnd/commit/811fb885110aac8765a81f9eee5cb93a1ef31bb0))
* **dev-deps:** bump styling related packages ([#395](https://github.com/react-forked/dnd/issues/395)) ([b7e5a2f](https://github.com/react-forked/dnd/commit/b7e5a2fd3dffe43d50fab7cd287b5de22ded924b))
* **dev-deps:** bump support packages ([#395](https://github.com/react-forked/dnd/issues/395)) ([e73a8fc](https://github.com/react-forked/dnd/commit/e73a8fc7c638f8f582fd5fa3dc9014d5624f2e74))
* **storybook:** disable telemetry ([#392](https://github.com/react-forked/dnd/issues/392)) ([2d6fba4](https://github.com/react-forked/dnd/commit/2d6fba4b8a1843eba1a7ea7904af0ed57b015d8e))
* **storybook:** enable strict mode ([#392](https://github.com/react-forked/dnd/issues/392)) ([7106efa](https://github.com/react-forked/dnd/commit/7106efa02a959b3d29ab99c34f769d28c9757d65))
* **test:** fix issue when running test with react major version env set ([#392](https://github.com/react-forked/dnd/issues/392)) ([5ce1957](https://github.com/react-forked/dnd/commit/5ce1957e0f06addd89023eea879848b7beb6309d))
* **test:** setup jest test to run against the last three major version of react ([#392](https://github.com/react-forked/dnd/issues/392)) ([5cae0bd](https://github.com/react-forked/dnd/commit/5cae0bd619785a105991dd93ad0cad7661991087))
* **type:** fix react-virtualized type (library does not support react 18) ([#392](https://github.com/react-forked/dnd/issues/392)) ([b990622](https://github.com/react-forked/dnd/commit/b990622b513315fe2b748b085bba40aeb1a58e6d))
* update sizes snapshot ([#392](https://github.com/react-forked/dnd/issues/392)) ([142563e](https://github.com/react-forked/dnd/commit/142563e81f6fccc1a99b24fbd5f9cb70cf8bc45d))

### [14.0.2](https://github.com/react-forked/dnd/compare/v14.0.1...v14.0.2) (2022-04-10)


Expand Down
13 changes: 13 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'cypress';

export default defineConfig({
pageLoadTimeout: 10000,
retries: 1,
viewportHeight: 600,
viewportWidth: 800,

e2e: {
baseUrl: 'http://localhost:9002',
specPattern: 'cypress/**/*.spec.ts',
},
});
8 changes: 0 additions & 8 deletions cypress.json

This file was deleted.

3 changes: 3 additions & 0 deletions cypress/integration/reorder-lists.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ describe('reorder lists', () => {
.wait(timings.outOfTheWay * 1000)
.trigger('keydown', { keyCode: keyCodes.space, force: true });

// we must wait before asserting the new order
cy.wait(timings.outOfTheWay * 1000);

// order now 2, 1
// note: not using get aliases as they where returning incorrect results
cy.get('h4').eq(0).should('contain', 'BMO');
Expand Down
3 changes: 3 additions & 0 deletions cypress/integration/reorder-virtual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ describe('reorder: virtual', () => {
force: true,
});

// we must wait before asserting the new order
cy.wait(timings.outOfTheWay * 1000);

// This is setting up a chain of commands and this test will not wait
// for a 'promise' to resolve. Linting is getting confused by .then
cy.get('@item-id').then((id) => {
Expand Down
3 changes: 3 additions & 0 deletions cypress/integration/reorder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ describe('reorder', () => {
.wait(timings.outOfTheWay * 1000)
.trigger('keydown', { keyCode: keyCodes.space, force: true });

// we must wait before asserting the new order
cy.wait(timings.outOfTheWay * 1000);

// order now 2, 1
// note: not using get aliases as they where returning incorrect results
cy.get(getHandleSelector()).eq(0).should('contain', 'id:G2');
Expand Down
18 changes: 0 additions & 18 deletions cypress/plugins/index.js

This file was deleted.

2 changes: 2 additions & 0 deletions cypress/support/commands.js → cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

export {};
12 changes: 12 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
36 changes: 36 additions & 0 deletions cypress/support/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// ***********************************************************
// This example support/component.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

import './commands';

import { mount } from 'cypress/react18';

// Augment the Cypress namespace to include type definitions for
// your custom command.
// Alternatively, can be defined in cypress/support/component.d.ts
// with a <reference path="./component" /> at the top of your spec.
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
mount: typeof mount;
}
}
}

Cypress.Commands.add('mount', mount);

// Example use:
// cy.mount(<MyComponent />);
4 changes: 0 additions & 4 deletions cypress/support/index.js → cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading