GroceriStar / shoplist-blocks-component

0 stars 1 forks source link

Bump react-dnd-html5-backend from 8.0.2 to 14.0.0 #362

Open dependabot-preview[bot] opened 3 years ago

dependabot-preview[bot] commented 3 years ago

Bumps react-dnd-html5-backend from 8.0.2 to 14.0.0.

Release notes

Sourced from react-dnd-html5-backend's releases.

14.0.0

This release addresses a handful of nagging liveness and ergonomic issues with the hooks API.

The liveness issues affect all hooks, and were discovered on deeper inspection of certain stress tests in the documentation. The internal useCollector() hook is used to collect props from the DnD system when things change. Prior to this update, we subscribed to updates from the DnD monitor to trigger prop collection. However, state on the react side was only accounted for on the first render. This release improves that liveness by collecting props whenever react state changes.

The ergonomics of the useDrag have been re-considered. In short: spec.type is required, spec.item can be a function or static object. The function version replaces spec.begin

Since the release of the hooks API, we packed type under spec.item. However, this led to nonintuitive situations where an item is specified even though items are created in the begin method:

useDrag({
   // item defined here to get a type
   item: { type: BOX } },
   // ...but the actual item is created here
   begin: () => ({ id })
})

Moreover, there React-DnD as originally designed made beginDrag() optional. Originally, only the type of the draggables had to be defined, and if no explicit DragObject was created, an implicit object was created by the system..

The change we've made here decouples type from item, and collapses begin into item.

e.g. useDrag({ item: { type: BOX }}) => useDrag({ type: 'BOX' })

// old api
useDrag({
   item: { type: BOX }},
  begin: () => ({ id })
})
// new API
useDrag({
   type: BOX,
  item: () => ({ id })
})

We've also added the ability to cancel drag operations in the hooks API by returning null from begin.

// new API
useDrag({
  type: BOX,
  item: () => shouldNotDrag ? null : {id},
})

v13.1.1

react-dnd

Patch

  • Re-register drag sources in hooks API when item.type changes
  • Export missing typings

... (truncated)

Changelog

Sourced from react-dnd-html5-backend's changelog.

(2021-02-21)

... (truncated)

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)