Skip to content

Commit b571cad

Browse files
committed
update to React 17
1 parent 1fce30a commit b571cad

13 files changed

Lines changed: 10589 additions & 5755 deletions

.eslintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"parser": "babel-eslint",
33
"rules": {
4+
"react/jsx-uses-react": "off",
5+
"react/react-in-jsx-scope": "off",
46
"react/jsx-filename-extension": [
57
1,
68
{

.prettierrc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
{
2-
"endOfLine": "lf",
3-
"semi": false,
4-
"singleQuote": false,
5-
"tabWidth": 2,
6-
"trailingComma": "es5"
2+
"semi": false
73
}

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
This is a simple React example that uses Apollo Boost to run queries and mutations on a mock GraphQL Backend.
44

5-
Run `npm run start` to start the json-graphql-serve and the React client.
6-
7-
## Versions
8-
9-
- [Version 1](https://github.com/DavidBuck/react-graphql-example/tree/v1.0) - React version 16.13.1 & Apollo-boost 0.4.7.
5+
Run `npm run start` to start the json-graphql-server and the React client.
106

117
## Tools
128

139
- [JSON Server](https://github.com/typicode/json-server)
1410
- [Apollo Boost](https://www.npmjs.com/package/apollo-boost)
1511
- [Tailwind](https://tailwindcss.com)
12+
13+
## Versions
14+
15+
- [Version 1.1](https://github.com/DavidBuck/react-graphql-example/tree/v1.1) - React version 17.0.1 & Apollo-boost 0.4.9.
16+
- [Version 1.0](https://github.com/DavidBuck/react-graphql-example/tree/v1.0) - React version 16.13.1 & Apollo-boost 0.4.7.

package-lock.json

Lines changed: 10547 additions & 5558 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
11
{
22
"name": "react-graphql-example",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "React GraphQL example",
55
"author": "David Buck",
66
"repository": "github:davidbuck/react-graphql-example",
77
"license": "MIT",
88
"private": true,
99
"dependencies": {
10-
"@apollo/react-hooks": "^3.1.5",
11-
"@fullhuman/postcss-purgecss": "^1.3.0",
12-
"apollo-boost": "^0.4.7",
13-
"autoprefixer": "^9.7.6",
10+
"@apollo/react-hooks": "^4.0.0",
11+
"apollo-boost": "^0.4.9",
12+
"autoprefixer": "^9.8.6",
1413
"babel-eslint": "^10.1.0",
15-
"concurrently": "^5.2.0",
16-
"eslint": "^6.8.0",
17-
"eslint-config-airbnb": "^18.1.0",
18-
"eslint-config-prettier": "^6.11.0",
19-
"eslint-loader": "^3.0.4",
20-
"eslint-plugin-import": "^2.20.2",
21-
"eslint-plugin-jsx-a11y": "^6.2.3",
22-
"eslint-plugin-prettier": "^3.1.3",
23-
"eslint-plugin-react": "^7.19.0",
24-
"eslint-plugin-react-hooks": "^2.5.1",
25-
"graphql": "^15.0.0",
14+
"concurrently": "^5.3.0",
15+
"eslint": "^7.12.1",
16+
"eslint-config-airbnb": "^18.2.0",
17+
"eslint-config-prettier": "^6.15.0",
18+
"eslint-loader": "^4.0.2",
19+
"eslint-plugin-import": "^2.22.1",
20+
"eslint-plugin-jsx-a11y": "^6.4.1",
21+
"eslint-plugin-prettier": "^3.1.4",
22+
"eslint-plugin-react": "^7.21.5",
23+
"eslint-plugin-react-hooks": "^4.2.0",
24+
"graphql": "^15.4.0",
2625
"json-graphql-server": "^2.1.3",
27-
"postcss-cli": "^6.1.3",
28-
"prettier": "^1.19.1",
29-
"react": "^16.13.1",
30-
"react-dom": "^16.13.1",
31-
"react-scripts": "^3.4.1",
32-
"tailwindcss": "^1.3.5"
26+
"postcss-cli": "^8.1.0",
27+
"prettier": "^2.1.2",
28+
"react": "^17.0.1",
29+
"react-dom": "^17.0.1",
30+
"react-scripts": "^4.0.0",
31+
"tailwindcss": "^1.9.6"
3332
},
3433
"scripts": {
3534
"server": "npx json-graphql-server db.js --p 4000",

postcss.config.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
const tailwindcss = require("tailwindcss")
2-
const purgecss = require("@fullhuman/postcss-purgecss")
32

43
module.exports = {
5-
plugins: [
6-
tailwindcss("./tailwind.js"),
7-
require("autoprefixer"),
8-
process.env.NODE_ENV === "production" &&
9-
purgecss({
10-
content: ["./src/**/*.js"],
11-
css: ["./src/**/*.css"],
12-
}),
13-
],
4+
plugins: [tailwindcss("./tailwind.config.js"), require("autoprefixer")],
145
}

src/App.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react"
21
import { gql } from "apollo-boost"
32
import { useQuery, useMutation } from "@apollo/react-hooks"
43

@@ -139,7 +138,7 @@ function App() {
139138
</tr>
140139
</thead>
141140
<tbody>
142-
{data.allPosts.map(post => (
141+
{data.allPosts.map((post) => (
143142
<tr key={post.id}>
144143
<td className="border px-4 py-2 border-gray-600">{post.id}</td>
145144
<td className="border px-4 py-2 border-gray-600">{post.title}</td>

src/App.test.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import React from "react"
21
import ReactDOM from "react-dom"
32
import ApolloClient from "apollo-boost"
43
import { ApolloProvider } from "@apollo/react-hooks"
54
import "./styles/tailwind.css"
65
import App from "./App"
76

8-
// import * as serviceWorker from './serviceWorker';
9-
107
const client = new ApolloClient({
118
uri: "http://localhost:4000/graphql",
129
})

src/logo.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)