Releases: jaydenseric/apollo-upload-client
Version 19.0.0
Major
-
Updated Node.js support to
^20.9.0 || >=22.0.0. -
Use the TypeScript v5.5+ JSDoc tag
@importto import types in modules. To migrate: Upgrade TypeScript to v5.5+. -
Updated the peer dependency
@apollo/clientto^4.0.0, fixing #359. -
Added a new peer dependency
rxjsat^7.3.0. This is an Apollo Client v4 requirement. -
The function
createUploadLinkhas been removed and the upload terminating Apollo Link is now the exported classUploadHttpLinkthat extendsApolloLink. To migrate:- import createUploadLink from "apollo-upload-client/createUploadLink.mjs"; + import UploadHttpLink from "apollo-upload-client/UploadHttpLink.mjs"; const terminatingLink = - createUploadLink({ + new UploadHttpLink({ // Options… });
-
Updated dev dependencies, some of which require newer Node.js versions than previously supported.
Minor
- Added a new function
createUploadLinkoptionincludeUnusedVariablesdefaulting tofalseto toggle including unused GraphQL variables in the request (similar to the ApolloBaseHttpLinkoptionincludeUnusedVariables), via #348.
Patch
- Avoid the deprecated Apollo Link HTTP utility function
createSignalIfSupported. - Improved the upload terminating Apollo Link request handler code:
- Moved all of it into a single constructed
Observerthat’s returned regardless of errors. - More type safe.
- Moved all of it into a single constructed
- Updated the package scripts:
- Reordered and renamed scripts.
- Replaced
npm runwithnode --run. - Target test modules with a glob.
- Updated GitHub Actions CI config:
- Updated workflow triggers.
- Run checks in separate jobs.
- Removed custom step names.
- Updated
actions/checkoutto v5. - Updated
actions/setup-nodeto v4. - Replaced
npm runwithnode --run. - Run tests with Node.js v20, v22, v24.
- Enabled the TypeScript compiler options
noUnusedLocalsandnoUnusedParameters. - Migrated to the ESLint v9 CLI and “flat” config.
- In tests, removed the no longer needed polyfill for the global
File. - In tests, use
ApolloLink.frominstead of the deprecated Apollo Link utility functionconcat. - Improved internal comments.
- Corrected the package field
browserslistto match what’s documented in the readme. - Removed readme advice to consider polyfilling certain globals as they now exist in all supported environments.
- Improved readme examples.
- Fixed a typo in the changelog entry for v18.0.0.
Version 18.0.1
Version 18.0.0
Major
-
Updated Node.js support to
^18.15.0 || >=20.4.0. -
Updated the
@apollo/clientpeer dependency to^3.8.0. -
Updated the
extract-filesdependency to v13.-
React Native is no longer supported out of the box.
The class
ReactNativeFileis 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, andFormDataglobals in the React Native environment.To migrate, React Native projects that are unable to use the standard globals can manually implement a class
ReactNativeFileand match it with a custom functionisReactNativeFilefor use with the functioncreateUploadLinkoptionisExtractableFile. -
“Plain” objects in the GraphQL operation that aren’t
Objectinstances (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, andResponseAPIs available in modern Node.js and removed the dev dependenciesabort-controller,formdata-node, andnode-fetch. -
Public modules are now individually listed in the package
filesandexportsfields. -
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
.mjsfiles instead of CJS in.jsfiles, accessible viaimportbut notrequire. -
Implemented TypeScript types via JSDoc comments.
Types published in
@types/apollo-upload-clientshould no longer be used.Projects must configure TypeScript to use types from the ECMAScript modules that have a
// @ts-checkcomment:compilerOptions.allowJsshould betrue.compilerOptions.maxNodeModuleJsDepthshould be reasonably large, e.g.10.compilerOptions.moduleshould be"node16"or"nodenext".
-
Internally, use the function
selectHttpOptionsAndBodyInternalthat was added in@apollo/clientv3.5.5.
Minor
- Added a new option
printfor the functioncreateUploadLink, to customize how the GraphQL query or mutation AST prints to a string for transport. It works like the same option forHttpLink.
Patch
- 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
typesscript. - Removed the
jsdoc-mddev dependency and the related package scripts, replacing the readme “API” section with a manually written “Exports” section. - Updated the
package.jsonfieldrepositoryto 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/checkoutto v4. - Updated
actions/setup-nodeto v3.
- Use the
node:URL scheme for Node.js builtin module imports. - Reorganized the test file structure.
- In tests, for objects with the property
headersthat as of@apollo/clientv3.7.0 is a null-prototype object, use the assertiondeepEqualinstead ofdeepStrictEqual. - Tweaked code for type safety.
- Updated documentation, including link URLs.
- Refactored example code in the readme.
- Removed the readme badges.
Version 17.0.0
Major
- 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
./packagefrom the packageexportsfield; the fullpackage.jsonfilename must be used in arequirepath.
Patch
- Also run GitHub Actions CI with Node.js v17.
- Updated the
graphqlpeer dependency to14 - 16. - Refactored tests to remove the
fetch-blobdev dependency. - Simplified package scripts.
- Use a new
assertBundleSizefunction 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
timeLimitPromiseerror messages. - Configured Prettier option
singleQuoteto the default,false. - Documentation tweaks.
- Amended the changelog entry for v16.0.0.
Version 16.0.0
Major
- Updated the
extract-filesdependency to v11.
Patch
- Updated dev dependencies.
- Reverted the more specific package
mainfield 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.
Version 15.0.0
Major
- Updated Node.js support to
^12.20 || >= 14.13. - Stopped supporting Internet Explorer.
- Changed
@apollo/clientfrom 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.jsonexportsfield public subpath folder mapping (deprecated by Node.js) with a subpath pattern. Deeprequirepaths withinapollo-upload-client/public/must now include the.jsfile 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
.mjsfiles instead of CJS in.jsfiles.
Patch
- Stop using
hard-rejectionto detect unhandledPromiserejections in tests, as Node.js v15+ does this natively. - Test the bundle size manually using
esbuildandgzip-size, removingsize-limitrelated dev dependencies, config, and scripts. - Updated GitHub Actions CI config:
- Run tests with Node.js v12, v14, v16.
- Updated
actions/checkoutto v2. - Updated
actions/setup-nodeto v2. - Don’t specify the
CIenvironment variable as it’s set by default.
- More specific package
mainfield path. - Simplified JSDoc related package scripts now that
jsdoc-mdv10 automatically generates a Prettier formatted readme. - Added a package
test:jsdocscript that checks the readme API docs are up to date with the source JSDoc. - Use the
.jsfile extension in internalrequirepaths. - Clearer package and function
createUploadLinkdescription, fixing #247. - Fixed function
createUploadLinkoptionfetchOptions.signalbugs:- If the given abort controller signal is already aborted, immediately abort the fetch.
- Use
once: truewhen adding theabortevent 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.
Version 14.1.3
Patch
- Removed the
subscriptions-transport-wspeer dependency, via #235. - Updated dependencies.
- Also run GitHub Actions with Node.js v15.
- Updated tests to account for the
AbortControllerglobal being defined in Node.js v15+.
Version 14.1.2
Patch
- Updated dependencies.
- Lint fixes for updated Prettier.
- Rewrote the tests to use
executefromapollo-linkinstead ofApolloClientqueryandmutatemethods. - Ensure the Apollo Link observable terminates with an error when there are both errors and data, fixing #222.
Version 14.1.1
Patch
- Use
revertable-globalsfor tests. - Removed no longer necessary
formdata-nodeworkarounds in tests. - Removed
npm-debug.logfrom the.gitignorefile as npm v4.2.0+ doesn’t create it in the current working directory. - Support
clientAwarenessbeing undefined in Apollo Link context, via #212.
Version 14.1.0
Minor
- Support GET requests, fixing #151.
Patch
- Updated the
extract-filesdependency to v9, updating relevant deep require paths. - Added API tests, fixing #204.
- Properly support the
signalfetch option, fixing #209. - Updated
createUploadLink:- Alphabetically sorted destructured imports.
- Removed a redundant fallback value when destructuring
clientAwarenessfrom context. It was an obstacle to 100% code coverage becauseApolloClientdefaults it to an empty object. - Unnested some code from the
Observablefunction 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.