Skip to content

Commit 4055f7e

Browse files
committed
1 parent c342ea0 commit 4055f7e

File tree

10 files changed

+163
-7
lines changed

10 files changed

+163
-7
lines changed

examples/graphql/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"normalize.css": "^8.0.1",
1515
"react": "^16.13.1",
1616
"react-dom": "^16.13.1",
17+
"react-router": "^5.2.0",
18+
"react-router-dom": "^5.2.0",
1719
"react-scripts": "3.4.3",
1820
"typescript": "~3.7.2"
1921
},
@@ -37,5 +39,9 @@
3739
"last 1 firefox version",
3840
"last 1 safari version"
3941
]
42+
},
43+
"devDependencies": {
44+
"@types/react-router": "^5.1.8",
45+
"@types/react-router-dom": "^5.1.5"
4046
}
4147
}
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
.app {
2-
text-align: center;
3-
42
&-header {
53
background-color: #282c34;
6-
min-height: 100vh;
74
display: flex;
85
flex-direction: column;
96
align-items: center;
107
justify-content: center;
11-
font-size: calc(10px + 2vmin);
128
color: white;
139
}
1410
}

examples/graphql/src/app/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import Routing from "pages";
23
import './index.scss';
34

45
const App = () => {
@@ -7,6 +8,7 @@ const App = () => {
78
<header className="app-header">
89
TODO App
910
</header>
11+
<Routing />
1012
</div>
1113
);
1214
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React, { lazy, Suspense } from 'react'
2+
import { BrowserRouter, Switch, Route, Redirect } from "react-router-dom";
3+
4+
const TasksListPage = lazy(() => import("./tasks-list"));
5+
const TaskDetailsPage = lazy(() => import("./task-details"));
6+
7+
const Routing = () => (
8+
<BrowserRouter>
9+
<Suspense fallback="Loading...">
10+
<Switch>
11+
<Route exact path="/" component={TasksListPage} />
12+
<Route exact path="/:id" component={TaskDetailsPage} />
13+
<Redirect to="/" />
14+
</Switch>
15+
</Suspense>
16+
</BrowserRouter>
17+
)
18+
19+
export default Routing
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react'
2+
3+
const TaskDetails = () => {
4+
return (
5+
<div>
6+
page:TaskDetails
7+
</div>
8+
)
9+
}
10+
11+
export default TaskDetails

examples/graphql/src/pages/tasks-details/.gitkeep

Whitespace-only changes.

examples/graphql/src/pages/tasks-list/.gitkeep

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react'
2+
3+
const TasksList = () => {
4+
return (
5+
<div>
6+
page:TasksList
7+
</div>
8+
)
9+
}
10+
11+
export default TasksList

examples/graphql/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4+
"baseUrl": "./src",
45
"lib": [
56
"dom",
67
"dom.iterable",

examples/graphql/yarn.lock

Lines changed: 113 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,7 +1366,7 @@
13661366
dependencies:
13671367
regenerator-runtime "^0.13.2"
13681368

1369-
"@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.5.1", "@babel/runtime@^7.8.4":
1369+
"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.5.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4":
13701370
version "7.11.2"
13711371
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736"
13721372
integrity sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==
@@ -1896,6 +1896,11 @@
18961896
"@types/minimatch" "*"
18971897
"@types/node" "*"
18981898

1899+
"@types/history@*":
1900+
version "4.7.8"
1901+
resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
1902+
integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
1903+
18991904
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
19001905
version "2.0.1"
19011906
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
@@ -1977,6 +1982,23 @@
19771982
dependencies:
19781983
"@types/react" "*"
19791984

1985+
"@types/react-router-dom@^5.1.5":
1986+
version "5.1.5"
1987+
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.1.5.tgz#7c334a2ea785dbad2b2dcdd83d2cf3d9973da090"
1988+
integrity sha512-ArBM4B1g3BWLGbaGvwBGO75GNFbLDUthrDojV2vHLih/Tq8M+tgvY1DSwkuNrPSwdp/GUL93WSEpTZs8nVyJLw==
1989+
dependencies:
1990+
"@types/history" "*"
1991+
"@types/react" "*"
1992+
"@types/react-router" "*"
1993+
1994+
"@types/react-router@*", "@types/react-router@^5.1.8":
1995+
version "5.1.8"
1996+
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.8.tgz#4614e5ba7559657438e17766bb95ef6ed6acc3fa"
1997+
integrity sha512-HzOyJb+wFmyEhyfp4D4NYrumi+LQgQL/68HvJO+q6XtuHSDvw6Aqov7sCAhjbNq3bUPgPqbdvjXC5HeB2oEAPg==
1998+
dependencies:
1999+
"@types/history" "*"
2000+
"@types/react" "*"
2001+
19802002
"@types/react@*", "@types/react@^16.9.0":
19812003
version "16.9.50"
19822004
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.50.tgz#cb5f2c22d42de33ca1f5efc6a0959feb784a3a2d"
@@ -5605,6 +5627,18 @@ hex-color-regex@^1.1.0:
56055627
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
56065628
integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==
56075629

5630+
history@^4.9.0:
5631+
version "4.10.1"
5632+
resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
5633+
integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==
5634+
dependencies:
5635+
"@babel/runtime" "^7.1.2"
5636+
loose-envify "^1.2.0"
5637+
resolve-pathname "^3.0.0"
5638+
tiny-invariant "^1.0.2"
5639+
tiny-warning "^1.0.0"
5640+
value-equal "^1.0.1"
5641+
56085642
hmac-drbg@^1.0.0:
56095643
version "1.0.1"
56105644
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
@@ -5614,6 +5648,13 @@ hmac-drbg@^1.0.0:
56145648
minimalistic-assert "^1.0.0"
56155649
minimalistic-crypto-utils "^1.0.1"
56165650

5651+
hoist-non-react-statics@^3.1.0:
5652+
version "3.3.2"
5653+
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
5654+
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
5655+
dependencies:
5656+
react-is "^16.7.0"
5657+
56175658
hosted-git-info@^2.1.4:
56185659
version "2.8.5"
56195660
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c"
@@ -6308,6 +6349,11 @@ is-wsl@^2.1.1:
63086349
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.1.1.tgz#4a1c152d429df3d441669498e2486d3596ebaf1d"
63096350
integrity sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog==
63106351

6352+
isarray@0.0.1:
6353+
version "0.0.1"
6354+
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
6355+
integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
6356+
63116357
isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0:
63126358
version "1.0.0"
63136359
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
@@ -7181,7 +7227,7 @@ loglevel@^1.6.8:
71817227
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.0.tgz#728166855a740d59d38db01cf46f042caa041bb0"
71827228
integrity sha512-i2sY04nal5jDcagM3FMfG++T69GEEM8CYuOfeOIvmXzOIcwE9a/CJPR0MFM97pYMj/u10lzz7/zd7+qwhrBTqQ==
71837229

7184-
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
7230+
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
71857231
version "1.4.0"
71867232
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
71877233
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -7404,6 +7450,14 @@ min-indent@^1.0.0:
74047450
resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869"
74057451
integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==
74067452

7453+
mini-create-react-context@^0.4.0:
7454+
version "0.4.0"
7455+
resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.0.tgz#df60501c83151db69e28eac0ef08b4002efab040"
7456+
integrity sha512-b0TytUgFSbgFJGzJqXPKCFCBWigAjpjo+Fl7Vf7ZbKRDptszpppKxXH6DRXEABZ/gcEQczeb0iZ7JvL8e8jjCA==
7457+
dependencies:
7458+
"@babel/runtime" "^7.5.5"
7459+
tiny-warning "^1.0.3"
7460+
74077461
mini-css-extract-plugin@0.9.0:
74087462
version "0.9.0"
74097463
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz#47f2cf07aa165ab35733b1fc97d4c46c0564339e"
@@ -8272,6 +8326,13 @@ path-to-regexp@0.1.7:
82728326
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
82738327
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
82748328

8329+
path-to-regexp@^1.7.0:
8330+
version "1.8.0"
8331+
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a"
8332+
integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==
8333+
dependencies:
8334+
isarray "0.0.1"
8335+
82758336
path-type@^1.0.0:
82768337
version "1.1.0"
82778338
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
@@ -9387,7 +9448,7 @@ react-error-overlay@^6.0.7:
93879448
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.7.tgz#1dcfb459ab671d53f660a991513cb2f0a0553108"
93889449
integrity sha512-TAv1KJFh3RhqxNvhzxj6LeT5NWklP6rDr2a0jaTfsZ5wSZWHOGeqQyejUp3xxLfPt2UpyJEcVQB/zyPcmonNFA==
93899450

9390-
react-is@^16.12.0:
9451+
react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0:
93919452
version "16.13.1"
93929453
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
93939454
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -9397,6 +9458,35 @@ react-is@^16.8.1, react-is@^16.8.4:
93979458
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
93989459
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==
93999460

9461+
react-router-dom@^5.2.0:
9462+
version "5.2.0"
9463+
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
9464+
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
9465+
dependencies:
9466+
"@babel/runtime" "^7.1.2"
9467+
history "^4.9.0"
9468+
loose-envify "^1.3.1"
9469+
prop-types "^15.6.2"
9470+
react-router "5.2.0"
9471+
tiny-invariant "^1.0.2"
9472+
tiny-warning "^1.0.0"
9473+
9474+
react-router@5.2.0, react-router@^5.2.0:
9475+
version "5.2.0"
9476+
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
9477+
integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==
9478+
dependencies:
9479+
"@babel/runtime" "^7.1.2"
9480+
history "^4.9.0"
9481+
hoist-non-react-statics "^3.1.0"
9482+
loose-envify "^1.3.1"
9483+
mini-create-react-context "^0.4.0"
9484+
path-to-regexp "^1.7.0"
9485+
prop-types "^15.6.2"
9486+
react-is "^16.6.0"
9487+
tiny-invariant "^1.0.2"
9488+
tiny-warning "^1.0.0"
9489+
94009490
react-scripts@3.4.3:
94019491
version "3.4.3"
94029492
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-3.4.3.tgz#21de5eb93de41ee92cd0b85b0e1298d0bb2e6c51"
@@ -9824,6 +9914,11 @@ resolve-from@^4.0.0:
98249914
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
98259915
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
98269916

9917+
resolve-pathname@^3.0.0:
9918+
version "3.0.0"
9919+
resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd"
9920+
integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==
9921+
98279922
resolve-url-loader@3.1.1:
98289923
version "3.1.1"
98299924
resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-3.1.1.tgz#28931895fa1eab9be0647d3b2958c100ae3c0bf0"
@@ -10952,6 +11047,16 @@ timsort@^0.3.0:
1095211047
resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4"
1095311048
integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=
1095411049

11050+
tiny-invariant@^1.0.2:
11051+
version "1.1.0"
11052+
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875"
11053+
integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==
11054+
11055+
tiny-warning@^1.0.0, tiny-warning@^1.0.3:
11056+
version "1.0.3"
11057+
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
11058+
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==
11059+
1095511060
tmp@^0.0.33:
1095611061
version "0.0.33"
1095711062
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
@@ -11327,6 +11432,11 @@ validate-npm-package-license@^3.0.1:
1132711432
spdx-correct "^3.0.0"
1132811433
spdx-expression-parse "^3.0.0"
1132911434

11435+
value-equal@^1.0.1:
11436+
version "1.0.1"
11437+
resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c"
11438+
integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==
11439+
1133011440
vary@~1.1.2:
1133111441
version "1.1.2"
1133211442
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"

0 commit comments

Comments
 (0)