elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.48k stars 8.04k forks source link

[meta][tech debt] Replace react-beautiful-dnd with EUI Drag and Drop #102689

Open clintandrewhall opened 3 years ago

clintandrewhall commented 3 years ago

As I discovered in https://github.com/elastic/kibana/pull/102688, Canvas was using react-beautiful-dnd for its Drag n' Drop functionality. It turns out EUI Drag n' Drop uses it under the hood.

Unless I'm reading it incorrectly, we saved 377k from one of our async bundles with this replacement, and removed an external dependency in the process.

Screen Shot 2021-06-20 at 11 07 22 PM Screen Shot 2021-06-20 at 10 48 37 PM

Searching the code, the following solutions use react-beautiful-dnd:

I found replacement in Canvas to be incredibly easy. Other teams may find the same, and save nearly 400k in the process.

elasticmachine commented 3 years ago

Pinging @elastic/security-solution (Team: SecuritySolution)

elasticmachine commented 3 years ago

Pinging @elastic/kibana-gis (Team:Geo)

elasticmachine commented 3 years ago

Pinging @elastic/app-search-frontend (Team:AppSearch)

elasticmachine commented 3 years ago

Pinging @elastic/kibana-stack-management (Team:Stack Management)

elasticmachine commented 3 years ago

Pinging @elastic/workplace-search-frontend (Team:WorkplaceSearch)

nreese commented 3 years ago

I am removing "Team:geo" tag from this issue since Maps usage is a type only import

scottybollinger commented 3 years ago

Enterprise Search (App Search and Workplace) Search only uses the library for types (example). Looks like EUI exports one of the ones we use so I put up a PR for that one.

Added a PR to get DraggableProvidedDragHandleProps. I believe that Enterprise Search can completely drop the library. cc @constancecchen

clintandrewhall commented 3 years ago

@nreese Can those types be imported from EUI instead? I'd love to remove this library from the package.json file entirely.

Looks like you'll be able to soon: https://github.com/elastic/eui/pull/4903