Reputation: 57
I have really big concern on my web project architecture which will have separate mobile and desktop web app.
I already finished to develop web version based on "create-react-app" project template and for mobile version, I want to reuse my exists web version component as much as possible.
We will serve these with separate url "www" for desktop and "m" for mobile.
I am thinking of two possible ways.
I also thought about the responsive web design, but we have totally different layout and components.
Rendering two different layout within a component by the size of viewport or url(www/m) might be another possible way but it is highly possible for me to use server-side-rendering...
What would be the good approach to solve this problem....
Upvotes: 5
Views: 4282
Reputation: 930
You can use the same code and build mobile application using Cordova Framework as your web code will be the one to generate application.
As well you can create for multiple platforms. Go through official website. https://cordova.apache.org/docs/en/latest/guide/cli/index.html
Upvotes: 0
Reputation: 8114
I would approach this as follows:-
Handle view part for both the apps separately.
I also thought about the responsive web design, but we have totally different layout and components.
If you have totally different layout and components I would suggest to keep mobile and web segregated. Its not only about the bundle size, you can get around it by lazy loading, but your code complexity can increase.
Upvotes: 6