-
Notifications
You must be signed in to change notification settings - Fork 177
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
Using the-graph as a React component in a webpack environment #360
Comments
Currently If you use Webpack to pull in React (as opposed to a script tag like examples do), then expose it yourself using |
I'm not sure I can do it in my project... I tried setting the modules directly in I'll try to work on the CommonJS tasks at #314 since I really wanted to use this as a standalone component. |
@ruippeixotog For my own project I forked this project and hacked it to be able to use in a Webpack+React 15.x environment: https://github.com/femans/the-graph It is work in progress and as I need it in the long run, I will keep improving on it. Feel free to use it or fork it again. It is workable now, but a lot still needs to be done. |
@femans would you like to submit that as a PR? |
Hi @bergie, yeah would love to, but I don't know if the current state is compatible. I would have to test that hypothesis. It has been quite a big refactor so far, jumping 15 versions of React at once, and making a dependency of a webpack bundler for the css. Also I intend to over time remove the deprecated stuff that is in there, so that it will be compatible with react v16.
It works by itself as a react component and i made a small webpack/react example project based on the basic example. Once i am a bit further i will try to see if it can be integrated. It was not my main intention, I just needed it for my own project. But ok I will see what I can do.
|
@femans it's great to hear that someone was able to do it! I gave up after I had to deal with some messed up dependencies and usage of globals... I'll try your fork this week and give some feedback. |
Cool. It is work in progress though, not everything works 100% 'out of the
box' yet, menus for example dont work yet, and fontawesome icons dont work
yet either. I am sure there is more that i havent found out yet.
Let me know if you use it so i will make sure not to push unstable code on
master.
|
@ruippeixotog did you ever try it out? I moved the project to https://github.com/digibio/the-graph |
@bergie what are the odds of having something like this merged in? Looking at depending on this package, but the super-old react and incompatibility with webpack/ js module systems are dealbreakers. Can provide some resources to help this happen if it will be supported |
We really really want to make the-graph cleanly usable with standard webpack and React workflow. It is also desirable to update to latest React. Any help along these lines is appreciated. If some is interested in paying for the work that can help enable us to prioritize it and get it done in a timely fashion. |
Most of the specific needs to get this to work are in #314 |
Glad to hear that this is a priority. |
What is the status of this work? I am happy to contribute to an active PR for this issue. Thanks! |
React 15 compatibility has been merged and released in the-graph 0.11. Everywhere inside the components should be using require() to get React, so I think this should just-work with webpack now. |
Here is an example App.js that works out-of-the-box with
Closing this as fixed |
Sweet! Thanks a ton everyone! |
@jonnor Thanks a lot, just what I have need. Will try to send PRs for the the-graph component. |
@jonnor I have an issue, accessing
But
Any idea is appreciated. |
(Dev without much front-end experience here, sorry for any imprecision)
I read through the existing issues and saw there is the intention of stripping this project of noflo-specific dependencies and Polymer. But I have one question: as it is now, can
the-graph
be used as a React component in a Webpack/CommonJS modules environment at all?I tried creating a simple project just to see if I could use one of the React components, but just rendering this:
Causes an
Uncaught ReferenceError: React is not defined
here. Does this happen because you are still in the process of migrating the code base to use CommonJS modules? Or am I doing something wrong? If it's the former reason, is there any hack I can do to make this work?Thanks for your work until now on this project, these graphs surely look great!
The text was updated successfully, but these errors were encountered: