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
reactive-var@1.0.11 # Reactive variable for tracker
1212
tracker@1.2.0 # Meteor's client-side reactive programming library
1313

14-
standard-minifier-css@1.5.0 # CSS minifier run for production mode
14+
standard-minifier-css@1.5.2 # CSS minifier run for production mode
1515
standard-minifier-js@2.4.0 # JS minifier run for production mode
1616
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
17-
ecmascript@0.12.0 # Enable ECMAScript2015+ syntax in app code
17+
ecmascript@0.12.4 # Enable ECMAScript2015+ syntax in app code
1818
shell-server@0.4.0 # Server-side component of the `meteor shell` command
1919
server-render@0.3.1
2020
underscore@1.0.10

examples/ssr/.meteor/release

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

examples/ssr/.meteor/versions

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
allow-deny@1.1.0
22
autoupdate@1.5.0
3-
babel-compiler@7.2.1
3+
babel-compiler@7.2.4
44
babel-runtime@1.3.0
55
base64@1.0.11
66
binary-heap@1.0.11
77
blaze-tools@1.0.10
88
boilerplate-generator@1.6.0
9-
caching-compiler@1.2.0
9+
caching-compiler@1.2.1
1010
caching-html-compiler@1.1.3
1111
callback-hook@1.1.0
1212
check@1.3.1
@@ -15,9 +15,9 @@ ddp-client@2.3.3
1515
ddp-common@1.4.0
1616
ddp-server@2.2.0
1717
deps@1.0.12
18-
diff-sequence@1.1.0
19-
dynamic-import@0.5.0
20-
ecmascript@0.12.1
18+
diff-sequence@1.1.1
19+
dynamic-import@0.5.1
20+
ecmascript@0.12.4
2121
ecmascript-runtime@0.7.0
2222
ecmascript-runtime-client@0.8.0
2323
ecmascript-runtime-server@0.7.1
@@ -35,12 +35,12 @@ livedata@1.0.18
3535
logging@1.1.20
3636
meteor@1.9.2
3737
meteor-base@1.4.0
38-
minifier-css@1.4.0
38+
minifier-css@1.4.1
3939
minifier-js@2.4.0
4040
minimongo@1.4.5
4141
mobile-experience@1.0.5
4242
mobile-status-bar@1.0.14
43-
modern-browsers@0.1.2
43+
modern-browsers@0.1.3
4444
modules@0.13.0
4545
modules-runtime@0.10.3
4646
mongo@1.6.0
@@ -49,7 +49,7 @@ mongo-dev-server@1.1.0
4949
mongo-id@1.0.7
5050
npm-mongo@3.1.1
5151
ordered-dict@1.1.0
52-
promise@0.11.1
52+
promise@0.11.2
5353
random@1.1.0
5454
reactive-var@1.0.11
5555
reload@1.2.0
@@ -59,11 +59,11 @@ server-render@0.3.1
5959
shell-server@0.4.0
6060
socket-stream-client@0.2.2
6161
spacebars-compiler@1.1.3
62-
standard-minifier-css@1.5.1
62+
standard-minifier-css@1.5.2
6363
standard-minifier-js@2.4.0
6464
static-html@1.2.2
6565
templating-tools@1.1.2
6666
tracker@1.2.0
6767
underscore@1.0.10
68-
webapp@1.7.0
68+
webapp@1.7.2
6969
webapp-hashing@1.0.9

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)