Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit 2a330a7

Browse files
authored
Merge pull request #2758 from apollographql/release-2.5.0
Release 2.5.0
2 parents e87986b + 4249523 commit 2a330a7

Some content is hidden

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

47 files changed

+1960
-2416
lines changed

.circleci/config.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,47 +61,31 @@ jobs:
6161
- store_artifacts:
6262
path: reports/junit
6363

64-
Browser:
65-
docker: [{ image: 'circleci/node:8' }]
66-
steps:
67-
- checkout
68-
- run: npm i
69-
- run: npm run compile
70-
- run:
71-
name: Jest suite
72-
command: npm run test:compiled:browser:umd -- --ci --testResultsProcessor="jest-junit"
73-
environment:
74-
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
75-
- store_test_results:
76-
path: reports/junit
77-
- store_artifacts:
78-
path: reports/junit
79-
80-
Server:
64+
Commonjs:
8165
docker: [{ image: 'circleci/node:8' }]
8266
steps:
8367
- checkout
8468
- run: npm i
8569
- run: npm run compile
8670
- run:
8771
name: Jest suite
88-
command: npm run test:compiled:server:umd -- --ci --testResultsProcessor="jest-junit"
72+
command: npm run test:compiled:cjs -- --ci --testResultsProcessor="jest-junit"
8973
environment:
9074
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
9175
- store_test_results:
9276
path: reports/junit
9377
- store_artifacts:
9478
path: reports/junit
9579

96-
Commonjs:
80+
UMD:
9781
docker: [{ image: 'circleci/node:8' }]
9882
steps:
9983
- checkout
10084
- run: npm i
10185
- run: npm run compile
10286
- run:
10387
name: Jest suite
104-
command: npm run test:compiled:cjs -- --ci --testResultsProcessor="jest-junit"
88+
command: npm run test:compiled:umd -- --ci --testResultsProcessor="jest-junit"
10589
environment:
10690
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
10791
- store_test_results:
@@ -126,7 +110,6 @@ workflows:
126110
- Linting
127111
- Typecheck
128112
- Preact
129-
- Browser
130-
- Server
113+
- UMD
131114
- Commonjs
132115
- Filesize

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea
2+
.rpt2_cache
23

34
# Logs
45
logs

Changelog.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Change log
22

3-
## vNext
4-
5-
### Bug Fixes
3+
## 2.5.0
64

75
### Improvements
86

