Skip to content

refactor: upgrade: react-dnd, react-dnd-html5-backend #2201

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

Closed
wants to merge 2 commits into from

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Jul 4, 2022

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.

Name Versions Released on
react-dnd
from 10.0.2 to 16.0.1
23 versions ahead of your current version
⚠️ This is a major version upgrade, and may be a breaking change
2 months ago
on 2022-04-19
react-dnd-html5-backend
from 10.0.2 to 16.0.1
22 versions ahead of your current version
⚠️ This is a major version upgrade, and may be a breaking change
2 months ago
on 2022-04-19
Release notes
Package name: react-dnd
  • 16.0.1 - 2022-04-19
  • 16.0.0 - 2022-04-05

    Major

  • 15.1.2 - 2022-03-31

    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 the react-dnd core packages (dual EJS/CSM).

    @ react-dnd/asap has been simplified to remove the node variant, which relied on deprecated APIs

  • 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 pkg.exports
  • 15.0.2 - 2022-02-04

    This release uses output from swc using the 'es2017' target instead of using output from 'tsc' using the 'ESNext' target.

  • 15.0.1 - 2022-02-04

    This release fixes issues with the ESM-only structure of v15.0.0. All packages are now in their prior CommonJS/ESM format.

  • 15.0.0 - 2022-02-04

    Major Changes

    • The react-dnd packages are now published as ESM-only with type: module. See this FAQ by sindresorhus: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

    • The 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

    • Improve data-transfer acquisition from File inputs (#3262)
    • Don't set the 'draggable' attribute unless canDrag is true (#3187)
    • 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

    Updated

    react-dnd: 14.0.3
    react-dnd-html5-backend: 14.0.1
    react-dnd-touch-backend: 14.1.0

    Patch Updates

    • 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

    Patch

    This PR will throw a developer exception if a user specifies a useDrag::spec.begin method.

  • 14.0.1 - 2021-03-09

    Patch

    Update internal hook useDragType() to align with updated typings. Check 14.0.0 release for API changes

  • 14.0.0 - 2021-03-09

    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 refactored. In short:

    • spec.type is required
    • spec.item can be a function or static object.
    • The function version of spec.item 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 field was required to be specified even though items are created in the begin method.

    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 type from item, and collapses begin into item.

    // Pre-v14
    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.

    // new API
    useDrag({
      type: BOX,
      item: () => shouldNotDrag ? null : {id},
    })
  • 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 notes
Package name: react-dnd-html5-backend
  • 16.0.1 - 2022-04-19
  • 16.0.0 - 2022-04-05

    Major

  • 15.1.3 - 2022-03-31
  • 15.1.2 - 2022-02-07

    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 the react-dnd core packages (dual EJS/CSM).

    @ react-dnd/asap has been simplified to remove the node variant, which relied on deprecated APIs

  • 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 pkg.exports
  • 15.0.2 - 2022-02-04

    This release uses output from swc using the 'es2017' target instead of using output from 'tsc' using the 'ESNext' target.

  • 15.0.1 - 2022-02-04

    This release fixes issues with the ESM-only structure of v15.0.0. All packages are now in their prior CommonJS/ESM format.

  • 15.0.0 - 2022-02-04

    Major Changes

    • The react-dnd packages are now published as ESM-only with type: module. See this FAQ by sindresorhus: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

    • The 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

    • Improve data-transfer acquisition from File inputs (#3262)
    • Don't set the 'draggable' attribute unless canDrag is true (#3187)
    • Improve typings of DropTargetMonitor, DragLayerMonitor (#3300, #3341)
  • 14.1.0 - 2022-01-02
  • 14.0.2 - 2021-09-27

    Patch

    This PR will throw a developer exception if a user specifies a useDrag::spec.begin method.

  • 14.0.1 - 2021-08-13

    Patch

    Update internal hook useDragType() to align with updated typings. Check 14.0.0 release for API changes

  • 14.0.0 - 2021-03-09

    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 refactored. In short:

    • spec.type is required
    • spec.item can be a function or static object.
    • The function version of spec.item 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 field was required to be specified even though items are created in the begin method.

    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 type from item, and collapses begin into item.

    // Pre-v14
    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.

    // new API
    useDrag({
      type: BOX,
      item: () => shouldNotDrag ? null : {id},
    })
  • 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 notes
Commit messages
Package name: react-dnd
  • def672e chore: version bump
  • 386c3a7 Fix for "Invariant Violation: Expected targetIds to be registered." (#3432)
  • 4267e4b Library Refresh (#3435)
  • 2a59698 docs: restore unjsxify script (#3427)
  • 8f6cb6c v16 Release (#3421)
  • 8e6f62e Switch to ESM-Only; add React 18 Support (#3420)
  • c0de264 chore: version cut
  • bfa3086 ci: remove node 14 (#3415)
  • 9c848d8 fix: conditionally render example code in Next depending on SSR context (#3414)
  • 4fa53c8 chore: remove hover cancel (#3412)
  • 85371da chore: upgrade to yarn 3.2.0 (#3411)
  • 32b0bbf fix: "Invariant Violation: Expected targetIds to be registered." (#3409)
  • 0830641 Remove js imports in examples (#3396)
  • 9ea462e Mark util packages as public (#3386)
  • ca8784e chore: version bump (#3385)
  • 72bfc3d Add Next.JS App Tester Package (#3384)
  • bc4204e refactor: use a common directory-walking utility (#3382)
  • 89806d7 Fix some formatting (#3381)
  • 746f2b2 chore: bump versions (#3380)
  • fa20dc8 fix: revert a recent PR that made the draggable attribute conditional (#3379)
  • 89aa31d Release/v15 1 0 (#3377)
  • a8a42aa feat: add vite test suite pkg (#3376)
  • aa32d2f ci: use Node 16 to deploy to docsite (#3375)
  • 49cfef7 Add Create-React-App Test Suite (#3374)

Compare

Package name: react-dnd-html5-backend
  • def672e chore: version bump
  • 386c3a7 Fix for "Invariant Violation: Expected targetIds to be registered." (#3432)
  • 4267e4b Library Refresh (#3435)
  • 2a59698 docs: restore unjsxify script (#3427)
  • 8f6cb6c v16 Release (#3421)
  • 8e6f62e Switch to ESM-Only; add React 18 Support (#3420)
  • c0de264 chore: version cut
  • bfa3086 ci: remove node 14 (#3415)
  • 9c848d8 fix: conditionally render example code in Next depending on SSR context (#3414)
  • 4fa53c8 chore: remove hover cancel (#3412)
  • 85371da chore: upgrade to yarn 3.2.0 (#3411)
  • 32b0bbf fix: "Invariant Violation: Expected targetIds to be registered." (#3409)
  • 0830641 Remove js imports in examples (#3396)
  • 9ea462e Mark util packages as public (#3386)
  • ca8784e chore: version bump (#3385)
  • 72bfc3d Add Next.JS App Tester Package (#3384)
  • bc4204e refactor: use a common directory-walking utility (#3382)
  • 89806d7 Fix some formatting (#3381)
  • 746f2b2 chore: bump versions (#3380)
  • fa20dc8 fix: revert a recent PR that made the draggable attribute conditional (#3379)
  • 89aa31d Release/v15 1 0 (#3377)
  • a8a42aa feat: add vite test suite pkg (#3376)
  • aa32d2f ci: use Node 16 to deploy to docsite (#3375)
  • 49cfef7 Add Create-React-App Test Suite (#3374)

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

Snyk has created this PR to upgrade:
  - react-dnd from 10.0.2 to 16.0.1.
    See this package in npm: https://www.npmjs.com/package/react-dnd
  - react-dnd-html5-backend from 10.0.2 to 16.0.1.
    See this package in npm: https://www.npmjs.com/package/react-dnd-html5-backend

See this project in Snyk:
https://app.snyk.io/org/acinader/project/3e039b91-2450-4b56-8420-baf56cab388e?utm_source=github&utm_medium=referral&page=upgrade-pr
@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title [Snyk] Upgrade: react-dnd, react-dnd-html5-backend refactor: upgrade: react-dnd, react-dnd-html5-backend Jul 4, 2022
@parse-github-assistant
Copy link

Thanks for opening this pull request!

  • ❌ Please edit your post and use the provided template when creating a new pull request. This helps everyone to understand your post better and asks for essential information to quicker review the pull request.

@damianstasik
Copy link
Contributor

I think we can close this one, as the upgrade is not that straight-forward as just updating package.json. I took care of required changes here: #2278

@mtrezza
Copy link
Member

mtrezza commented Sep 29, 2022

Closing due superseded by #2278

@mtrezza mtrezza closed this Sep 29, 2022
@mtrezza mtrezza deleted the snyk-upgrade-78bbe23db6133fc0320c484690a89454 branch September 29, 2022 23:00
@mtrezza mtrezza restored the snyk-upgrade-78bbe23db6133fc0320c484690a89454 branch September 29, 2022 23:01
@mtrezza mtrezza deleted the snyk-upgrade-78bbe23db6133fc0320c484690a89454 branch September 29, 2022 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants