Skip to content

Commit bc7b565

Browse files
committed
1.5.2
1.5.2 - 2017-06-05 ------------------------------------------------ ## ESLint * Adds React ignore for the following props: - `dispatch`, for less Redux boilerplate - `data`, injected by Apollo ## Apollo * Removes redundant `kit/lib/apollo.js -> mergeData()` function
1 parent 20005e5 commit bc7b565

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ module.exports = {
2929
'react/prefer-stateless-function': [2, { ignorePureComponents: true }],
3030
'react/no-multi-comp': 0,
3131
'react/jsx-closing-bracket-location': [1, 'after-props'],
32+
'react/prop-types': [1, {
33+
ignore: [
34+
// `dispatch` is typically used by Redux `@connect`
35+
'dispatch',
36+
// `data` is injected by Apollo
37+
'data',
38+
],
39+
}],
3240
'linebreak-style': 0,
3341
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
3442
'no-restricted-syntax': [2,

CHANGELOG

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
1.5.2 - 2017-06-05
2+
------------------------------------------------
3+
4+
## ESLint
5+
* Adds React ignore for the following props:
6+
- `dispatch`, for less Redux boilerplate
7+
- `data`, injected by Apollo
8+
9+
## Apollo
10+
* Removes redundant `kit/lib/apollo.js -> mergeData()` function
11+
112
1.5.1 - 2017-06-01
213
------------------------------------------------
314

kit/lib/apollo.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// ----------------------
22
// IMPORTS
33

4-
// React propTypes
5-
import PropTypes from 'prop-types';
6-
74
// Apollo client library
85
import { createNetworkInterface, ApolloClient } from 'react-apollo';
96

@@ -28,14 +25,6 @@ function createClient(opt = {}) {
2825
}, opt));
2926
}
3027

31-
// Helper function that will merge a passed object with the expected
32-
// React propTypes 'shape', for use with the `react-apollo` `graphql` HOC
33-
export function mergeData(toMerge) {
34-
return PropTypes.shape(Object.assign({
35-
loading: PropTypes.bool.isRequired,
36-
}, toMerge));
37-
}
38-
3928
// Creates a new browser client
4029
export function browserClient() {
4130
return createClient();

src/app.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ import {
1818
// <Helmet> component for setting the page title
1919
import Helmet from 'react-helmet';
2020

21-
// Helper to merge expected React PropTypes to Apollo-enabled component
22-
import { mergeData } from 'kit/lib/apollo';
23-
2421
// NotFound 404 handler for unknown routes
2522
import { NotFound, Redirect } from 'kit/lib/routing';
2623

@@ -98,7 +95,7 @@ const query = gql`
9895
@graphql(query)
9996
class GraphQLMessage extends React.PureComponent {
10097
static propTypes = {
101-
data: mergeData({
98+
data: PropTypes.shape({
10299
allMessages: PropTypes.arrayOf(
103100
PropTypes.shape({
104101
text: PropTypes.string.isRequired,

0 commit comments

Comments
 (0)