Releases: apollographql/react-apollo
Fixes from 1.4.3
Performance and type improvements
Thanks to @flexzuu, @pitr12, @baerrach, and @eug48 for this release! Way to go everyone!
1.4.3
- Feature: You can now supply a client in options object passed to the
graphql
high oder component. PR #729 - Fix: Fix issue when using flow definitions PR# 787
- Improvement: Reduce re-renders by using forceUpdate instead of setState({ }) PR #775
- Improvement: Refactor dataForChild to use bound function to reduce rerenders PR #772
- Fix: Add in missing types for MutationOpts PR #770
Flow improvements
Fix for test-utils
During the move to es modules, I forgot to point the compiled test-util back to its place under /lib
. I even had changed a test which should have caught the issue!
Anyway, its fixed now thanks to @anthonator! Thanks for the super quick bug report!
Loading bug and static types!
This is the first large release since I've started back maintaining react-apollo again 💯
Fixes
- After the introduction of recycled queries (react-apollo 1.0.1), a persistent loading bug was present which impacted cached queries on remount. This was particularly painful for projects with heavy routing based queries (which are most projects). The fix for this bug required a fix/hack in apollo client. As well as in react-apollo.
In the future, the current recycled queries implementation will most likely be removed for a context based solution in just react-apollo. (No outward api changes should be needed)
- Render full markup on the server when using the
cache-and-network
fetchPolicy PR #688
Features
A couple fun ones in this release targeting developer experience and a slight lightening of the build size.
-
Support for tree shaking which makes is possible to only bundle what you use. In react-apollo this doesn't save a ton unless you are not using
graphql
HOC -
Enhanced types for typescript to give type checking for ehancers.
- Type query results and expect their values in the the wrapped component
- Safely use the
options
function based on props passed to wrapped component
- Safely build props based on result data, passed props, and what react-apollo passes down
- Initial types for flow! to give type checking for ehancers.
- Type query results and expect their values in the the wrapped component
- Safely use the
options
function based on props passed to wrapped component
- Safely build props based on result data, passed props, and what react-apollo passes down
Known flow issues
- Options as a function or and object is not currently supported. With union types in flow, I couldn't get an interface with all optional params to be distinguishable from a callable arrow function which returns said interface. For now, only the function version is allowed.
- Result data which could be null, is typed as existing. I tried to get result data being optional
QueryProps & ?R
but then I couldn't get flow to pass something likedata.code && // use data.code
. If you have any knowledge here I'd love it!
A huge thank you to @helfer, @lewisf, @brettjurgens, @ianks, and @stubailo for help with these features
Also, its the first time in a while apollo-client and react-apollo have the same version!
ESNext support
Improved recycled queries
1.2.0
- Fix: Use
standby
fetchPolicy for recycled queries PR #671
Performance improvements
0.8.3
0.8.3
- Bug: Issue #404 fix issue with network errors thrown when changing variables.
- Feature: Allow access to
withApollo
's wrapped instance thanks to{withRef: true}
option Issue #331. - Feature: Add an
alias
option to thegraphql
function to allow customizing the display name of the wrapped component (Issue #354).
Move react-dom to optional dependencies
v0.8.2 version bump