Skip to content

Commit 3ef5ab1

Browse files
committed
upgrate react-dnd
1 parent cea1362 commit 3ef5ab1

File tree

4 files changed

+84
-34
lines changed

4 files changed

+84
-34
lines changed

packages/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@
175175
"react-color": "^2.17.3",
176176
"react-day-picker": "^7.2.4",
177177
"react-devtools-inline": "^4.0.0",
178-
"react-dnd": "^7.0.2",
179-
"react-dnd-html5-backend": "^2.4.1",
178+
"react-dnd": "^9.4.0",
179+
"react-dnd-html5-backend": "^9.4.0",
180180
"react-dom": "^16.9.0",
181181
"react-draggable": "^3.0.5",
182182
"react-error-overlay": "^1.0.10",

packages/app/src/app/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ThemeProvider } from 'styled-components';
44
import { Router } from 'react-router-dom';
55
import { ApolloProvider } from 'react-apollo';
66
import { ApolloProvider as HooksProvider } from '@apollo/react-hooks';
7+
import { DndProvider } from 'react-dnd';
78
import _debug from '@codesandbox/common/lib/utils/debug';
89
import { createOvermind } from 'overmind';
910
import {
@@ -31,6 +32,8 @@ import { Routes as App } from './pages';
3132
import { Provider as OvermindProvider } from './overmind/Provider';
3233
import { config } from './overmind';
3334
import './split-pane.css';
35+
import HTML5Backend from './pages/common/HTML5BackendWithFolderSupport';
36+
3437
import { getTypeFetcher } from './vscode/extensionHostWorker/common/type-downloader';
3538
import { vscode } from './vscode';
3639
import {
@@ -124,9 +127,11 @@ async function boot(overmind) {
124127
<OvermindProvider value={overmind}>
125128
<HooksProvider client={client}>
126129
<ThemeProvider theme={theme}>
127-
<Router history={history}>
128-
<App />
129-
</Router>
130+
<DndProvider backend={HTML5Backend}>
131+
<Router history={history}>
132+
<App />
133+
</Router>
134+
</DndProvider>
130135
</ThemeProvider>
131136
</HooksProvider>
132137
</OvermindProvider>

packages/app/src/app/pages/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect } from 'react';
22
import { Route, Switch, Redirect, withRouter } from 'react-router-dom';
3-
import { DragDropContext } from 'react-dnd';
3+
44
import _debug from '@codesandbox/common/lib/utils/debug';
55
import { Toasts, NotificationStatus } from '@codesandbox/notifications';
66
import { notificationState } from '@codesandbox/common/lib/utils/notifications';
@@ -10,7 +10,7 @@ import { Button } from '@codesandbox/common/lib/components/Button';
1010
import Loadable from 'app/utils/Loadable';
1111
import { useOvermind } from 'app/overmind';
1212
import { ErrorBoundary } from './common/ErrorBoundary';
13-
import HTML5Backend from './common/HTML5BackendWithFolderSupport';
13+
1414
import Modals from './common/Modals';
1515
import Sandbox from './Sandbox';
1616
import { NewSandbox } from './NewSandbox';
@@ -138,6 +138,4 @@ const RoutesComponent: React.FC = () => {
138138
);
139139
};
140140

141-
export const Routes = DragDropContext(HTML5Backend)(
142-
withRouter(RoutesComponent)
143-
);
141+
export const Routes = withRouter(RoutesComponent);

yarn.lock

Lines changed: 71 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3843,6 +3843,11 @@
38433843
resolved "https://registry.yarnpkg.com/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a"
38443844
integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==
38453845

3846+
"@types/asap@^2.0.0":
3847+
version "2.0.0"
3848+
resolved "https://registry.yarnpkg.com/@types/asap/-/asap-2.0.0.tgz#d529e9608c83499a62ae08c871c5e62271aa2963"
3849+
integrity sha512-upIS0Gt9Mc8eEpCbYMZ1K8rhNosfKUtimNcINce+zLwJF5UpM3Vv7yz3S5l/1IX+DxTa8lTkUjqynvjRXyJzsg==
3850+
38463851
"@types/babel__core@^7.1.0":
38473852
version "7.1.2"
38483853
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f"
@@ -3971,6 +3976,14 @@
39713976
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.2.tgz#0e670ea254d559241b6eeb3894f8754991e73220"
39723977
integrity sha512-ui3WwXmjTaY73fOQ3/m3nnajU/Orhi6cEu5rzX+BrAAJxa3eITXZ5ch9suPqtM03OWhAHhPSyBGCN4UKoxO20Q==
39733978

3979+
"@types/hoist-non-react-statics@^3.3.1":
3980+
version "3.3.1"
3981+
resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
3982+
integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==
3983+
dependencies:
3984+
"@types/react" "*"
3985+
hoist-non-react-statics "^3.3.0"
3986+
39743987
"@types/humps@^1.1.2":
39753988
version "1.1.2"
39763989
resolved "https://registry.yarnpkg.com/@types/humps/-/humps-1.1.2.tgz#fbcaf596d20ff2ed78f8f511c5d6a943b51101d6"
@@ -4012,6 +4025,11 @@
40124025
dependencies:
40134026
"@types/node" "*"
40144027

4028+
"@types/invariant@^2.2.30":
4029+
version "2.2.30"
4030+
resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.30.tgz#20efa342807606ada5483731a8137cb1561e5fe9"
4031+
integrity sha512-98fB+yo7imSD2F7PF7GIpELNgtLNgo5wjivu0W5V4jx+KVVJxo6p/qN4zdzSTBWy4/sN3pPyXwnhRSD28QX+ag==
4032+
40154033
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
40164034
version "2.0.1"
40174035
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
@@ -4224,6 +4242,11 @@
42244242
dependencies:
42254243
"@types/node" "*"
42264244

4245+
"@types/shallowequal@^1.1.1":
4246+
version "1.1.1"
4247+
resolved "https://registry.yarnpkg.com/@types/shallowequal/-/shallowequal-1.1.1.tgz#aad262bb3f2b1257d94c71d545268d592575c9b1"
4248+
integrity sha512-Lhni3aX80zbpdxRuWhnuYPm8j8UQaa571lHP/xI4W+7BAFhSIhRReXnqjEgT/XzPoXZTJkCqstFMJ8CZTK6IlQ==
4249+
42274250
"@types/shelljs@^0.7.0":
42284251
version "0.7.9"
42294252
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.9.tgz#3abecb72d9cad9cd4b0e7cb86ed10a97d93ba602"
@@ -5723,6 +5746,13 @@ atob@~1.1.0:
57235746
version "1.1.3"
57245747
resolved "https://registry.yarnpkg.com/atob/-/atob-1.1.3.tgz#95f13629b12c3a51a5d215abdce2aa9f32f80773"
57255748

5749+
attr-accept@^1.1.3:
5750+
version "1.1.3"
5751+
resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-1.1.3.tgz#48230c79f93790ef2775fcec4f0db0f5db41ca52"
5752+
integrity sha512-iT40nudw8zmCweivz6j58g+RT33I4KbaIvRUhjNmDwO2WmsQUxFEZZYZ5w3vXe5x5MX9D7mfvA/XaLOZYFR9EQ==
5753+
dependencies:
5754+
core-js "^2.5.0"
5755+
57265756
auto-bind@^2.0.0:
57275757
version "2.1.0"
57285758
resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-2.1.0.tgz#254e12d53063d7cab90446ce021accfb3faa1464"
@@ -8191,7 +8221,7 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0:
81918221
integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=
81928222

81938223
console-feed@CompuIves/console-feed#build2, console-feed@^2.8.5:
8194-
version "2.8.8"
8224+
version "2.8.9"
81958225
resolved "https://codeload.github.com/CompuIves/console-feed/tar.gz/42f10eb3063f0f26ee9745c4c9e4542cb5591f46"
81968226
dependencies:
81978227
emotion "^9.1.1"
@@ -9608,15 +9638,16 @@ [email protected]:
96089638
resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a"
96099639
integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=
96109640

9611-
dnd-core@^7.0.2:
9612-
version "7.0.2"
9613-
resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-7.0.2.tgz#6c080eb57243fa0372fd083b3db242d9eb525010"
9614-
integrity sha512-InwRBi6zTndtE3+3nTYpLJkYMEr7utSR7OziAoSFhtQsbUfJE1KeqxM+ZFRIMKn6ehxUTAC+QU6QC7IG9u86Mg==
9641+
dnd-core@^9.4.0:
9642+
version "9.4.0"
9643+
resolved "https://registry.yarnpkg.com/dnd-core/-/dnd-core-9.4.0.tgz#ccf605d36887f18cdde8fd5576ca3145d2e69fa8"
9644+
integrity sha512-Kg+8VwU8s7TgdR/BUYGUHrvFiS+5ePMZ0Q0XD7p+cFVJvgKqykBaeQDuaziuauFMPm8QxtnUy8Pncey9flXW3Q==
96159645
dependencies:
9646+
"@types/asap" "^2.0.0"
9647+
"@types/invariant" "^2.2.30"
96169648
asap "^2.0.6"
96179649
invariant "^2.2.4"
9618-
lodash "^4.17.11"
9619-
redux "^4.0.1"
9650+
redux "^4.0.4"
96209651

96219652
dns-equal@^1.0.0:
96229653
version "1.0.0"
@@ -11299,6 +11330,13 @@ file-saver@^1.3.3:
1129911330
version "1.3.8"
1130011331
resolved "https://registry.yarnpkg.com/file-saver/-/file-saver-1.3.8.tgz#e68a30c7cb044e2fb362b428469feb291c2e09d8"
1130111332

11333+
file-selector@^0.1.11:
11334+
version "0.1.12"
11335+
resolved "https://registry.yarnpkg.com/file-selector/-/file-selector-0.1.12.tgz#fe726547be219a787a9dcc640575a04a032b1fd0"
11336+
integrity sha512-Kx7RTzxyQipHuiqyZGf+Nz4vY9R1XGxuQl/hLoJwq+J4avk/9wxxgZyHKtbyIPJmbD4A66DWGYfyykWNpcYutQ==
11337+
dependencies:
11338+
tslib "^1.9.0"
11339+
1130211340
file-system-cache@^1.0.5:
1130311341
version "1.0.5"
1130411342
resolved "https://registry.yarnpkg.com/file-system-cache/-/file-system-cache-1.0.5.tgz#84259b36a2bbb8d3d6eb1021d3132ffe64cfff4f"
@@ -13608,7 +13646,7 @@ hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0:
1360813646
version "2.5.0"
1360913647
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"
1361013648

13611-
hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0:
13649+
hoist-non-react-statics@^3.3.0:
1361213650
version "3.3.0"
1361313651
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b"
1361413652
integrity sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==
@@ -14443,7 +14481,7 @@ into-stream@^3.1.0:
1444314481
from2 "^2.1.1"
1444414482
p-is-promise "^1.1.0"
1444514483

14446-
[email protected], invariant@^2.1.0, invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4:
14484+
[email protected], invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4:
1444714485
version "2.2.4"
1444814486
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
1444914487
dependencies:
@@ -16834,7 +16872,7 @@ [email protected]:
1683416872
version "4.17.5"
1683516873
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
1683616874

16837-
"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.0.1, lodash@^4.11.1, lodash@^4.11.2, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0:
16875+
"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.0.1, lodash@^4.11.1, lodash@^4.11.2, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0:
1683816876
version "4.17.15"
1683916877
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
1684016878
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
@@ -21495,22 +21533,22 @@ react-devtools-inline@^4.0.0:
2149521533
resolved "https://registry.yarnpkg.com/react-devtools-inline/-/react-devtools-inline-4.0.0.tgz#f77f22d232bac62af5fd901a24a162c92fb0720f"
2149621534
integrity sha512-IW2ZGy96sK8J2tmm+1huPYgNvEaoodAUGBK2vTQXgLC5AzaBxf2jl8VtdMU8+bPQsxtU+BVcAIJFgN3lsunxOQ==
2149721535

21498-
react-dnd-html5-backend@^2.4.1:
21499-
version "2.6.0"
21500-
resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-2.6.0.tgz#590cd1cca78441bb274edd571fef4c0b16ddcf8e"
21536+
react-dnd-html5-backend@^9.4.0:
21537+
version "9.4.0"
21538+
resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-9.4.0.tgz#5b1d192f57d103298657cde1fe0eabdbf2726311"
21539+
integrity sha512-gehPwLp505F6RoFkQiDX7Q4mbpbyfyT0TbIoZop/m4vkBw6yUE/QLrnxBQdNpDPSwL/9XkZxxd/PrbeMCQ+WrQ==
2150121540
dependencies:
21502-
lodash "^4.2.0"
21541+
dnd-core "^9.4.0"
2150321542

21504-
react-dnd@^7.0.2:
21505-
version "7.0.2"
21506-
resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-7.0.2.tgz#8f5611a6e877592932c082d6280c64d1c817f420"
21507-
integrity sha512-nJnHJo/tNQjyod234+hPNopWHPvgH0gujf3pcdJWRe3l0GL+jSXXwXJ2SFwIHkVmxPYrx8+gbKU3+Pq26p6fkg==
21543+
react-dnd@^9.4.0:
21544+
version "9.4.0"
21545+
resolved "https://registry.yarnpkg.com/react-dnd/-/react-dnd-9.4.0.tgz#eec87035c6360fb33a44932326b3369af011a41c"
21546+
integrity sha512-jnLF8qKowCKTqSddfCiLx5+sb+HxO1qgdiAgbBeL8yuo5tRYNtKxZYn7+wVwNoyZuWEuM1Gw/Wsdhr+yb2RELQ==
2150821547
dependencies:
21509-
dnd-core "^7.0.2"
21510-
hoist-non-react-statics "^3.1.0"
21511-
invariant "^2.1.0"
21512-
lodash "^4.17.11"
21513-
recompose "^0.30.0"
21548+
"@types/hoist-non-react-statics" "^3.3.1"
21549+
"@types/shallowequal" "^1.1.1"
21550+
dnd-core "^9.4.0"
21551+
hoist-non-react-statics "^3.3.0"
2151421552
shallowequal "^1.1.0"
2151521553

2151621554
react-docgen@^4.1.0:
@@ -21554,6 +21592,15 @@ react-draggable@^3.0.5, react-draggable@^3.1.1:
2155421592
classnames "^2.2.5"
2155521593
prop-types "^15.6.0"
2155621594

21595+
react-dropzone@^10.1.10:
21596+
version "10.1.10"
21597+
resolved "https://registry.yarnpkg.com/react-dropzone/-/react-dropzone-10.1.10.tgz#f340290dfc26ac09ad68abc020ab6232c23d6cf3"
21598+
integrity sha512-vcLBdkYo7wgZpw1o4cz7uk8/Mmm+sYHeiTfFSshA/EGthz/TjjrTOrKwvFHm3o1p1LPk+x+KbDDlw5OeIo6eYA==
21599+
dependencies:
21600+
attr-accept "^1.1.3"
21601+
file-selector "^0.1.11"
21602+
prop-types "^15.7.2"
21603+
2155721604
react-emotion@^9.1.1:
2155821605
version "9.1.3"
2155921606
resolved "https://registry.yarnpkg.com/react-emotion/-/react-emotion-9.1.3.tgz#299c29731d12d6236e33277845f5692ec8ba92d6"
@@ -22380,7 +22427,7 @@ redux-thunk@^2.3.0:
2238022427
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
2238122428
integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==
2238222429

22383-
redux@^4.0.0, redux@^4.0.1:
22430+
redux@^4.0.0, redux@^4.0.1, redux@^4.0.4:
2238422431
version "4.0.4"
2238522432
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.4.tgz#4ee1aeb164b63d6a1bcc57ae4aa0b6e6fa7a3796"
2238622433
integrity sha512-vKv4WdiJxOWKxK0yRoaK3Y4pxxB0ilzVx6dszU2W8wLxlb2yikRph4iV/ymtdJ6ZxpBLFbyrxklnT5yBbQSl3Q==

0 commit comments

Comments
 (0)