Releases: jaydenseric/graphql-react
Releases · jaydenseric/graphql-react
Version 11.2.0
Minor
- Added a new
cacheKeyCreator
option to theGraphQL
instance methodoperate
and theuseGraphQL
React hook. - The previously private
hashObject
function is now publicly exported.
Patch
- Replaced Node.js deprecated
notEqual
assertions withnotStrictEqual
in tests. - Use the
TypeError
class instead ofError
for relevant errors.
Version 11.1.0
Minor
- Allow React component
displayName
andpropTypes
to be removed in production builds, fixing #51. - Refactored the
useGraphQL
React hook to do less work for following renders if theoperation
andfetchOptionsOverride
options are defined outside the component or memoized using theReact.useMemo
hook. - Memoize what the
useGraphQL
React hook returns for more efficient hook composition. - Added a new
loadedCacheValue
property to the GraphQL operation status object returned by theuseGraphQL
React hook. This allows cache for an earlier operation to be rendered while loading changes to the query, variables, orfetch
options.
Patch
- Updated dependencies.
- Use
coverage-node
to enforce 100% code coverage for tests. - Increased the universal API size-limit from 3 KB to 3.5 KB.
- Updated the
useGraphQL
React hook examples to use the GitHub GraphQL API. - Improved the
useGraphQL
React hook tests. - Improved documentation.
Version 11.0.4
Patch
- Clearly documented ways to
import
andrequire
the package exports.
Version 11.0.3
Patch
- Updated the
extract-files
dependency to v9.0.0, and used its new deeprequire
path. - Updated dev dependencies.
- No longer test Node.js v13 in GitHub Actions CI.
- Corrected the Browserslist query in the Babel config for the server API.
- Write tests as CJS and no longer separately build and test ESM and CJS to simplify package scripts, Babel and ESLint config.
- Removed the
@babel/plugin-proposal-class-properties
dev dependency and config, as@babel/preset-env
has handed this via it’sshippedProposals
options since v7.10.0. - Removed unnecessary
.js
file extensions fromrequire
paths. - Improved polyfilling globals in tests:
- Use
revertable-globals
to define globals per-test. - Use
node-fetch
v3 instead ofcross-fetch
.
- Use
- Removed a no longer necessary
formdata-node
workaround ingraphqlFetchOptions
tests. - Removed
npm-debug.log
from the.gitignore
file as npm v4.2.0+ doesn’t create it in the current working directory.
Version 11.0.2
Patch
- Updated dependencies.
- Simplified the GitHub Actions CI config with the
npm install-test
command. - Use Babel config
overrides
to ensure.js
files are parsed as scripts, eliminating BabelinteropRequireDefault
helpers from transpilation output. - Updated Zeit/Vercel related URLs in documentation.
- Updated the readme “Apollo comparison” section.
Version 11.0.1
Patch
- Updated Node.js support to
^10.17.0 || ^12.0.0 || >= 13.7.0
. This is only a correction; the dependency updates with breaking changes happened in previous versions. - Updated dependencies.
- Simplified JSX boolean props in tests.
- Improved event documentation.
- Fixed an incorrect
reportCacheErrors
JSDoc parameter type. - Updated EditorConfig.
Version 11.0.0
Major
- Added a package
exports
field to support native ESM in Node.js. - Some source and published files are now
.js
(CJS) instead of.mjs
(ESM), so undocumented deep imports may no longer work. This approach avoids the dual package hazard. - Updated Node.js support from v10+ to
10 - 12 || >= 13.7
to reflect the packageexports
related breaking changes.
Patch
- Updated dependencies.
- Added a new
babel-plugin-transform-runtime-file-extensions
dev dependency to simplify Babel config. - Improved the package
prepare:prettier
andtest:prettier
scripts. - Reordered the package
test:eslint
script args for consistency withtest:prettier
. - Configured Prettier option
semi
to the default,true
. - Reconfigured
size-limit
:- Separately test the universal and server only exports, without using unpublished size limit entry files that bloat the measured sizes.
- Separately test the ESM and CJS exports.
- Separately limit tests, with the universal ESM and CJS set to a 3 KB maximum size.
- Removed redundant ESLint disable comments.
- Also run GitHub Actions with Node.js v14.
- Updated readme content.
- Updated JSDoc code examples:
- Prettier formatting.
- Import React in examples containing JSX.
- Use Node.js ESM compatible import specifiers.
Version 10.0.0
Major
- Updated Node.js support from v8.10+ to v10+.
- Updated dependencies, some of which require Node.js v10+.
- Replaced the
tap
dev dependency withtest-director
andhard-rejection
, and refactored tests accordingly. This improves the dev experience and reduced the dev install size by ~75.5 MB. - Use
ReactDOM.unstable_batchedUpdates
in theuseGraphQL
React hook to reduce the number of renders when loading completes, fixing #38 via #42. Althoughreact-dom
was already a peer dependency, this is the first time it's being used in the client API; potentially a breaking change for atypical projects.
Patch
- Updated tests for compatibility with updated dependencies.
- Removed the
object-assign
dependency and several Babel dev dependencies after simplifying the Babel config. - Added a new
babel-plugin-transform-require-extensions
dev dependency and ensured ESM import specifiers in both source and published.mjs
files contain file names with extensions, which are mandatory in the final Node.js ESM implementation. Published CJS.js
files now also have file extensions inrequire
paths. - Stop using
husky
andlint-staged
. - Lint fixes for
prettier
v2. - Tidied Babel configs.
- Ensure GitHub Actions run on pull request.
- Use strict mode for scripts.
- Readme “Apollo comparison” section corrections and tweaks.
Version 9.1.0
Minor
- Setup GitHub Sponsors funding:
- Added
.github/funding.yml
to display a sponsor button in GitHub. - Added a
package.json
funding
field to enable npm CLI funding features.
- Added
Patch
- Updated dev dependencies.
Version 9.0.0
Major
- Updated Node.js support from v8.5+ to v8.10+, to match what the
eslint
dev dependency now supports. This is unlikely to be a breaking change for the published package. - The
useGraphQL
React hookloadOnMount
,loadOnReload
, andloadOnReset
options now default tofalse
instead oftrue
. The loading related options are now all opt-in, which is easier to remember and simpler to configure for situations that previously required manual reversal of certain option defaults. It's also safer when working with mutations you don't want to accidentally load.
Patch
- Updated dependencies.
- Replaced the
size-limit
dev dependency with@size-limit/preset-small-lib
. - Fixed the
useGraphQL
enabled optionloadOnReload
causing a load when the globalGraphQL
cache is reloaded even if there was no previously cached data to reload. - Tweaked the
useGraphQL
optionloadOnReset
documentation. - Removed
package-lock.json
from.gitignore
and.prettierignore
as it’s disabled in.npmrc
anyway. - Removed redundant ESLint ignore comments.
- Use GitHub Actions instead of Travis for CI.
- Minor simplification in
useGraphQL
tests. - Documentation improvements, fixing #35:
- Updated the project description with better phrasing that includes the bundle size.
- Moved the readme “Apollo comparison” section to the end, and updated the “Bundle impact” subsection for the new Apollo React hooks API.
- Added a basic example of the core API features working together to the “Examples” section, with tips commented.
- Clarified that Opera Mini isn’t supported in the Browserslist queries and readme “Support” section.
- Cleaner readme “API” section table of contents with “See” and “Examples” headings excluded, thanks to
jsdoc-md
v3.1.0.