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

chore(deps-dev): bump react-dnd from 11.1.3 to 13.1.1 #8

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Feb 25, 2021

Bumps react-dnd from 11.1.3 to 13.1.1.

Release notes

Sourced from react-dnd's releases.

v13.1.1

react-dnd

Patch

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

react-dnd-html5-backend

Patch

  • Export HTML5Context, HTML5BackendOptions interfaces

v13.1.0

react-dnd

TLDR: useDrag and useDrop support both a memo pattern and a spec object now.

useDrag(() => spec) // good
useDrag(spec) // also good

In v13, we've tried to address some errors that were pervading with the react-dnd hooks API. Generally, making sure DragSource/DropTargets were up-to-date and that the system wasn't leaking handles was a precarious balancing act. Moving to a memo API pattern (e.g. useDrag(() => spec)) fixed this problem in our tests.

However, as we dug further into handler leakage issues, it became clear that anything using the hooks would reattach and receive a new handler ID whenever the spec changed at all. This was in contrast to the Decorator API's behavior of keeping stable handler IDs as the incoming props changed.

To fix the Hooks API to stop leaking handlers, we found a pretty simple solution: a classical class with a public setter for the spec object that's updated via a useEffect hook. This neatly avoids the mutating DragSource/DropTargets on every spec change. This had two effects: identifiers have been stabilized, and spec objects were usable again because changing them didn't cause DragSource/DropTarget instances to be regenerated and reattached.

In retrospect, this undoes the necessity of the major cut that happened with v13, but the Hooks API is much sturdier now. We hope that you find the improved memory stability in the hooks API to be useful in your projects.

v13.0.1

Patch Updates

  • Add invariant() invocations in useDrag, useDrop to verify that spec functions are used instead of objects
  • Fix handler registration memory leak issue with useDrag, useDrop

v13.0.0

React-DnD v13, Others v12

v12 was largely structural and organizational, but some issues were discovered shortly after release that warranted changing the hooks API.

Breaking Changes

  • useDrag, useDrop hooks accept functions that create spec objects instead of spec objects directly. Clients can think about the API to useDrag() and useDrop() as being analogous to useMemo(). This allows clients to have direct control over when their DnD specifications are re-generated (which internally reattaches them to the DnD system).
  • Use jsx-factory throughout the library

Non-Breaking Changes

  • Add HTML native draggable type to HTML5Backend (see new example)
  • Clients can specify a rootElement component in the HTML5Backend options to localize where DnD will process events in the client app.
  • react-dnd-test-utils has improved support for testing with HTML5Backend and using @testing-library/react to simulate drag-and-drop sequences.
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 dependabot bot added the dependencies Pull requests that update a dependency file label Feb 25, 2021
@github-actions
Copy link

github-actions bot commented Feb 25, 2021

@github-actions
Copy link

Size Change: 0 B

Total Size: 836 kB

ℹ️ View Unchanged
Filename Size Change
./dist/antd-with-locales.min.js 337 kB 0 B
./dist/antd.compact.min.css 67.1 kB 0 B
./dist/antd.dark.min.css 68.4 kB 0 B
./dist/antd.min.css 67.1 kB 0 B
./dist/antd.min.js 296 kB 0 B

compressed-size-action

@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Mar 9, 2021

Superseded by #11.

@dependabot dependabot bot closed this Mar 9, 2021
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/react-dnd-13.1.1 branch March 9, 2021 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
0 participants