refactor: upgrade: react-dnd, react-dnd-html5-backend #2201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade multiple dependencies.
👯♂ The following dependencies are linked and will therefore be updated together.ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
from 10.0.2 to 16.0.1
on 2022-04-19
from 10.0.2 to 16.0.1
on 2022-04-19
Release notes
Package name: react-dnd
-
16.0.1 - 2022-04-19
-
16.0.0 - 2022-04-05
- Packages are now ESM-Only (https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
- Node 18 Support
-
15.1.2 - 2022-03-31
-
15.1.1 - 2022-02-07
-
15.1.0 - 2022-02-05
- All packages now have verified ESM support
- Packages expose CJS/ESM surface are via
-
15.0.2 - 2022-02-04
-
15.0.1 - 2022-02-04
-
15.0.0 - 2022-02-04
-
-
-
- Improve data-transfer acquisition from File inputs (#3262)
- Don't set the 'draggable' attribute unless
- Improve typings of DropTargetMonitor, DragLayerMonitor (#3300, #3341)
-
14.0.5 - 2022-01-02
-
14.0.4 - 2021-09-27
-
14.0.3 - 2021-08-13
- Fix drop operations in iframes & child windows (#3181) (thanks @ eramdam!)
- Refactor TouchBackend OptionsReader (#3291)
- Cleanup connected DOM elements from react-dnd internals when hook-based components unmount (#3290)
- Fix issue where custom drag-sources where triggering native drops in Firefox (#3272) (thanks @ istateside)
-
14.0.2 - 2021-03-22
-
14.0.1 - 2021-03-09
-
14.0.0 - 2021-03-09
- The function version of
// Pre-v14
-
13.1.1 - 2021-02-24
-
13.1.0 - 2021-02-23
-
13.0.1 - 2021-02-23
-
13.0.0 - 2021-02-22
-
12.0.0 - 2021-02-21
-
11.1.3 - 2020-05-29
-
11.1.1 - 2020-05-26
-
11.1.0 - 2020-05-26
-
11.0.0 - 2020-05-24
-
10.0.2 - 2019-12-07
from react-dnd GitHub release notesMajor
The utility packages
@ react-dnd/invariant,@ react-dnd/shallowequal, and@ react-dnd/asap(which are forks of popular libraries) have been included in the monorepo and built using the same output mechanisms as thereact-dndcore packages (dual EJS/CSM).@ react-dnd/asaphas been simplified to remove the node variant, which relied on deprecated APIspkg.exportsThis release uses output from swc using the 'es2017' target instead of using output from 'tsc' using the 'ESNext' target.
This release fixes issues with the ESM-only structure of v15.0.0. All packages are now in their prior CommonJS/ESM format.
Major Changes
The react-dnd packages are now published as ESM-only withtype: module. See this FAQ by sindresorhus: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99cThe Decorators API has been removed and fully replaced by the Hooks API. The Decorators API was difficult to develop & type correctly, and this improves its maintainability.
The builds no longer use babel & preset-env. The library is transpiled using SWC into the "es2017" target, which assumes async/await is available. This should reduce bundle sizes by removing polyfills and support-code which may be unnecessary in your target.
Bugfixes
canDragis true (#3187)Updated
react-dnd: 14.0.3
react-dnd-html5-backend: 14.0.1
react-dnd-touch-backend: 14.1.0
Patch Updates
Patch
This PR will throw a developer exception if a user specifies a
useDrag::spec.beginmethod.Patch
Update internal hook
useDragType()to align with updated typings. Check 14.0.0 release for API changesThis 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
useDraghave been refactored. In short:spec.typeis requiredspec.itemcan be a function or static object.spec.itemreplacesspec.beginSince the release of the hooks API, we packed
typeunderspec.item. However, this led to nonintuitive situations where anitemfield was required to be specified even though items are created in thebeginmethod.Additionally, in the original React-DnD design,
beginDrag()was optional and the type of the draggables had to be defined. If no explicit DragObject was created, an implicit object was created by the system..The change we've made here decouples
typefromitem, and collapsesbeginintoitem.useDrag({
// item defined here to get a type
item: { type: BOX } },
// ...but the actual item is created here
begin: () => ({ id })
})
// v14
useDrag({
type: BOX,
item: () => ({id})
})
e.g.
useDrag({ item: { type: BOX }})=>useDrag({ type: 'BOX' })We've also added the ability to cancel drag operations in the hooks API by returning null from
begin.Package name: react-dnd-html5-backend
-
16.0.1 - 2022-04-19
-
16.0.0 - 2022-04-05
- Packages are now ESM-Only (https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)
- Node 18 Support
-
15.1.3 - 2022-03-31
-
15.1.2 - 2022-02-07
-
15.1.1 - 2022-02-06
-
15.1.0 - 2022-02-05
- All packages now have verified ESM support
- Packages expose CJS/ESM surface are via
-
15.0.2 - 2022-02-04
-
15.0.1 - 2022-02-04
-
15.0.0 - 2022-02-04
-
-
-
- Improve data-transfer acquisition from File inputs (#3262)
- Don't set the 'draggable' attribute unless
- Improve typings of DropTargetMonitor, DragLayerMonitor (#3300, #3341)
-
14.1.0 - 2022-01-02
-
14.0.2 - 2021-09-27
-
14.0.1 - 2021-08-13
-
14.0.0 - 2021-03-09
- The function version of
// Pre-v14
-
12.1.1 - 2021-02-24
-
12.1.0 - 2021-02-22
-
12.0.1 - 2021-02-22
-
12.0.1-canary.1 - 2021-02-22
-
12.0.0 - 2021-02-21
-
11.1.3 - 2020-05-29
-
11.1.1 - 2020-05-26
-
11.1.0 - 2020-05-26
-
11.0.0 - 2020-05-24
-
10.0.2 - 2019-12-07
from react-dnd-html5-backend GitHub release notesMajor
The utility packages
@ react-dnd/invariant,@ react-dnd/shallowequal, and@ react-dnd/asap(which are forks of popular libraries) have been included in the monorepo and built using the same output mechanisms as thereact-dndcore packages (dual EJS/CSM).@ react-dnd/asaphas been simplified to remove the node variant, which relied on deprecated APIspkg.exportsThis release uses output from swc using the 'es2017' target instead of using output from 'tsc' using the 'ESNext' target.
This release fixes issues with the ESM-only structure of v15.0.0. All packages are now in their prior CommonJS/ESM format.
Major Changes
The react-dnd packages are now published as ESM-only withtype: module. See this FAQ by sindresorhus: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99cThe Decorators API has been removed and fully replaced by the Hooks API. The Decorators API was difficult to develop & type correctly, and this improves its maintainability.
The builds no longer use babel & preset-env. The library is transpiled using SWC into the "es2017" target, which assumes async/await is available. This should reduce bundle sizes by removing polyfills and support-code which may be unnecessary in your target.
Bugfixes
canDragis true (#3187)Patch
This PR will throw a developer exception if a user specifies a
useDrag::spec.beginmethod.Patch
Update internal hook
useDragType()to align with updated typings. Check 14.0.0 release for API changesThis 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
useDraghave been refactored. In short:spec.typeis requiredspec.itemcan be a function or static object.spec.itemreplacesspec.beginSince the release of the hooks API, we packed
typeunderspec.item. However, this led to nonintuitive situations where anitemfield was required to be specified even though items are created in thebeginmethod.Additionally, in the original React-DnD design,
beginDrag()was optional and the type of the draggables had to be defined. If no explicit DragObject was created, an implicit object was created by the system..The change we've made here decouples
typefromitem, and collapsesbeginintoitem.useDrag({
// item defined here to get a type
item: { type: BOX } },
// ...but the actual item is created here
begin: () => ({ id })
})
// v14
useDrag({
type: BOX,
item: () => ({id})
})
e.g.
useDrag({ item: { type: BOX }})=>useDrag({ type: 'BOX' })We've also added the ability to cancel drag operations in the hooks API by returning null from
begin.Commit messages
Package name: react-dnd
Compare
Package name: react-dnd-html5-backend
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs