Skip to content

Commit e1a3444

Browse files
committed
12.0 (#1487)
1 parent 2902e2c commit e1a3444

File tree

677 files changed

+31757
-26752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

677 files changed

+31757
-26752
lines changed

.circleci/config.yml

+41-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
install:
44
docker:
5-
- image: circleci/node:10.15.3-browsers
5+
- image: circleci/node:10.16.3-browsers
66
working_directory: ~/repo
77
steps:
88
# Fetch Code
@@ -11,9 +11,9 @@ jobs:
1111
- restore_cache:
1212
keys:
1313
# Restore cached node_modules
14-
- v7-dependencies-{{ checksum "yarn.lock" }}
14+
- v11-dependencies-{{ checksum "yarn.lock" }}
1515
# fallback to using the latest cache if no exact match is found
16-
- v7-dependencies-
16+
- v11-dependencies-
1717

1818
- run:
1919
name: Add CI global modules
@@ -43,17 +43,17 @@ jobs:
4343
- save_cache:
4444
paths:
4545
- node_modules
46-
key: v7-dependencies-{{ checksum "yarn.lock" }}
46+
key: v11-dependencies-{{ checksum "yarn.lock" }}
4747
validate:
4848
docker:
49-
- image: circleci/node:10.15.3-browsers
49+
- image: circleci/node:10.16.3-browsers
5050
working_directory: ~/repo
5151
steps:
5252
- checkout
5353

5454
- restore_cache:
5555
keys:
56-
- v7-dependencies-{{ checksum "yarn.lock" }}
56+
- v11-dependencies-{{ checksum "yarn.lock" }}
5757

5858
- run:
5959
# PR's from forks cannot use the dependency cache for performance reasons
@@ -65,14 +65,14 @@ jobs:
6565
command: yarn validate
6666
test-unit:
6767
docker:
68-
- image: circleci/node:10.15.3-browsers
68+
- image: circleci/node:10.16.3-browsers
6969
working_directory: ~/repo
7070
steps:
7171
- checkout
7272

7373
- restore_cache:
7474
keys:
75-
- v7-dependencies-{{ checksum "yarn.lock" }}
75+
- v11-dependencies-{{ checksum "yarn.lock" }}
7676

7777
- run:
7878
# PR's from forks cannot use the dependency cache for performance reasons
@@ -89,14 +89,14 @@ jobs:
8989
path: test-reports/junit
9090
test-bundle:
9191
docker:
92-
- image: circleci/node:10.15.3-browsers
92+
- image: circleci/node:10.16.3-browsers
9393
working_directory: ~/repo
9494
steps:
9595
- checkout
9696

9797
- restore_cache:
9898
keys:
99-
- v7-dependencies-{{ checksum "yarn.lock" }}
99+
- v11-dependencies-{{ checksum "yarn.lock" }}
100100

101101
# PR's from forks cannot use the dependency cache for performance reasons
102102
- run:
@@ -108,16 +108,16 @@ jobs:
108108
command: yarn run bundle-size:check
109109
test-browser:
110110
docker:
111-
# Single Docker container with Node 8 and Cypress dependencies
111+
# Single Docker container with Node 10 and Cypress dependencies
112112
# https://github.com/cypress-io/circleci-orb/blob/master/src/orb.yml
113-
- image: cypress/base:8
113+
- image: cypress/base:10.16.0
114114
working_directory: ~/repo
115115
steps:
116116
- checkout
117117

118118
- restore_cache:
119119
keys:
120-
- v7-dependencies-{{ checksum "yarn.lock" }}
120+
- v11-dependencies-{{ checksum "yarn.lock" }}
121121

122122
# PR's from forks cannot use the dependency cache for performance reasons
123123
- run:
@@ -133,6 +133,31 @@ jobs:
133133
path: cypress/videos
134134
- store_artifacts:
135135
path: cypress/screenshots
136+
test-a11y:
137+
docker:
138+
- image: circleci/node:10.16.3-browsers
139+
working_directory: ~/repo
140+
steps:
141+
- checkout
142+
143+
- restore_cache:
144+
keys:
145+
- v11-dependencies-{{ checksum "yarn.lock" }}
146+
147+
# PR's from forks cannot use the dependency cache for performance reasons
148+
- run:
149+
name: 'Forked PR dependency install'
150+
command: yarn
151+
152+
- run:
153+
name: Accessibility Audit
154+
command: node browser-test-harness.js yarn test:accessibility
155+
156+
- store_artifacts:
157+
path: test-reports/lighthouse
158+
159+
- store_test_results:
160+
path: test-reports/lighthouse
136161
workflows:
137162
version: 2
138163
build:
@@ -150,3 +175,6 @@ workflows:
150175
- test-browser:
151176
requires:
152177
- install
178+
- test-a11y:
179+
requires:
180+
- install

.eslintrc.js

+40-1
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,18 @@ module.exports = {
5252
// Cannot reassign function parameters but allowing modification
5353
'no-param-reassign': ['error', { props: false }],
5454

55+
// Named exports are kewl
56+
'import/prefer-default-export': 'off',
57+
58+
// Don't tell me what to do!
59+
'max-classes-per-file': 'off',
60+
5561
// Allowing ++ on numbers
5662
'no-plusplus': 'off',
5763

64+
// Always enforcing the use of curly braces for if statements
65+
'curly': ['error', 'all'],
66+
5867
'no-restricted-syntax': [
5968
// Nicer booleans #1
6069
// Disabling the use of !! to cast to boolean
@@ -82,6 +91,25 @@ module.exports = {
8291
message:
8392
'Must use `useLayoutEffect` as the name of the import from `*use-isomorphic-layout-effect` to leverage `eslint-plugin-react-hooks`',
8493
},
94+
95+
// No Array.from as it pulls in a large amount of babel helpers
96+
{
97+
selector: 'MemberExpression[object.name="Array"][property.name="from"]',
98+
message:
99+
'Not allowing using of Array.from to save kbs. Please use native-with-fallback/from',
100+
},
101+
102+
// No usage of `tiny-invariant`. Must use our own invariant for error flow
103+
{
104+
selector: 'ImportDeclaration[source.value="tiny-invariant"]',
105+
message: 'Please use our own invariant function (src/invariant.js) to ensure correct error flow'
106+
},
107+
108+
// Must use invariant to throw
109+
{
110+
selector: 'ThrowStatement',
111+
message: 'Please use invariant (src/invariant.js) for throwing. This is to ensure correct error flows'
112+
}
85113
],
86114

87115
// Allowing Math.pow rather than forcing `**`
@@ -162,6 +190,17 @@ module.exports = {
162190
// Enforce rules of hooks
163191
'react-hooks/rules-of-hooks': 'error',
164192
// Second argument to hook functions
165-
'react-hooks/exhaustive-deps': 'warn',
193+
'react-hooks/exhaustive-deps': 'error',
194+
195+
'react/jsx-props-no-spreading': 'off',
196+
197+
// using <React.Fragment> is fine
198+
'react/jsx-fragments': 'off',
199+
200+
// all good to declare static class members in the class
201+
'react/static-property-placement': 'off',
202+
203+
// don't need to initialize state in a constructor
204+
'react/state-in-constructor': 'off',
166205
},
167206
};

.flowconfig

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Issue with atlaskit/theme typing
33
.*/node_modules/@atlaskit/theme
44

5+
[ignore]
6+
# Creating lots of invalid files
7+
.*/node_modules/jsonlint-mod/.*
8+
59
[libs]
610
./flow-typed/custom/
711

.github/ISSUE_TEMPLATE/bug-report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/common-
1616
In development builds we log warnings to the console for common setup issues. Please have a look to see if it can give you information in overcoming your issue
1717
1818
## Are you new to rbd?
19-
If you are new to `react-beautiful-dnd` we recommend taking at look at our getting started course: https://egghead.io/courses/beautiful-and-accessible-drag-and-drop-with-react-beautiful-dnd
19+
If you are new to `react-beautiful-dnd` we recommend taking at look at our getting started course: https://egghead.io/courses/beautiful-and-accessible-drag-and-drop-with-react-beautiful-dnd?af=2jc3e4
2020
2121
It will give you a good base understanding of how everything fits together. This can often be the best help in overcoming your issue.
2222

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ coverage/
2020
# test reports
2121
test-reports/
2222

23-
# test videos
23+
# test outputs
2424
cypress/videos/
25+
cypress/screenshots/
2526

2627
# storybook
2728
.storybook.out

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.15.3
1+
10.16.3

.size-snapshot.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"dist/react-beautiful-dnd.js": {
3-
"bundled": 392081,
4-
"minified": 147079,
5-
"gzipped": 41340
3+
"bundled": 380407,
4+
"minified": 139714,
5+
"gzipped": 42033
66
},
77
"dist/react-beautiful-dnd.min.js": {
8-
"bundled": 323864,
9-
"minified": 116189,
10-
"gzipped": 33372
8+
"bundled": 322021,
9+
"minified": 115167,
10+
"gzipped": 34123
1111
},
1212
"dist/react-beautiful-dnd.esm.js": {
13-
"bundled": 238384,
14-
"minified": 123773,
15-
"gzipped": 31477,
13+
"bundled": 241645,
14+
"minified": 126072,
15+
"gzipped": 32900,
1616
"treeshaked": {
1717
"rollup": {
18-
"code": 29975,
19-
"import_statements": 793
18+
"code": 21306,
19+
"import_statements": 788
2020
},
2121
"webpack": {
22-
"code": 33907
22+
"code": 24963
2323
}
2424
}
2525
}

.storybook/.babelrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
"presets": [
33
"@babel/react",
44
"@babel/flow",
5-
["@babel/env", { "modules": false, "loose": true }]
5+
["@babel/env", { "modules": false, "loose": true }],
6+
"@emotion/babel-preset-css-prop"
67
],
78
"plugins": [
9+
"emotion",
810
["@babel/proposal-class-properties", { "loose": true }],
911
["@babel/proposal-object-rest-spread", { "loose": true }]
1012
],

.storybook/config.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,18 @@ const table = Object.prototype.hasOwnProperty.call(console, 'table')
3939
? console.table
4040
: console.log;
4141

42-
console.log('environment');
42+
// Generated by: http://patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=rbd
43+
console.log(`%c
44+
██████╗ ██████╗ ██████╗
45+
██╔══██╗██╔══██╗██╔══██╗
46+
██████╔╝██████╔╝██║ ██║
47+
██╔══██╗██╔══██╗██║ ██║
48+
██║ ██║██████╔╝██████╔╝
49+
╚═╝ ╚═╝╚═════╝ ╚═════╝
50+
51+
%cBeautiful and accessible drag and drop
52+
`, `color: ${colors.G200}; font-size: 1.2em; font-weight: bold;`, `color: ${colors.P200}; font-size: 1.2em; font-weight: bold;`);
53+
4354
table([
4455
['react-beautiful-dnd version', version],
4556
['react version', React.version],

.storybook/decorator/global-styles.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { colors } from '@atlaskit/theme';
55
import { grid } from '../../stories/src/constants';
66

77
const GlobalStyles = styled.div`
8-
background-color: ${colors.N0};
98
min-height: 100vh;
109
color: ${colors.N900};
1110
`;

.storybook/preview-head.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--
2+
3+
Used to ensure there is a lang set on the html attribute for storybook
4+
This is important for accessibility scores
5+
6+
-->
7+
<script>
8+
document.documentElement.setAttribute('lang', 'en');
9+
</script>

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The online courses listed are no free - feel free to seek out alternatives if yo
4040
This is a `React` project so getting familiar with `React` is a must!
4141

4242
- [`react`](https://facebook.github.io/react/)
43-
- [An intro to using React](https://egghead.io/courses/start-using-react-to-build-web-applications)
43+
- [An intro to using React](https://egghead.io/courses/start-using-react-to-build-web-applications?af=2jc3e4)
4444

4545
#### `Redux`
4646

@@ -57,8 +57,8 @@ This project uses `redux` for its state management. If you have not used `redux`
5757
We test our application very thoroughly. Changes will not be accepted without tests
5858

5959
- [`jest`](https://facebook.github.io/jest/): We use the jest test runner. It is worth getting familiar with it
60-
- [Test JavaScript with Jest](https://egghead.io/lessons/javascript-test-javascript-with-jest)
61-
- [React Testing Cookbook](https://egghead.io/courses/react-testing-cookbook)
60+
- [Test JavaScript with Jest](https://egghead.io/lessons/javascript-test-javascript-with-jest?af=2jc3e4)
61+
- [React Testing Cookbook](https://egghead.io/courses/react-testing-cookbook?af=2jc3e4)
6262

6363
#### Performance
6464

@@ -75,7 +75,7 @@ Performance is **critical** to this project. Please get familiar with React perf
7575
This codebase is typed with [`flow`](https://flow.org/). Changes will not be merged without correct flow typing. If you are not sure about a particular use case let flow break the build and it can be discussed in the pull request.
7676

7777
- [`flow`](https://flow.org/en/docs/getting-started/): the `flow` docs are great
78-
- [Up and Running with Facebook Flow for Typed JavaScript](https://egghead.io/lessons/javascript-up-and-running-with-facebook-flow-for-typed-javascript): a small primer for running flow
78+
- [Up and Running with Facebook Flow for Typed JavaScript](https://egghead.io/lessons/javascript-up-and-running-with-facebook-flow-for-typed-javascript?af=2jc3e4): a small primer for running flow
7979

8080
### Drag and drop problem space
8181

0 commit comments

Comments
 (0)