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

Commit

Permalink
Merge pull request #2758 from apollographql/release-2.5.0
Browse files Browse the repository at this point in the history
Release 2.5.0
  • Loading branch information
hwillson authored Feb 26, 2019
2 parents e87986b + 4249523 commit 2a330a7
Show file tree
Hide file tree
Showing 47 changed files with 1,960 additions and 2,416 deletions.
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
[email protected] # Reactive variable for tracker
[email protected] # Meteor's client-side reactive programming library

[email protected].0 # CSS minifier run for production mode
[email protected].2 # CSS minifier run for production mode
[email protected] # JS minifier run for production mode
[email protected] # ECMAScript 5 compatibility for older browsers
[email protected].0 # Enable ECMAScript2015+ syntax in app code
[email protected].4 # Enable ECMAScript2015+ syntax in app code
[email protected] # Server-side component of the `meteor shell` command
[email protected]
[email protected]
2 changes: 1 addition & 1 deletion examples/ssr/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[email protected]
[email protected].0.2
20 changes: 10 additions & 10 deletions examples/ssr/.meteor/versions
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

0 comments on commit 2a330a7

Please sign in to comment.