Skip to content

Commit c6b8e7b

Browse files
committed
feat!: Update tutorial
1. Migrate react-router to v6 2. Fix issues with authentication 3. Fix issues with pagination 4. Misc fixes
1 parent a083d69 commit c6b8e7b

Some content is hidden

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

41 files changed

+8063
-24928
lines changed

.gitignore

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# See https://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
.idea
3+
.code
24

35
# dependencies
4-
node_modules
5-
/server/node_modules
6-
.graphcoolrc
6+
/node_modules
7+
/.pnp
8+
.pnp.js
79

810
# testing
911
/coverage
@@ -17,12 +19,6 @@ node_modules
1719
.env.development.local
1820
.env.test.local
1921
.env.production.local
20-
project.graphcool
21-
22-
# webstorm
23-
.idea
24-
graphql.config.json
25-
graphql.schema.json
2622

2723
npm-debug.log*
2824
yarn-debug.log*

package-lock.json

-13,999
This file was deleted.

package.json

+20-12
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
{
2-
"name": "hackernews-react-apollo",
3-
"version": "0.2.0",
2+
"name": "hackernews-react-apollo-follow-along",
3+
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@apollo/client": "^3.2.2",
7-
"graphql": "^15.3.0",
8-
"optimism": "^0.13.0",
9-
"react": "16.13.1",
10-
"react-dom": "16.13.1",
11-
"react-router": "5.2.0",
12-
"react-router-dom": "5.2.0",
13-
"react-scripts": "3.4.3",
14-
"subscriptions-transport-ws": "^0.9.18"
6+
"@apollo/client": "^3.5.7",
7+
"@testing-library/jest-dom": "^5.14.1",
8+
"@testing-library/react": "^12.0.0",
9+
"@testing-library/user-event": "^13.2.1",
10+
"graphql": "^16.2.0",
11+
"react": "^17.0.2",
12+
"react-dom": "^17.0.2",
13+
"react-router-dom": "^6.2.1",
14+
"react-scripts": "5.0.0",
15+
"subscriptions-transport-ws": "^0.11.0",
16+
"web-vitals": "^2.1.0"
1517
},
1618
"scripts": {
1719
"start": "react-scripts start",
1820
"build": "react-scripts build",
19-
"test": "react-scripts test --env=jsdom",
21+
"test": "react-scripts test",
2022
"eject": "react-scripts eject"
2123
},
24+
"eslintConfig": {
25+
"extends": [
26+
"react-app",
27+
"react-app/jest"
28+
]
29+
},
2230
"browserslist": {
2331
"production": [
2432
">0.2%",

public/index.html

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6-
<meta name="theme-color" content="#000000">
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
713
<!--
8-
manifest.json provides metadata used when your web app is added to the
9-
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1016
-->
11-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
12-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
13-
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/tachyons.min.css" />
17+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
1418
<!--
1519
Notice the use of %PUBLIC_URL% in the tags above.
1620
It will be replaced with the URL of the `public` folder during the build.
@@ -20,12 +24,14 @@
2024
work correctly both with client-side routing and a non-root public URL.
2125
Learn how to configure a non-root public URL by running `npm run build`.
2226
-->
27+
<link
28+
rel="stylesheet"
29+
href="https://unpkg.com/[email protected]/css/tachyons.min.css"
30+
/>
2331
<title>React App</title>
2432
</head>
2533
<body>
26-
<noscript>
27-
You need to enable JavaScript to run this app.
28-
</noscript>
34+
<noscript>You need to enable JavaScript to run this app.</noscript>
2935
<div id="root"></div>
3036
<!--
3137
This HTML file is a template.

public/logo192.png

5.22 KB
Loading

public/logo512.png

9.44 KB
Loading

public/manifest.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@
66
"src": "favicon.ico",
77
"sizes": "64x64 32x32 24x24 16x16",
88
"type": "image/x-icon"
9+
},
10+
{
11+
"src": "logo192.png",
12+
"type": "image/png",
13+
"sizes": "192x192"
14+
},
15+
{
16+
"src": "logo512.png",
17+
"type": "image/png",
18+
"sizes": "512x512"
919
}
1020
],
11-
"start_url": "./index.html",
21+
"start_url": ".",
1222
"display": "standalone",
1323
"theme_color": "#000000",
1424
"background_color": "#ffffff"

public/robots.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://www.robotstxt.org/robotstxt.html
2+
User-agent: *
3+
Disallow:

server/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"dev": "nodemon src/index.js"
88
},
99
"dependencies": {
10-
"@prisma/client": "^2.12.1",
10+
"@prisma/client": "^3.7.0",
1111
"apollo-server": "^2.19.0",
1212
"bcryptjs": "2.4.3",
1313
"jsonwebtoken": "8.5.1"
1414
},
1515
"devDependencies": {
16-
"@prisma/cli": "^2.12.1",
16+
"prisma": "^3.7.0",
1717
"nodemon": "^2.0.6"
1818
}
1919
}

server/prisma/dev.db

-4 KB
Binary file not shown.

server/prisma/migrations/20201125185150-init/README.md

-87
This file was deleted.

server/prisma/migrations/20201125185150-init/schema.prisma

-37
This file was deleted.

0 commit comments

Comments
 (0)