Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
React Support for client side #6044
Comments
deepu105
added
feature request
major
React
labels
Jul 6, 2017
|
We are currently using React and Vue.js and are exploring an approach to write custom components once with preact and then use a thin wrapper to use the component both in react (or just use the preact version) and in vue. Maybe we should also think about something similar to make it possible to use another frontend if required (or for a module that provides vue instead of react). |
|
In my personal experience using 2 frameworks whuch does same job only adds complexity and makes maintenance harder and implementation flaky. I would rather stick 2 just one framework. Evn using angular 1 and 2 together needed a lot of duct tape. So I would recommend to keep Vue out of question for now. From point of Jhipster, what would be more beneficial would be to find a way to add alternative options simpler |
|
Absolutely! Supporting two frameworks in core generator is hell. When we find a way to write components (e.g. table component) once (in preact) and can use that component in different ui frameworks with little overhead (preact is 3kb) this would at least help to be able to add additional options (either in the main generator or as a module) as we would not need to rewrite everything in the new fraemwork, but agree, lets focus on react first. |
|
@sendilkumarn I see that you assigned items 2 & 3 to yourself, I have already done this on my company project which is based on JHipster-react so I'll do the base changes and then you can work on top of that. |
|
Okay |
|
Just wondering -- from the current EDIT: Maybe keep an eye on this -- FB are aware that this is scaring a lot of folks: facebook/react#10191 |
|
@erikkemperman I'm aware of it. Technically we are not an Apache Foundation project and hence this doesn't affect us. I do understand the BDS + Patents license is slightly less permissive than APL2 (I'm not a lawyer) But in any case this shouldn't worry us, in the rarest ever possibility that someone encounters a legal issue becoz of the React licence, Never happened so far, it would be very very easy to switch to something like Preact or Inferno (which are 100% API compatible) which are MIT licenced. SO let's not worry much about this now. Also once React support is added it's too easy to add an option to choose between React or Preact so for me this is not an issue at all. |
|
@deepu105 Thanks for the quick response Deepu! Yes, I know JH is not an ASF project, I was just curious if their reasoning would apply here as well. Apparently the fear is, roughly, that using React in your projects might allow FaceBook to co-opt all of your patents, related or not, because you give up the right to sue them for infringement. It's probably not actually that bad, but still... ASF doesn't drop this bombshell lightly I imagine. I just wanted to make sure this concern is on the radar, that is all. |
|
@erikkemperman yes of course, in fact I tweeted about the legal implication about 1 year ago, and since then I'm regularly attacked by React developers in France. For me we have no issue at all here, but this needs a long explanation. First let me detail the issue with React:
Now let me detail the issues we have with the use of React in JHipster:
|
|
I was just thinking of the users, actually -- myself included :-) Thanks for detailed response, good to hear you guys have thought about this. |
|
@jdubois we are anyway safe even for your last 3 points, If we encounter issue or if we go ASF we will just switch React with Preact which has MIT license but works the same way as React and works with all other libs, so the only code change would be to change the imports technically (It can be done by find replace) look at this for example ui-router/visualizer@f07f09c |
jdubois
referenced this issue
Jul 18, 2017
Closed
[react-router] Location "/register" did not match any routes #6143
|
Instead of switching to preact, why can't we start with preact @jdubois really detailed and well laid out response |
survivant
commented
Jul 18, 2017
|
Hello, little question. Why not use Material-ui ? I was planning to use it for Desktop application, and switch to material-ui-native for mobile (when possible). Could it be possible to have the choice in the command line ? |
|
@survivant we want to align more towards our current JHipster Angular UI which is based on Bootstrap. |
survivant
commented
Jul 18, 2017
|
@sendilkumarn make sense, I'll have to check how to create a module. Could be more complete that way, if I want to generate code for web and native applications. |
|
@sendilkumarn React is more popular and has more reach so lets start with it first, we will see about issue if we ever encounter one |
survivant
commented
Jul 18, 2017
•
|
@deepu105 I'll like to play around with this branch. How can I generate app with the code in the branch ? I try to follow the documentation on : https://github.com/hipster-labs/generator-jhipster-react but I obtain this error message
I'm not too familiar with npm thanks, I hope to be able to help to test |
|
@survivant, these instructions are obsolete as react support is no longer a module but a sub generator of main generator. So it should be:
And to use in an app:
|
survivant
commented
Jul 19, 2017
•
|
@gmarziou thanks. I'll start from there. If I found issues, should I start to flag them ? for now, it's not working. here the output`C:\Data\workspace_perso\github-forks\jhipster-react-branch>yo jhipster |
|
I got same error when I tried this morning with 2 languages too. |
|
Yes i18n might not work, anyways I'm planning to rewrite to typescript and use bootstrap over the weekend, so next week I hope it can make some basic apps |
|
I would suggest using redux saga with react redux instead of the Promise Middleware. Seems like a more cleaner approach. I'm no expert on react though. |
|
I have looked at Saga and its an overkill for crud operations. Its useful if you have really complex side effects to manage. Also redux advices to start simple with promise and thunk and use saga or observable only when you have complex scenarios. Also you can always use multiple libs with redux on same app as all are middlewares. So you could use promise + thunk for simple use cases and when you have complex ones you could use saga or observable |
|
@deepu105 let me know once you have committed the code |
|
I'm brand new to react but have been playing with it this week and discovered create-react-app that, as I'm sure most of you are already familiar with, hides details (webpack, babel, etc) in a react-scripts dependency that is managed and updated. Feels like a spring boot dependency bom. I suppose with typescript we'd already have to "eject" but I do quite like delegating the auto updating of react app dependencies to the maintainers of this >30000 star project. If typescript isn't set in stone, it would be awesome if we could leverage the tool without ejecting. Do you think that would be possible or desirable? Again...I'm new...which is why I don't want to configure with tools that keep shifting....grunt, gulp, webpack... :) The convention sounds really attractive. Refs: Update: |
|
I know about the app and I have tried it as well. But I dont it will fit
our needs. Its easy to use for just getting a skeleton but after that you
have to fight it to do a lot of stuff based on our requirements. More than
that as we need to template stuff it doesn't make much sense to use that
just for dependency management. Anyway we will be using a lot more
dependencies as well. Also unlike Angular CLI the create react app is quite
basic
…
|
|
@sendilkumarn I have committed initial version of TS + BS code. You need to enable sass to test it. I think there are some quirks with i18n and the header menu needs fixing, but feel free to hack on |
|
my test config
|
|
@sendilkumarn also its mostly not templated yet so other options needs to be templated in and i18n needs to be handled. I'll come up with a solution for i18n |
deepu105
added the
in-progress
label
Jul 23, 2017
|
@deepu105 : soon holidays for me but, I will try to add:
|
survivant
commented
Jul 24, 2017
•
|
I tried this morning, but I got this at the end
|
|
@deepu105 I added few fixes there. Waiting for your i18n @survivant the errors that you have mentioned should disappear now. |
|
@sendilkumarn great thanks. Feel free to take up the next task |
|
I have sample unit tests, will commit those when I find time |
|
Karma tests works as well |
|
@addisoc is working on the settings and password page |
|
You work like a robot ! |
filiipake
commented
Aug 20, 2017
|
hey, anyone could tell me how can i create an application using react ? |
|
@filiipake this is written in this issue: #6044 (comment) Be warned that this is work in progress. |

deepu105 commentedJul 6, 2017
•
edited
This is the central ticket for our React support.
This will be an evolving ticket, I'll create a Project once we have identified TODO items clearly
Any TODO must be added/modified to this opening comment.
The below is the Framework choices made so far:
The below are the initial list of TODO:
cc @jhipster/developers