uber / react-digraph

A library for creating directed graph editors
MIT License
2.62k stars 268 forks source link

Development with live reload #102

Open iamsoorena opened 5 years ago

iamsoorena commented 5 years ago

Is your feature request related to a problem? Please describe. Currently when I'm working to add features to this library I have a hard time. Why? Because dev mode has some issues. I think the current development is designed to use with example project on the contrary I think developer should be able to use npm link and develop while working on their own project.

Describe the solution you'd like Fix dev mode.(It currently does not update on code change while using with npm link.

As an alternative I use wml to watch for file changes and update my project's node_modules/react-digraph, also I set project entry to src and I add some extra configurations to my webpack to be able to have live code update, configs to compile flow, arrow funcitons ...

Since these configs are somehow opinionated, I didn't send a PR. I want to know what's your idea too.

ajbogh commented 5 years ago

Just to throw out some ideas, from the project side, I think we could add a watch:prod task to npm which could watch for file changes and build the files for production. For linking we could add a watch:link command to automatically call npm link after a build.

As you pointed out, building the files and linking in the react-digraph project won't really do anything for your website. It prepares the files, but it doesn't reload the files in your code. Since we don't control your code I think your workaround gets around that problem. The best we could offer is contributor documentation which instructs developers on how to set up wml and other necessary configurations for their websites.