7+
- Ready to be used with Apollo Client 2.5 and its new local state management
8+
features, as well as many overall code improvements to help reduce the React
9+
Apollo bundle size. <br/>
10+
[#2758](https://github.com/apollographql/react-apollo/pull/2758)
911
- A function can now be set as a `MockedResponse` `result` when using
1012
`MockedProvider`, such that every time the mocked result is returned,
1113
the function is run to calculate the result. This opens up new testing
@@ -37,6 +39,23 @@
3739

3840
### Improvements
3941

42+
- The `walkTree` function has been deprecated, since there's no way to
43+
make its behavior consistent with the latest versions of React. To save
44+
bundle size, `walkTree` is no longer exported from `react-apollo`,
45+
though you can still access it as follows:
46+
```js
47+
import { walkTree } from "react-apollo/walkTree"
48+
```
49+
50+
## 2.4.0
51+
52+
### Bug Fixes
53+
54+
- Invoke `onCompleted`/`onError` even if `Mutation` unmounts. <br/>
55+
[PR #2710](https://github.com/apollographql/react-apollo/pull/2710)
56+
57+
### Improvements
58+
4059
- Update the typescript example app to use the raw Query component directly,
4160
with generics, to avoid generating the extra object that's created (in the
4261
compiled code) when extending the Query component as a class. <br/>

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ React Apollo makes use of `Object.assign`, which is not supported in certain bro
147147
import 'core-js/fn/object/assign';
148148
```
149149

150+
## Building for production
151+
152+
The `react-apollo` package is designed to be effectively consumed by bundlers that understand either CommonJS `require` syntax or ECMASCript `import` and `export` syntax, such as [Rollup](https://rollupjs.org), [Webpack](https://webpack.js.org), or [Parcel](https://parceljs.org). If your bundler supports tree-shaking, it should be able to eliminate unused code from the `react-apollo` package, regardless of which module syntax you're using.
153+
154+
You should (almost) never need to reach into the `react-apollo/...` internals to import specific modules. The only supported exceptions are `react-apollo/test-links`, `react-apollo/test-utils`, and `react-apollo/walkTree` (deprecated).
155+
156+
When minifying your application, you can make the `react-apollo` package noticeably smaller by configuring your minifier to replace the expression `process.env.NODE_ENV` with a string literal (typically `"production"`). Other packages such as [React](https://reactjs.org) use the same convention, so there's a good chance you already have your minifier configured in this way.
157+
150158
## Documentation
151159

152160
For a complete React Apollo API reference visit the documentation website at: [https://www.apollographql.com/docs/react/api/react-apollo.html](https://www.apollographql.com/docs/react/api/react-apollo.html)

examples/ssr/.meteor/packages

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ static-html # Define static page content in .html files
1111
[email protected] # Reactive variable for tracker
1212
[email protected] # Meteor's client-side reactive programming library
1313

14-
[email protected].0 # CSS minifier run for production mode
14+
[email protected].2 # CSS minifier run for production mode
1515
[email protected] # JS minifier run for production mode
1616
[email protected] # ECMAScript 5 compatibility for older browsers
17-
[email protected].0 # Enable ECMAScript2015+ syntax in app code
17+
[email protected].4 # Enable ECMAScript2015+ syntax in app code
1818
[email protected] # Server-side component of the `meteor shell` command
1919
2020

examples/ssr/.meteor/release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+

examples/ssr/.meteor/versions

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
22
3-
3+
44
55
66
77
88
9-
9+
1010
1111
1212
@@ -15,9 +15,9 @@ [email protected]
1515
1616
1717
18-
19-
20-
18+
19+
20+
2121
2222
2323
@@ -35,12 +35,12 @@ [email protected]
3535
3636
3737
38-
38+
3939
4040
4141
4242
43-
43+
4444
4545
4646
@@ -49,7 +49,7 @@ [email protected]
4949
5050
5151
52-
52+
5353
5454
5555
@@ -59,11 +59,11 @@ [email protected]
5959
6060
6161
62-
62+
6363
6464
6565
6666
6767
68-
68+
6969

examples/ssr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"meteor-node-stubs": "^0.4.1",
2222
"node-fetch": "^2.2.0",
2323
"react": "^16.5.2",
24-
"react-apollo": "^2.3.1",
24+
"react-apollo": "^2.5.0-beta.0",
2525
"react-dom": "^16.5.2"
2626
},
2727
"devDependencies": {

jest.browser.umd.config.js

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

jest.cjs.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
const { jest } = require('./package.json');
22

33
jest.moduleNameMapper = {
4-
'\\.\\./src$': '<rootDir>/lib/index.js',
5-
'\\.\\./src/(.*)': '<rootDir>/lib/$1.js',
4+
'\\.\\./src$': '<rootDir>/lib/react-apollo.cjs.js',
5+
'\\.\\./src/test-utils': '<rootDir>/lib/test-utils.js',
6+
'\\.\\./src/walkTree': '<rootDir>/lib/walkTree.js',
7+
// Force other imports to /src/whatever to fail
8+
'\\.\\./src': '<rootDir>/test/fail-no-entry-point.js',
69
};
710

11+
// Ignore tests that don't go against the public API
12+
jest.modulePathIgnorePatterns.push('<rootDir>/test/internal-api');
13+
814
module.exports = jest;

jest.server.umd.config.js renamed to jest.umd.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { jest } = require('./package.json');
33
jest.moduleNameMapper = {
44
'\\.\\./src$': '<rootDir>/lib/react-apollo.umd.js',
55
'\\.\\./src/test-utils': '<rootDir>/lib/test-utils.js',
6+
'\\.\\./src/walkTree': '<rootDir>/lib/walkTree.js',
67
// Force other imports to /src/whatever to fail
78
'\\.\\./src': '<rootDir>/test/fail-no-entry-point.js',
89
};

0 commit comments

Comments
 (0)