zyzo / react-dnd-mouse-backend

Mouse Backend for react-dnd library
http://zyzo.github.io/react-dnd-mouse-backend/
MIT License
85 stars 30 forks source link

Don't depend on react-dnd #9

Closed cormacrelf closed 6 years ago

cormacrelf commented 6 years ago

I'm the author of angular-skyhook, which is a re-implementation of react-dnd in Angular. It uses the same underlying dnd-core and is therefore compatible with all the backends.

The only problem is that existing backends tend to depend on react-dnd, and by extension, react. Technically, backends don't need any dependencies, but a peerDependency on dnd-core would be appropriate if you wanted to, and useful if it ever adds type annotations. Browsing this codebase, it seems like the only use of react-dnd is for the examples, which means the only work to do is change how the examples refer to the backend. You could probably just find and replace to make all references start with ../../ or something.

I'm happy to submit a PR to that effect.

Related issues

zyzo commented 6 years ago

@cormacrelf you're right. And thank you for the PR, however I prefer to put is as peerDependencies just for informative purpose (react-dnd seems to went far since)

cormacrelf commented 6 years ago

Mate! Close but no cigar. It would be fine to peerDepend on dnd-core, but requiring react-dnd just brings us back to square one for angular-skyhook.

zyzo commented 6 years ago

Ah ok, didn't get you the first time. I'll fix that in next release

zyzo commented 6 years ago

Done in 0.1.2

cormacrelf commented 6 years ago

Brilliant, thank you!