Skip to content

Commit a1dc543

Browse files
committed
Pure Apollo integration based on master
- [x] `apollo-client` with full server-side rendering - [x] `apollo-link-state` - Client-side state management with `networkStatus` example - [x] `apollo-server` Without: * Flux (Redux) store - replaced by `apollo-link-state` * Fetch function - No need when you have an `apolloClient`
1 parent 0dbae53 commit a1dc543

35 files changed

+2142
-367
lines changed

.eslintrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ module.exports = {
4646
},
4747
],
4848

49+
// Allow only special identifiers
50+
// https://eslint.org/docs/rules/no-underscore-dangle
51+
'no-underscore-dangle': [
52+
'error',
53+
{
54+
allow: ['__typename'],
55+
},
56+
],
57+
4958
// Prefer destructuring from arrays and objects
5059
// http://eslint.org/docs/rules/prefer-destructuring
5160
'prefer-destructuring': [

README.md

+31-41
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,34 @@ and newcomers to the industry.
2121
<sup><a href="https://x-team.com/join/?utm_source=reactstarterkit&utm_medium=github-link&utm_campaign=reactstarterkit-june">Hiring</a></sup>
2222
</p>
2323

24-
2524
### Getting Started
2625

27-
* Follow the [getting started guide](./docs/getting-started.md) to download and run the project
28-
([Node.js](https://nodejs.org/) >= 6.5)
29-
* Check the [code recipes](./docs/recipes) used in this boilerplate, or share yours
30-
26+
* Follow the [getting started guide](./docs/getting-started.md) to download and run the project
27+
([Node.js](https://nodejs.org/) >= 6.5)
28+
* Check the [code recipes](./docs/recipes) used in this boilerplate, or share yours
3129

3230
### Customization
3331

3432
The `master` branch of React Starter Kit doesn't include a Flux implementation or any other
35-
advanced integrations. Nevertheless, we have some integrations available to you in *feature*
33+
advanced integrations. Nevertheless, we have some integrations available to you in _feature_
3634
branches that you can use either as a reference or merge into your project:
3735

38-
* [feature/redux](https://github.com/kriasoft/react-starter-kit/tree/feature/redux) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1084))
39-
— isomorphic Redux by [Pavel Lang](https://github.com/langpavel)
40-
(see [how to integrate Redux](./docs/recipes/how-to-integrate-redux.md)) (based on `master`)
41-
* [feature/apollo](https://github.com/kriasoft/react-starter-kit/tree/feature/apollo) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1147))
42-
— isomorphic Apollo Client by [Pavel Lang](https://github.com/langpavel)
43-
(see [Tracking PR #1147](https://github.com/kriasoft/react-starter-kit/pull/1147)) (based on `feature/redux`)
44-
* [feature/react-intl](https://github.com/kriasoft/react-starter-kit/tree/feature/react-intl) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1135))
45-
— isomorphic Redux and React Intl by [Pavel Lang](https://github.com/langpavel)
46-
(see [how to integrate React Intl](./docs/recipes/how-to-integrate-react-intl.md)) (based on `feature/apollo`)
36+
* [feature/redux](https://github.com/kriasoft/react-starter-kit/tree/feature/redux) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1084))
37+
— isomorphic Redux by [Pavel Lang](https://github.com/langpavel)
38+
(see [how to integrate Redux](./docs/recipes/how-to-integrate-redux.md)) (based on `master`)
39+
* [feature/apollo](https://github.com/kriasoft/react-starter-kit/tree/feature/apollo) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1147))
40+
— isomorphic Apollo Client by [Pavel Lang](https://github.com/langpavel)
41+
(see [Tracking PR #1147](https://github.com/kriasoft/react-starter-kit/pull/1147)) (based on `feature/redux`)
42+
* [feature/react-intl](https://github.com/kriasoft/react-starter-kit/tree/feature/react-intl) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1135))
43+
— isomorphic Redux and React Intl by [Pavel Lang](https://github.com/langpavel)
44+
(see [how to integrate React Intl](./docs/recipes/how-to-integrate-react-intl.md)) (based on `feature/apollo`)
4745

4846
You can see status of most reasonable merge combination as [PRs labeled as `TRACKING`](https://github.com/kriasoft/react-starter-kit/labels/TRACKING)
4947

5048
If you think that any of these features should be on `master`, or vice versa, some features should
5149
removed from the `master` branch, please [let us know](https://gitter.im/kriasoft/react-starter-kit).
5250
We love your feedback!
5351

54-
5552
### Comparison
5653

5754
<table width="100%">
@@ -98,12 +95,10 @@ We love your feedback!
9895
<td align="center">
9996
<a href="https://github.com/facebook/react">React</a>,
10097
<a href="https://github.com/ReactJSTraining/history">History</a>,
101-
<a href="https://github.com/reactjs/redux">Redux</a>
10298
</td>
10399
<td align="center">
104100
<a href="https://github.com/facebook/react">React</a>,
105101
<a href="https://github.com/ReactJSTraining/history">History</a>,
106-
<a href="https://github.com/reactjs/redux">Redux</a>
107102
</td>
108103
</tr>
109104
<tr>
@@ -149,7 +144,6 @@ We love your feedback!
149144
</tr>
150145
</table>
151146

152-
153147
### Backers
154148

155149
♥ React Starter Kit? Help us keep it alive by donating funds to cover project
@@ -178,7 +172,6 @@ expenses via [OpenCollective](https://opencollective.com/react-starter-kit) or
178172
<img src="https://opencollective.com/static/images/become_backer.svg" width="64" height="64" alt="">
179173
</a>
180174

181-
182175
### How to Contribute
183176

184177
Anyone and everyone is welcome to [contribute](CONTRIBUTING.md) to this project. The best way to
@@ -188,35 +181,31 @@ start is by checking our [open issues](https://github.com/kriasoft/react-starter
188181
participate in discussions, upvote or downvote the issues you like or dislike, send [pull
189182
requests](CONTRIBUTING.md#pull-requests).
190183

191-
192184
### Learn More
193185

194-
* [Getting Started with React.js](http://facebook.github.io/react/)
195-
* [Getting Started with GraphQL and Relay](https://quip.com/oLxzA1gTsJsE)
196-
* [React.js Questions on StackOverflow](http://stackoverflow.com/questions/tagged/reactjs)
197-
* [React.js Discussion Board](https://discuss.reactjs.org/)
198-
* [Flux Architecture for Building User Interfaces](http://facebook.github.io/flux/)
199-
* [Enzyme — JavaScript Testing utilities for React](http://airbnb.io/enzyme/)
200-
* [Flow — A static type checker for JavaScript](http://flowtype.org/)
201-
* [The Future of React](https://github.com/reactjs/react-future)
202-
* [Learn ES6](https://babeljs.io/docs/learn-es6/), [ES6 Features](https://github.com/lukehoban/es6features#readme)
203-
186+
* [Getting Started with React.js](http://facebook.github.io/react/)
187+
* [Getting Started with GraphQL and Relay](https://quip.com/oLxzA1gTsJsE)
188+
* [React.js Questions on StackOverflow](http://stackoverflow.com/questions/tagged/reactjs)
189+
* [React.js Discussion Board](https://discuss.reactjs.org/)
190+
* [Flux Architecture for Building User Interfaces](http://facebook.github.io/flux/)
191+
* [Enzyme — JavaScript Testing utilities for React](http://airbnb.io/enzyme/)
192+
* [Flow — A static type checker for JavaScript](http://flowtype.org/)
193+
* [The Future of React](https://github.com/reactjs/react-future)
194+
* [Learn ES6](https://babeljs.io/docs/learn-es6/), [ES6 Features](https://github.com/lukehoban/es6features#readme)
204195

205196
### Related Projects
206197

207-
* [GraphQL Starter Kit](https://github.com/kriasoft/graphql-starter-kit) — Boilerplate for building data APIs with Node.js, JavaScript (via Babel) and GraphQL
208-
* [Membership Database](https://github.com/membership/membership.db) — SQL schema boilerplate for user accounts, profiles, roles, and auth claims
209-
* [Babel Starter Kit](https://github.com/kriasoft/babel-starter-kit) — Boilerplate for authoring JavaScript/React.js libraries
210-
198+
* [GraphQL Starter Kit](https://github.com/kriasoft/graphql-starter-kit) — Boilerplate for building data APIs with Node.js, JavaScript (via Babel) and GraphQL
199+
* [Membership Database](https://github.com/membership/membership.db) — SQL schema boilerplate for user accounts, profiles, roles, and auth claims
200+
* [Babel Starter Kit](https://github.com/kriasoft/babel-starter-kit) — Boilerplate for authoring JavaScript/React.js libraries
211201

212202
### Support
213203

214-
* [#react-starter-kit](http://stackoverflow.com/questions/tagged/react-starter-kit) on Stack Overflow — Questions and answers
215-
* [#react-starter-kit](https://gitter.im/kriasoft/react-starter-kit) on Gitter — Watch announcements, share ideas and feedback
216-
* [GitHub issues](https://github.com/kriasoft/react-starter-kit/issues), or [Scrum board](https://waffle.io/kriasoft/react-starter-kit) — File issues, send feature requests
217-
* [appear.in/react](https://appear.in/react) — Open hours! Exchange ideas and experiences (React, GraphQL, startups and pet projects)
218-
* [@koistya](https://twitter.com/koistya) on [Codementor](https://www.codementor.io/koistya), or [Skype](http://hatscripts.com/addskype?koistya) — Private consulting
219-
204+
* [#react-starter-kit](http://stackoverflow.com/questions/tagged/react-starter-kit) on Stack Overflow — Questions and answers
205+
* [#react-starter-kit](https://gitter.im/kriasoft/react-starter-kit) on Gitter — Watch announcements, share ideas and feedback
206+
* [GitHub issues](https://github.com/kriasoft/react-starter-kit/issues), or [Scrum board](https://waffle.io/kriasoft/react-starter-kit) — File issues, send feature requests
207+
* [appear.in/react](https://appear.in/react) — Open hours! Exchange ideas and experiences (React, GraphQL, startups and pet projects)
208+
* [@koistya](https://twitter.com/koistya) on [Codementor](https://www.codementor.io/koistya), or [Skype](http://hatscripts.com/addskype?koistya) — Private consulting
220209

221210
### License
222211

@@ -226,6 +215,7 @@ file. The documentation to the project is licensed under the
226215
[CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/) license.
227216

228217
---
218+
229219
Made with ♥ by Konstantin Tarkus ([@koistya](https://twitter.com/koistya)) and [contributors](https://github.com/kriasoft/react-starter-kit/graphs/contributors)
230220

231221
[rsk]: https://www.reactstarterkit.com

docs/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* [Getting Started](./getting-started.md)
66
* [React Style Guide](./react-style-guide.md)
77
* [How to configure text editors and IDEs](./how-to-configure-text-editors.md)
8-
* [Data fetching with WHATWG Fetch](./data-fetching.md)
98
* [Testing your application](./testing-your-application.md)
109

1110
### Questions
@@ -16,7 +15,6 @@
1615
### Recipes
1716

1817
* [How to Implement Routing and Navigation](./recipes/how-to-implement-routing.md)
19-
* [How to Integrate Redux](./recipes/how-to-integrate-redux.md)
2018
* [How to Integrate React Intl](./recipes/how-to-integrate-react-intl.md)
2119
* [How to Integrate Disqus](./recipes/how-to-integrate-disqus.md)
2220
* [How to Use Sass/SCSS](./recipes/how-to-use-sass.md)

docs/data-fetching.md

-63
This file was deleted.

docs/getting-started.md

-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ Before you start, take a moment to see how the project structure looks like:
4444
└── yarn.lock # Fixed versions of all the dependencies
4545
```
4646

47-
**Note**: The current version of RSK does not contain a Flux implementation. It
48-
can be easily integrated with any Flux library of your choice. The most commonly
49-
used Flux libraries are [Flux](http://facebook.github.io/flux/),
50-
[Redux](http://redux.js.org/) and [Relay](http://facebook.github.io/relay/).
51-
5247
### Quick Start
5348

5449
#### 1. Get the latest version

docs/recipes/how-to-integrate-redux.md

-52
This file was deleted.

jest.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ module.exports = {
9090
// timers: // [string]
9191

9292
transform: {
93-
'\\.(js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest',
93+
'\\.(js|jsx)$': '<rootDir>/node_modules/babel-jest',
94+
'\\.(gql|graphql)$': '<rootDir>/node_modules/jest-transform-graphql',
9495
'^(?!.*\\.(js|jsx|json|css|less|styl|scss|sass|sss)$)':
9596
'<rootDir>/tools/lib/fileTransformer.js',
9697
},

package.json

+15-1
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,27 @@
1414
],
1515
"dependencies": {
1616
"@babel/polyfill": "^7.0.0-beta.51",
17+
"apollo-cache-inmemory": "^1.2.9",
18+
"apollo-client": "^2.4.1",
19+
"apollo-link": "^1.2.2",
20+
"apollo-link-error": "^1.1.0",
21+
"apollo-link-http": "^1.5.4",
22+
"apollo-link-logger": "^1.2.3",
23+
"apollo-link-schema": "^1.1.0",
24+
"apollo-link-state": "^0.4.1",
25+
"apollo-server": "^2.0.6",
26+
"apollo-server-express": "^2.0.5",
1727
"body-parser": "^1.18.3",
1828
"classnames": "^2.2.6",
1929
"cookie-parser": "^1.4.3",
2030
"express": "^4.16.3",
21-
"express-graphql": "^0.6.12",
2231
"express-jwt": "^5.3.1",
2332
"graphql": "^0.13.2",
33+
"graphql-tag": "^2.9.2",
2434
"history": "^4.7.2",
2535
"isomorphic-style-loader": "^4.0.0",
2636
"jsonwebtoken": "^8.3.0",
37+
"lodash.merge": "^4.6.1",
2738
"node-fetch": "^2.1.2",
2839
"normalize.css": "^8.0.0",
2940
"passport": "^0.4.0",
@@ -32,6 +43,7 @@
3243
"prop-types": "^15.6.1",
3344
"query-string": "^6.1.0",
3445
"react": "^16.4.1",
46+
"react-apollo": "^2.1.11",
3547
"react-dom": "^16.4.1",
3648
"sequelize": "^4.37.10",
3749
"serialize-javascript": "^1.5.0",
@@ -77,6 +89,8 @@
7789
"husky": "^0.14.3",
7890
"identity-obj-proxy": "^3.0.0",
7991
"jest": "^23.1.0",
92+
"jest-codemods": "^0.15.0",
93+
"jest-transform-graphql": "^2.1.0",
8094
"lint-staged": "^7.2.0",
8195
"markdown-it": "^8.4.1",
8296
"mkdirp": "^0.5.1",

0 commit comments

Comments
 (0)