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

Release 2.5.0 #2758

Merged
merged 59 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
20c8048
Chore/reduce bundle size (#2659)
JoviDeCroock Dec 13, 2018
de2b5fc
Import helpers like __extends from tslib.
benjamn Dec 13, 2018
2757f63
Move walkTree export to react-apollo/walkTree, to avoid bundling it.
benjamn Dec 13, 2018
408a7cf
Provide esm bundle (#2677)
JoviDeCroock Jan 8, 2019
f0c395b
Bump react-apollo to version 2.5.0-bundle-size.0.
benjamn Jan 20, 2019
b72dfd6
Stop importing shallowEqual from fbjs/lib/shallowEqual.
benjamn Jan 20, 2019
e2ef37a
Merge branch 'master' into wip-reduce-bundle-size
benjamn Jan 28, 2019
dca7f4c
Merge pull request #2661 from apollographql/wip-reduce-bundle-size
benjamn Jan 28, 2019
2f6bacf
Remove unnecessary typings/ directory.
benjamn Jan 28, 2019
66b0945
Consolidate src/{browser,index}.ts.
benjamn Jan 28, 2019
ab382b2
Remove individual UMD module builds.
benjamn Jan 28, 2019
1fdae86
Compile only ./src via tsc to simplify `npm run compile`.
benjamn Jan 28, 2019
f1d98ce
Compile dist/bundlesize.js from lib/react-apollo.esm.js.
benjamn Jan 28, 2019
b024bf6
Remove non-existent test:compiled:browser:umd from Circle CI.
benjamn Jan 28, 2019
8c7ce5b
Compile lib/react-apollo.umd.js from lib/react-apollo.esm.js.
benjamn Jan 28, 2019
771ac71
Reduce bundle size limit to reflect recent improvements.
benjamn Jan 28, 2019
72fb8fd
Bump react-apollo to version 2.5.0-beta.0.
benjamn Jan 28, 2019
6c30256
Update examples/ssr to latest Meteor and react-apollo@beta.
benjamn Jan 29, 2019
f9f9a67
Improve test-examples.sh and move it into scripts/.
benjamn Jan 29, 2019
9d5e080
Reimplement invariant(condition, message) using TypeScript.
benjamn Jan 20, 2019
0dd5db1
Enable minification of invariant(condition, message) strings.
benjamn Jan 30, 2019
049a433
Use lib/react-apollo.cjs.js as "main" entry point in package.json.
benjamn Jan 31, 2019
898d520
Bring back react-apollo/react-apollo.umd.js.
benjamn Jan 31, 2019
e9f6aee
Make rollup/plugin-invariant.js an external npm package.
benjamn Jan 31, 2019
d6792eb
Add **Building for production** section to README.md.
benjamn Jan 31, 2019
b81e584
Increase timeout for flaky Mutation test.
benjamn Jan 31, 2019
43ab608
Merge pull request #2771 from apollographql/strip-invariant-message-s…
benjamn Jan 31, 2019
69c422a
Merge branch 'master' into release-2.5.0
benjamn Jan 31, 2019
84e6164
Bump react-apollo to version 2.5.0-beta.1.
benjamn Jan 31, 2019
bfcf6fb
Merge branch 'master' into release-2.5.0
hwillson Feb 1, 2019
417546e
Switch `apollo-*` deps to use `beta`
hwillson Feb 4, 2019
f437577
Adjust types to line up with recent Apollo Link type changes
hwillson Feb 4, 2019
cce3316
Disable HOC prop variable validation
hwillson Feb 4, 2019
97f08c3
Prevent `@client` fields from being used in mocked responses
hwillson Feb 4, 2019
04a654c
Merge branch 'master' into release-2.5.0
benjamn Feb 7, 2019
d6f746d
Use ts-invariant instead of utils/invariant.ts.
benjamn Feb 7, 2019
9ff8f44
Make sure `npm run watch` builds ESM/UMB bundles (#2765)
hwillson Feb 7, 2019
d5efe42
Remove no longer valid props matching variables test
hwillson Feb 8, 2019
f580c81
Adjust `startPolling` test avoid using `jest.runTimersToTime`
hwillson Feb 9, 2019
03391a4
Remove failing jest timer mocks from polling tests
hwillson Feb 9, 2019
48a8a17
Remove nested Apollo Client `DefaultOptions` import
hwillson Feb 17, 2019
927f13c
Track subscription last result to help avoid extra renders
hwillson Feb 17, 2019
77b63e4
Update client toggling test to work with current apollo libs
hwillson Feb 17, 2019
d9835ab
Changes based on code review
hwillson Feb 20, 2019
411ff37
Update src/Query.tsx
benjamn Feb 21, 2019
3f72fef
Merge pull request #2776 from apollographql/hwillson/local-state
hwillson Feb 21, 2019
fabd248
Merge branch 'master' into release-2.5.0
hwillson Feb 21, 2019
b643958
Bump versions for RC
hwillson Feb 21, 2019
7b60656
Bump apollo-utilities dep to RC
hwillson Feb 21, 2019
ebf1039
Now that the proper apollo-utilities RC has been published, use it
hwillson Feb 21, 2019
1f53b98
Bump to Apollo Client rc.1 deps
hwillson Feb 21, 2019
d3be327
Bump versions; prep for publish
hwillson Feb 25, 2019
63f356e
Merge branch 'master' into release-2.5.0
hwillson Feb 25, 2019
2b877b9
Version bump; prep for rc.3 publish
hwillson Feb 26, 2019
b551a32
Fix broken package-lock.json
hwillson Feb 26, 2019
6556e63
Changelog update
hwillson Feb 26, 2019
7523b40
Merge branch 'master' into release-2.5.0
hwillson Feb 26, 2019
51fb034
Version bump, prep for publish
hwillson Feb 26, 2019
4249523
Last package lock fix
hwillson Feb 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,47 +61,31 @@ jobs:
- store_artifacts:
path: reports/junit

Browser:
docker: [{ image: 'circleci/node:8' }]
steps:
- checkout
- run: npm i
- run: npm run compile
- run:
name: Jest suite
command: npm run test:compiled:browser:umd -- --ci --testResultsProcessor="jest-junit"
environment:
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit

Server:
Commonjs:
docker: [{ image: 'circleci/node:8' }]
steps:
- checkout
- run: npm i
- run: npm run compile
- run:
name: Jest suite
command: npm run test:compiled:server:umd -- --ci --testResultsProcessor="jest-junit"
command: npm run test:compiled:cjs -- --ci --testResultsProcessor="jest-junit"
environment:
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit

Commonjs:
UMD:
docker: [{ image: 'circleci/node:8' }]
steps:
- checkout
- run: npm i
- run: npm run compile
- run:
name: Jest suite
command: npm run test:compiled:cjs -- --ci --testResultsProcessor="jest-junit"
command: npm run test:compiled:umd -- --ci --testResultsProcessor="jest-junit"
environment:
JEST_JUNIT_OUTPUT: 'reports/junit/js-test-results.xml'
- store_test_results:
Expand All @@ -126,7 +110,6 @@ workflows:
- Linting
- Typecheck
- Preact
- Browser
- Server
- UMD
- Commonjs
- Filesize
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.rpt2_cache

# Logs
logs
Expand Down
25 changes: 22 additions & 3 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Change log

## vNext

### Bug Fixes
## 2.5.0

### Improvements

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

### Improvements

- The `walkTree` function has been deprecated, since there's no way to
make its behavior consistent with the latest versions of React. To save
bundle size, `walkTree` is no longer exported from `react-apollo`,
though you can still access it as follows:
```js
import { walkTree } from "react-apollo/walkTree"
```

## 2.4.0

### Bug Fixes

- Invoke `onCompleted`/`onError` even if `Mutation` unmounts. <br/>
[PR #2710](https://github.com/apollographql/react-apollo/pull/2710)

### Improvements

- Update the typescript example app to use the raw Query component directly,
with generics, to avoid generating the extra object that's created (in the
compiled code) when extending the Query component as a class. <br/>
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ React Apollo makes use of `Object.assign`, which is not supported in certain bro
import 'core-js/fn/object/assign';
```

## Building for production

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.

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).

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.

## Documentation

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)
Expand Down
4 changes: 2 additions & 2 deletions examples/ssr/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ static-html # Define static page content in .html files
reactive-var@1.0.11 # Reactive variable for tracker
tracker@1.2.0 # Meteor's client-side reactive programming library

standard-minifier-css@1.5.0 # CSS minifier run for production mode
standard-minifier-css@1.5.2 # CSS minifier run for production mode
standard-minifier-js@2.4.0 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
ecmascript@0.12.0 # Enable ECMAScript2015+ syntax in app code
ecmascript@0.12.4 # Enable ECMAScript2015+ syntax in app code
shell-server@0.4.0 # Server-side component of the `meteor shell` command
server-render@0.3.1
underscore@1.0.10
2 changes: 1 addition & 1 deletion examples/ssr/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.8
METEOR@1.8.0.2
20 changes: 10 additions & 10 deletions examples/ssr/.meteor/versions
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
allow-deny@1.1.0
autoupdate@1.5.0
babel-compiler@7.2.1
babel-compiler@7.2.4
babel-runtime@1.3.0
base64@1.0.11
binary-heap@1.0.11
blaze-tools@1.0.10
boilerplate-generator@1.6.0
caching-compiler@1.2.0
caching-compiler@1.2.1
caching-html-compiler@1.1.3
callback-hook@1.1.0
check@1.3.1
Expand All @@ -15,9 +15,9 @@ ddp-client@2.3.3
ddp-common@1.4.0
ddp-server@2.2.0
deps@1.0.12
diff-sequence@1.1.0
dynamic-import@0.5.0
ecmascript@0.12.1
diff-sequence@1.1.1
dynamic-import@0.5.1
ecmascript@0.12.4
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.8.0
ecmascript-runtime-server@0.7.1
Expand All @@ -35,12 +35,12 @@ livedata@1.0.18
logging@1.1.20
meteor@1.9.2
meteor-base@1.4.0
minifier-css@1.4.0
minifier-css@1.4.1
minifier-js@2.4.0
minimongo@1.4.5
mobile-experience@1.0.5
mobile-status-bar@1.0.14
modern-browsers@0.1.2
modern-browsers@0.1.3
modules@0.13.0
modules-runtime@0.10.3
mongo@1.6.0
Expand All @@ -49,7 +49,7 @@ mongo-dev-server@1.1.0
mongo-id@1.0.7
npm-mongo@3.1.1
ordered-dict@1.1.0
promise@0.11.1
promise@0.11.2
random@1.1.0
reactive-var@1.0.11
reload@1.2.0
Expand All @@ -59,11 +59,11 @@ server-render@0.3.1
shell-server@0.4.0
socket-stream-client@0.2.2
spacebars-compiler@1.1.3
standard-minifier-css@1.5.1
standard-minifier-css@1.5.2
standard-minifier-js@2.4.0
static-html@1.2.2
templating-tools@1.1.2
tracker@1.2.0
underscore@1.0.10
webapp@1.7.0
webapp@1.7.2
webapp-hashing@1.0.9
2 changes: 1 addition & 1 deletion examples/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"meteor-node-stubs": "^0.4.1",
"node-fetch": "^2.2.0",
"react": "^16.5.2",
"react-apollo": "^2.3.1",
"react-apollo": "^2.5.0-beta.0",
"react-dom": "^16.5.2"
},
"devDependencies": {
Expand Down
16 changes: 0 additions & 16 deletions jest.browser.umd.config.js

This file was deleted.

10 changes: 8 additions & 2 deletions jest.cjs.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
const { jest } = require('./package.json');

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

// Ignore tests that don't go against the public API
jest.modulePathIgnorePatterns.push('<rootDir>/test/internal-api');

module.exports = jest;
1 change: 1 addition & 0 deletions jest.server.umd.config.js → jest.umd.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { jest } = require('./package.json');
jest.moduleNameMapper = {
'\\.\\./src$': '<rootDir>/lib/react-apollo.umd.js',
'\\.\\./src/test-utils': '<rootDir>/lib/test-utils.js',
'\\.\\./src/walkTree': '<rootDir>/lib/walkTree.js',
// Force other imports to /src/whatever to fail
'\\.\\./src': '<rootDir>/test/fail-no-entry-point.js',
};
Expand Down
Loading