- Corrected the function
createUploadLink
optionuri
type, fixing #316. - Prefixed unused parameters with
_
, fixing #317. - Fixed a typo in the changelog entry for v18.0.0.
-
Updated Node.js support to
^18.15.0 || >=20.4.0
. -
Updated the
@apollo/client
peer dependency to^3.8.0
. -
Updated the
extract-files
dependency to v13.-
React Native is no longer supported out of the box.
The class
ReactNativeFile
is no longer exported, or matched by the functionisExtractableFile
.This class was bloating non React Native environments with an extra module, increasing bundle sizes when building and adding an extra step to ESM loading waterfalls in browsers.
It’s the responsibility of Facebook to adhere to web standards and implement spec-complaint
Blob
,File
, andFormData
globals in the React Native environment.To migrate, React Native projects that are unable to use the standard globals can manually implement a class
ReactNativeFile
and match it with a custom functionisReactNativeFile
for use with the functioncreateUploadLink
optionisExtractableFile
. -
“Plain” objects in the GraphQL operation that aren’t
Object
instances (e.g.Object.create(null)
) are now also deep cloned when searching for extractable files.
-
-
Updated dev dependencies, some of which require newer Node.js versions than previously supported.
-
Use the Node.js test runner API and remove the dev dependency
test-director
. -
Refactored tests to use the standard
AbortController
,AbortSignal
,File
,FormData
, andResponse
APIs available in modern Node.js and removed the dev dependenciesabort-controller
,formdata-node
, andnode-fetch
. -
Public modules are now individually listed in the package
files
andexports
fields. -
Removed the package main index module; deep imports must be used. To migrate:
- import { - createUploadLink, - formDataAppendFile, - isExtractableFile - } from "apollo-upload-client"; + import createUploadLink from "apollo-upload-client/createUploadLink.mjs"; + import formDataAppendFile from "apollo-upload-client/formDataAppendFile.mjs"; + import isExtractableFile from "apollo-upload-client/isExtractableFile.mjs";
-
Shortened public module deep import paths, removing the
/public/
. To migrate:- import createUploadLink from "apollo-upload-client/public/createUploadLink.js"; + import createUploadLink from "apollo-upload-client/createUploadLink.mjs"; - import formDataAppendFile from "apollo-upload-client/public/formDataAppendFile.js"; + import formDataAppendFile from "apollo-upload-client/formDataAppendFile.mjs"; - import isExtractableFile from "apollo-upload-client/public/isExtractableFile.js"; + import isExtractableFile from "apollo-upload-client/isExtractableFile.mjs";
-
The API is now ESM in
.mjs
files instead of CJS in.js
files, accessible viaimport
but notrequire
. -
Implemented TypeScript types via JSDoc comments.
Types published in
@types/apollo-upload-client
should no longer be used.Projects must configure TypeScript to use types from the ECMAScript modules that have a
// @ts-check
comment:compilerOptions.allowJs
should betrue
.compilerOptions.maxNodeModuleJsDepth
should be reasonably large, e.g.10
.compilerOptions.module
should be"node16"
or"nodenext"
.
-
Internally, use the function
selectHttpOptionsAndBodyInternal
that was added in@apollo/client
v3.5.5.
- Added a new option
print
for the functioncreateUploadLink
, to customize how the GraphQL query or mutation AST prints to a string for transport. It that works like the same option forHttpLink
.
- Updated dev dependencies.
- Simplified dev dependencies and config for ESLint.
- Integrated the ESLint plugin
eslint-plugin-optimal-modules
. - Check TypeScript types via a new package
types
script. - Removed the
jsdoc-md
dev dependency and the related package scripts, replacing the readme “API” section with a manually written “Exports” section. - Updated the
package.json
fieldrepository
to conform to new npm requirements. - Updated GitHub Actions CI config:
- The workflow still triggers on push, but no longer on pull request.
- The workflow can now be manually triggered.
- Run tests with Node.js v18, v20, v21.
- Updated
actions/checkout
to v4. - Updated
actions/setup-node
to v3.
- Use the
node:
URL scheme for Node.js builtin module imports. - Reorganized the test file structure.
- In tests, for objects with the property
headers
that as of@apollo/client
v3.7.0 is a null-prototype object, use the assertiondeepEqual
instead ofdeepStrictEqual
. - Tweaked code for type safety.
- Updated documentation, including link URLs.
- Refactored example code in the readme.
- Removed the readme badges.
- Updated Node.js support to
^12.22.0 || ^14.17.0 || >= 16.0.0
. - Updated dev dependencies, some of which require newer Node.js versions than previously supported.
- Removed
./package
from the packageexports
field; the fullpackage.json
filename must be used in arequire
path.
- Also run GitHub Actions CI with Node.js v17.
- Updated the
graphql
peer dependency to14 - 16
. - Refactored tests to remove the
fetch-blob
dev dependency. - Simplified package scripts.
- Use a new
assertBundleSize
function to assert module bundle size in tests:- Failure message contains details about the bundle size and how much the limit was exceeded.
- Errors when the surplus is greater than 25% of the limit, suggesting the limit should be reduced.
- Resolves the minified bundle and its gzipped size for debugging in tests.
- Tweaked the test function
timeLimitPromise
error messages. - Configured Prettier option
singleQuote
to the default,false
. - Documentation tweaks.
- Amended the changelog entry for v16.0.0.
- Updated the
extract-files
dependency to v11.
- Updated dev dependencies.
- Reverted the more specific package
main
field path. - Renamed imports in the test index module.
- Increased the bundle size test maximum allowed bundle size.
- Updated code examples to use deep imports.
- Amended the changelog entries for v14.0.0 and v15.0.0.
- Updated Node.js support to
^12.20 || >= 14.13
. - Stopped supporting Internet Explorer.
- Changed
@apollo/client
from a dependency to a peer dependency, fixing #251 via #252. - Updated dependencies, some of which require newer Node.js versions than previously supported.
- Replaced the the
package.json
exports
field public subpath folder mapping (deprecated by Node.js) with a subpath pattern. Deeprequire
paths withinapollo-upload-client/public/
must now include the.js
file extension. - Removed Babel related dependencies, config, and scripts. Published modules now contain more modern ES syntax.
- Published modules now contain JSDoc comments, which might affect TypeScript projects.
- The tests are now ESM in
.mjs
files instead of CJS in.js
files.
- Stop using
hard-rejection
to detect unhandledPromise
rejections in tests, as Node.js v15+ does this natively. - Test the bundle size manually using
esbuild
andgzip-size
, removingsize-limit
related dev dependencies, config, and scripts. - Updated GitHub Actions CI config:
- Run tests with Node.js v12, v14, v16.
- Updated
actions/checkout
to v2. - Updated
actions/setup-node
to v2. - Don’t specify the
CI
environment variable as it’s set by default.
- More specific package
main
field path. - Simplified JSDoc related package scripts now that
jsdoc-md
v10 automatically generates a Prettier formatted readme. - Added a package
test:jsdoc
script that checks the readme API docs are up to date with the source JSDoc. - Use the
.js
file extension in internalrequire
paths. - Clearer package and function
createUploadLink
description, fixing #247. - Fixed function
createUploadLink
optionfetchOptions.signal
bugs:- If the given abort controller signal is already aborted, immediately abort the fetch.
- Use
once: true
when adding theabort
event listener on the given abort controller signal to avoid a possible memory leak.
- Updated a URL in the changelog entry for v14.0.0.
- Documentation updates.
- The file
changelog.md
is no longer published.
- Removed the
subscriptions-transport-ws
peer dependency, via #235. - Updated dependencies.
- Also run GitHub Actions with Node.js v15.
- Updated tests to account for the
AbortController
global being defined in Node.js v15+.
- Updated dependencies.
- Lint fixes for updated Prettier.
- Rewrote the tests to use
execute
fromapollo-link
instead ofApolloClient
query
andmutate
methods. - Ensure the Apollo Link observable terminates with an error when there are both errors and data, fixing #222.
- Use
revertable-globals
for tests. - Removed no longer necessary
formdata-node
workarounds in tests. - Removed
npm-debug.log
from the.gitignore
file as npm v4.2.0+ doesn’t create it in the current working directory. - Support
clientAwareness
being undefined in Apollo Link context, via #212.
- Support GET requests, fixing #151.
- Updated the
extract-files
dependency to v9, updating relevant deep require paths. - Added API tests, fixing #204.
- Properly support the
signal
fetch option, fixing #209. - Updated
createUploadLink
:- Alphabetically sorted destructured imports.
- Removed a redundant fallback value when destructuring
clientAwareness
from context. It was an obstacle to 100% code coverage becauseApolloClient
defaults it to an empty object. - Unnested some code from the
Observable
function scope. - Fixed the JSDoc default value type for
options.uri
. - Improved code comments.
- Replaced references to “Apollo Graph Manager” with “Apollo Studio” and updated related URLs.
- Better npm link in the readme setup instructions.
- Use deep
@apollo/client
imports to support non React projects, fixing #207.
- Updated Node.js support to
^10.17.0 || ^12.0.0 || >= 13.7.0
. - Updated dependencies, some of which (only dev dependencies) require newer Node.js versions than previously supported.
- Added a package
exports
field with conditional exports to support native ESM in Node.js and keep internal code private, whilst avoiding the dual package hazard. Published files have been reorganized, so previously undocumented deep imports will need to be rewritten according to the newly documented paths. - Support
@apollo/client
v3, fixing #174 via #175.
- Added the
graphql
peer dependency to support a wider range of package managers, via #196. - Removed Node.js v13 and added v14 to the versions tested in GitHub Actions.
- 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. - Prettier code examples in source JSDoc.
- Improved the type
ReactNativeFileSubstitute
code example. - Updated EditorConfig.
- Improved the documentation about gotchas when inspecting network requests in React Native, via #193.
- Changed code examples to use
import
instead ofrequire
.
- Updated Node.js support from v8.10+ to v10+.
- Updated dependencies, some of which require Node.js v10+.
- Support uploading files from a server environment, fixing #172 via #179 and #184.
- Added
createUploadLink
options:isExtractableFile
FormData
formDataAppendFile
- Added exports for the new
createUploadLink
option defaults:isExtractableFile
formDataAppendFile
- Added
- Removed the now redundant
eslint-plugin-import-order-alphabetical
dev dependency. - Added a
size-limit
dev dependency. - Stop using
husky
andlint-staged
. - Ensure GitHub Actions CI runs for pull requests.
- Use strict mode for scripts.
- Move Babel config from
babel.config.js
tosrc/.babelrc.json
. - Improved the package
prepare:prettier
andtest:prettier
scripts. - Configured Prettier option
semi
to the default,true
. - Removed
package-lock.json
from.gitignore
and.prettierignore
as it’s disabled in.npmrc
anyway. - Updated external documentation link URLs.
- Replaced “Apollo Engine” with “Apollo Graph Manager” in comments.
- Improved the examples in the readme.
- 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
- 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.
- Updated dev dependencies.
- Added the
eslint-plugin-jsdoc
dev dependency. - Replaced the
size-limit
dev dependency with@size-limit/preset-small-lib
. - Only create a default
AbortController
instance ifsignal
is not already set in fetch options, fixing #162 via #169. - Use GitHub Actions instead of Travis for CI.
- Clarified that Opera Mini isn’t supported in the Browserslist queries and readme “Support” section.
- Documented polyfills to consider in the readme “Support” section.
- Updated examples to use
@apollo/react-hooks
.
- Updated Node.js support from v6+ to v8.5+.
- Support Apollo Studio client awareness, via #143.
- Updated dependencies.
- Ensure Babel helpers are imported and not inlined, using the
@babel/runtime
dependency and@babel/plugin-transform-runtime
dev dependency. - Nicer Browserslist syntax for supported Node.js versions.
- Updated dependencies.
- Reduced the size of the published
package.json
by moving dev tool config to files. This also prevents editor extensions such as Prettier and ESLint from detecting config and attempting to operate when opening package files installed innode_modules
. - Simplified the
prepublishOnly
script. - Add tips for React Native gotchas, via #135.
- Updated the package description to mention that the upload link is terminating and clarified in the setup instructions that there can only be 1 terminating Apollo Link, via #147.
- Improve setup instructions for Apollo Boost.
- Updated the
extract-files
dependency to v5:- The original operation object is no longer modified when it contains files, fixing #81.
- If the same file is used in multiple locations of an operation it is only uploaded once.
- Updated dependencies.
- Updated package scripts and config for the new
husky
version. - Updated Node.js and browser support documentation in the readme.
- Use jsDelivr for the readme logo instead of RawGit as they are shutting down.
- Support more browsers by changing the Browserslist query from
> 1%
to> 0.5%, not dead
.
- Updated dev dependencies.
- Fix Babel not reading from the package
browserslist
field due to a sneaky@babel/preset-env
breaking change, fixing #124.
- Made
apollo-link
a dependency, instead of a peer dependency. - Removed the package
module
entry and the "ESM" build, which was.js
and not proper native ESM for Node.js via.mjs
as Apollo dependencies don’t support it.
- Updated Babel, removing the
@babel/runtime
dependency. - Package marked side-effect free for bundlers and tree-shaking.
- Updated dependencies.
- Use the new
extract-files
API. - Use
jsdoc-md
to generate readme API docs from source JSDoc, which has been improved. - Readme examples updated to use the
react-apollo
Mutation
component instead of thegraphql
decorator. - Readme examples use CJS instead of ESM as this project does not support native ESM (due to a lack of support in Apollo dependencies) and we shouldn’t assume everyone uses Babel.
- Updated package description.
- Added package tags.
- Added a package
test:size
script, usingsize-limit
to guarantee < 1 KB CJS bundle sizes. - Lint
.yml
files. - Refactored package scripts and removed the
npm-run-all
dev dependency. - Removed a temporary workaround for a fixed Babel CLI bug.
- Ensure the readme Travis build status badge only tracks
master
branch. - Use Badgen for the readme npm version badge.
- Updated dependencies.
- Use
.prettierignore
to deferpackage.json
formatting to npm. - Renamed
.babelrc.js
tobabel.config.js
and simplified ESLint ignore config. - Improved linting with
eslint-config-env
. - Use the
.mjs
extension for source. - Added JSDoc comments to source.
- Refactored package scripts:
- Use
prepare
to support installation via Git (e.g.npm install jaydenseric/apollo-upload-client
). - Remove
rimraf
andcross-env
dev dependencies. Only *nix environments will be supported for contributing. - Removed
watch
andfix
scripts.
- Use
- Compact package
repository
field. - Setup Travis CI.
- Readme badge changes to deal with shields.io unreliability:
- Removed the licence badge. The licence can be found in
package.json
and rarely changes. - Removed the Github issues and stars badges. The readme is most viewed on Github anyway.
- Added the more reliable build status badge provided by Travis and placed it first as it loads the quickest.
- Removed the licence badge. The licence can be found in
- Abandon
.mjs
until Apollo provides native ESM, fixing #72. - New readme logo URL that doesn’t need to be updated every version.
- Updated dependencies.
- Stop using named imports from CJS dependencies in ESM, fixing #72.
- Match an error handling tweak in the official HTTP links.
- Updated dependencies.
- Using new
apollo-link-http-common
API. - Corrected aborting fetch, fixing #70.
- Updated dependencies.
- Using
apollo-link-http-common
for commonality with the official HTTP links: - More robust npm scripts.
- HTTPS
package.json
author URL.
- Updated dependencies.
- Added support for
Blob
types, via #58. - Readme updates:
- Added a GraphQL multipart request spec server implementation list link to the intro.
- Misc. tweaks.
- Updated dependencies.
extract-files
v3 replaces files extracted from properties withnull
instead of deleting the property; see jaydenseric/extract-files#4. This improves compliance with the GraphQL multipart request spec. It’s not a breaking change forapollo-upload-server
, but it might be for other implementations.
- Updated dependencies.
- Updated peer dependencies to support
[email protected]
. - Added a clean step to builds.
- Smarter Babel config with
.babelrc.js
. - Modular project structure that works better for native ESM.
- Target Node.js v6.10+ for transpilation and polyfills via
package.json
engines
, matching the version supported byapollo-upload-server
. - Support browsers with >1% global usage (was >2%).
- Updated the readme support section.
- Conform to the GraphQL multipart request spec v2.0.0-alpha.2.
- Don’t set empty request
operationName
orvariables
.
- Response is set on the context, via #40.
- Configured
lint-staged
for.mjs
.
- Fix broken exports. See babel/babel#6805.
- Updated dependencies. Fixes broken
core-js
imports due to@babel/[email protected]
. - Configured prettier to no longer hard wrap markdown prose.
- Fixed an Apollo link in the readme.
- Misc. readme and changelog typo fixes.
- Externally host the readme logo again to fix display in npm. See npm/www#272.
- Updated
prettier
. - No longer publish the
src
directory. - Readme API documentation fixes:
- Corrected React Native example code import, via #39.
- Updated
createUploadLink
options.
- Corrected network error handling, fixing #38.
- Match the
apollo-link-http
API and support settingcredentials
andheaders
directly on the link and via context, fixing #36. - Fixed a bug that can cause the wrong
content-type: application/json
header to be used when uploading. - Updated changelog Apollo documentation links.
- changelog is now prettier.
- Updated dependencies.
- Apollo Client v2 compatibility:
- Export a terminating Apollo Link instead of custom network interfaces.
- New
apollo-link
andgraphql
peer dependencies.
- Rejigged package scripts.
- Updated Prettier and ESLint config.
- Lint errors when attempting to commit partially staged files no longer commits the whole file.
- Using Babel v7 directly instead of Rollup.
- Using
babel-preset-env
to handle polyfills so only required ones are included for our level of browser support. - Using
prettier
to format distribution code as well as source code. - No more source maps, as Prettier does not support them.
- Renamed
dist
directory tolib
. - Module files now have
.mjs
extension. - Removed
babel-eslint
as the vanilla parser works fine. - Readme improvements:
- Relative logo path.
- Added links to badges.
- Simplified code examples.
- Mark relevant example code blocks as JSX instead of JS.
- Removed the inspiration links; they are less relevant to the evolved codebase.
- Updated dependencies.
- Readme fixes:
- Fixed usage example code for
ReactNativeFile.list
. - Fixed capitalization of ‘npm’.
- Fixed usage example code for
- Updated dependencies.
- Readme tweaks including a new licence badge.
- Fixed Rollup build warnings.
- Fixed an npm v5 warning by using
prepublishOnly
instead ofprepublish
. - Refactored network interfaces; moved file extraction logic and
ReactNativeFile
to a separateextract-files
package.
- Removed
package-lock.json
. Lockfiles are not recommended for packages. - Readme tweaks and fixes:
- Renamed the
File
input typeUpload
for clarity. - Wording and formatting improvements.
- Renamed the
- Updated dependencies.
- Simplified React Native setup by moving Babel config out of
package.json
, fixing #19 via #23. - Export a new
ReactNativeFile
class to more reliably identify files for upload in React Native, via #17. - Renamed several exports for consistency with
apollo-client
, via #18.HTTPUploadNetworkInterface
renamedUploadHTTPFetchNetworkInterface
.HTTPUploadBatchNetworkInterface
renamedUploadHTTPBatchedNetworkInterface
.createBatchNetworkInterface
renamedcreateBatchingNetworkInterface
.
- Updated dependencies.
- Compatibility changes for
[email protected]
:
- Documented React Native.
- Fixed error when
File
andFileList
are undefined globals in React Native, see comment.
- Support React Native, fixing #10.
- Prevent error caused by
null
values in query/mutation variables, fixing #15.
- Corrected
package-lock.json
. - Source comment typo fix.
- Removed 2 dependencies by refactoring
extractRequestFiles
with bespoke recursion logic, shaving several KB off the bundle size and fixing #13.
- Updated dependencies.
- Added a changelog.
- Dropped Yarn in favor of npm@5. Removed
yarn.lock
and updated install instructions. - New ESLint config. Dropped Standard Style and began using Prettier.
- Using lint-staged to ensure contributors don't commit lint errors.
- Removed
build:watch
script. Usenpm run build -- --watch
directly.
- Updated dependencies.
- Fixed fetch options not applying correctly, see #9.
- Updated readme examples:
- Removed
PropTypes
. React no longer exports them and they are a distraction anyway. - Importing
gql
fromreact-apollo
. - No longer using decorator syntax.
- Using functional components in place of classes.
- Removed
- Updated dependencies.
- No longer errors when network interface
opts
are not configured, fixing #8. - Fixed the batch network interface always thinking there are files to upload, preventing the use of the fallback vanilla Apollo transport method when there are none.
- Simplified Babel config.
- The
extractRequestFiles
helper no longer converts the query AST to string as a side-effect, fixing #5.
- Updated dependencies.
- Fall back to regular network interface fetch methods if SSR or no files to upload, fixing #3.
- Better transpilation with
babel-runtime
. This should improve IE 11 support.
- Support
apollo-upload-server
v2 and query batching. - Removed the seemingly redundant
Accept
header from requests. - Clearer package description.
- Updated dependencies.
- Internal refactor for a cleaner ES6 class extension and method override.
- Removed two unversioned files prematurely published to npm.
- Updated dependencies.
- New API:
- Now exporting the custom network interface, which has been renamed
HTTPUploadNetworkInterface
. This enables it to be extended externally. - In preparation for adding another batched network interface,
createNetworkInterface
is now a named and not default export.
- Now exporting the custom network interface, which has been renamed
- Fixed the
uri
argument forcreateNetworkInterface
ending up in the request options. - Internally simplified
apollo-client
imports. - Simpler linting setup.
- Fixed broken Github deep links in the readme.
- Readme rewording.
- Simplified package.json description.
- Added missing metadata to
package.json
.
- Initial release.