Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency dataloader to v2 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Nov 21, 2019

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
dataloader ^1.4.0 -> ^2.0.0 age adoption passing confidence

Release Notes

graphql/dataloader

v2.2.2

Compare Source

Patch Changes

v2.2.1

Compare Source

Patch Changes

v2.2.0

Compare Source

Minor Changes
Patch Changes
  • #​318 588a8b6 Thanks @​boopathi! - Fix the propagation of sync throws in the batch function to the loader function instead of crashing the process wtih an uncaught exception.
  • #​321 3cd3a43 Thanks @​thekevinbrown! - Resolves an issue where the maxBatchSize parameter wouldn't be fully used on each batch sent to the backend loader.

v2.1.0

Compare Source

Minor Changes
Patch Changes
  • 3135e9a: Fix typo in jsdoc comment; flip "objects are keys" to "keys are objects"

v2.0.0

Compare Source

This is the first release since becoming part of the GraphQL Foundation and the most significant since the initial release over four years ago. Read more about the history of the project and this release in the blog post.

Breaking:

  • #​216: .loadMany() now returns an array which may contain Error if one of the requested keys failed.

    Previously .loadMany() was exactly the same as calling Promise.all() on multiple .load() calls. While syntactically a minor convenience, this wasn't particularly useful over what could be done with Promise.all directly and if one key failed, it meant the entire call to .loadMany() would fail. As of this version, .loadMany() can now return a mix of values and Error instances in the case that some keys failed, but the Promise it returns will never be rejected. This is similar to the behavior of the new Promise.allSettled method in the upcoming version of JavaScript.

    This will break any code which relied on .loadMany(). To support this change, either ensure the each item in the result of .loadMany() are checked against instanceof Error or replace calls like loader.loadMany([k1, k2]) with Promise.all([loader.load(k1), loader.load(k2)).

  • #​220: The timing of calls to batchLoadFn when { batch: false } has changed to the end of the run-loop tick.

    Previously when batching was disabled the batchLoadFn would be called immediately when .load() is called. This differed from the batchLoadFn being called at the end of the tick of the run-loop for when batching was enabled. This timing difference could lead to subtle race conditions for code which dynamically toggled batching on or off. As a simplification, the batchLoadFn is now always called at the end of the run-loop tick regardless of whether batching is disabled.

    Hopefully this will not break your code. It could cause issues for any code which relied on this synchronous call to batchLoadFn for loaders where batching was disabled.

  • #​222: Promises for cached values now wait to resolve until the rest of the batch resolves.

    Previously when .load() encountered a cached value it would return an already resolved (or rejected) Promise. However when additional dependent loads happened after these, the difference in time between the cache hit value resolving and the cache miss value resolving would result in additional unnecessary network requests. As of this version when .load() encounters a cached value it returns a Promise which waits to resolve until the call to batchLoadFn also resolves. This should result in better whole-program performance and is the most significant conceptual change and improvement. This is actually not a new innovation but a correction to match the original behavior of Facebook's "Loader" from 2010 this library is inspired by.

    This changes the timing of when Promises are resolved and thus could introduce subtle behavioral change in your code, especially if your code is prone to race conditions. Please test carefully.

    This also means each return of .load() is a new Promise instance. Where prior versions returned the same Promise instance for cached results, this version does not. This may break code which uses the returned Promise as a memoization key or in some other way assumed reference equality.

  • #​226: The names of private class variables have changed

    This really shouldn't break your code because you definitely don't reach into class private variables, right? I just figured it would be something you'd like to know, you know... just in case.

New:

  • #​176 #​209: MIT licensed (no longer BSD+Patents) and copyrights moved from Facebook to the GraphQL Foundation
  • #​182: The DataLoader instance is now available as this in batchLoadFn
  • #​228: Support for custom batch scheduling functions

    The dirty secret of DataLoader is that most of it is quite boring. The interesting bit is the batch scheduling function which takes advantage of Node.js's unique run-loop scheduler to acheive automatic batching without any additional latency. However since its release, ports to other languages have found this bit to be not be easily replicated and have either replaced it with something conceptually simpler (like manual dispatch) or with a scheduler custom fit to a GraphQL execution engine. These are interesting innovations which deserve ground for experimentation in this original library as well.

    Via batchScheduleFn, you can now provide a custom batch scheduling function and experiment with manual dispatch, added latency dispatch, or any other behavior which might work best for your application.

Types:

  • #​145: Improved TypeScript/Flow types for custom cacheKeyFn and cacheMap
  • #​146: TypeScript types allow batchLoadFn to return a PromiseLike, supporting use of bluebird
  • #​214 #​219: TypeScript/Flow types allow batchLoadFn to return ArrayLike, supporting returning read-only arrays
  • #​168: Flow types now use strict mode, allowing safe import into other strict mode code
  • #​217: Fixed an issue where TypeScript/Flow would incorrectly report an error when providing an Error to .prime()

Fixes:

  • #​215: Fixed an issue where a cache could still consume memory, even when caching was disabled
  • #​223: Fixed an issue where providing an Error to .prime() could incorrectly cause an unhandled promise rejection warning

Documentation:

  • Added references to a ton more ports of DataLoader into other languages (keep 'em coming!)
  • #​213: All examples have been updated to latest JavaScript (preferring async/await over Promise chaining)
  • Improved documentation for custom cacheMap along with an LRU example.
  • Improved documentation for using higher-order functions on batchLoadFn.
  • Improved documentation for converting Map results to Array results in batchLoadFn.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate
Copy link
Author

renovate bot commented Nov 21, 2019

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻️ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you check the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm WARN checkPermissions Missing write access to /mnt/renovate/gh/Unibeautify/auto-config/node_modules/@unibeautify/beautifier-file
npm WARN @unibeautify/beautifier-eslint@0.5.0 requires a peer of eslint@^4.19.1 but none is installed. You must install peer dependencies yourself.
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ENOENT
npm ERR! syscall access
npm ERR! path /mnt/renovate/gh/Unibeautify/auto-config/node_modules/@unibeautify/beautifier-file
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, access '/mnt/renovate/gh/Unibeautify/auto-config/node_modules/@unibeautify/beautifier-file'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/renovate-cache/others/npm/_logs/2019-11-21T10_07_20_217Z-debug.log

@renovate
Copy link
Author

renovate bot commented Mar 24, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant