Release 8.0.0 ยท atlassian/react-beautiful-dnd (original) (raw)

Improvements

23% faster ๐Ÿƒ

We have shipped dragging performance improvements of 23% from cold start and 6% during subsequent drags

Measured on a list with 500 Draggables

We did this by:

18% smaller ๐Ÿฅ— #525

Our production builds have gone from 38 kb to 31 kb (gzip), a 18% reduction โ†“. The cost can be as low as 23 kb if you can deduplicate our dependencies (redux, react-redux and react-motion are the main ones)

We did this by:

Development messaging ๐Ÿ”Šโค๏ธ

Taking inspiration from React, we have introduced a number of development only warnings to assist you with correctly using react-beautiful-dnd:

These messages will be stripped in production builds

Improved recovery from any internal errors ๐Ÿ‹๏ธ

Errors can happen (I know right!?). If react-beautiful-dnd encounters an error in its code then it will attempt to recover as best as it can: clearing any existing drags and firing the appropriate DragDropContext > hook functions. It will also log some helpful debug information in the console in development builds (process.env.ENV !== 'production')

Engineering health ๐Ÿ‘ฉโ€โš•๏ธ

Other

Features

Drop information in the DraggableStateSnapshot #559

We expose information to allow you to style a Draggable while it is being dragged. This is done using the DraggableStateSnapshot. We are adding an additional property isDropAnimating which will be set to true when the Draggable is drop animating. Not all drops have a drop animation. We do not animate a drop if the Draggable is already in the correct spot when the drop occurs. This is commonly the case when dragging with a keyboard. isDragging will continue to be set to true even when a drop is occurring. The drop animation is still apart of the 'drag' interaction and is not important when it comes to our public api. However, you can use the new isDropAnimating property to apply some styles specifically when dropping if you would like to.

type DraggableStateSnapshot = {| isDragging: boolean,

This resulted in a minor version change

Changes

DraggableProvided > DraggableProps > DraggableStyle

Previously we were clearing the margin off a dragging item. We realised this was not needed. Rather than keeping the margin property around, we have decided to keep things as clean as possible and remove it.

type DraggingStyle = {| position: 'fixed', width: number, height: number, boxSizing: 'border-box', pointerEvents: 'none', top: number, left: number,

This is a breaking change ๐Ÿ’ฅ as it is the removal of a property. Risk of breakage: low. This will only cause an issue if you were monkey patching the margin property.