0
punsa
4y

For classified type of website, where user experience differs much in web and mobile, is it better to keep seperate codebase or should I go with 1 codebase having responsive approach? Currently I am using react in mobile and having web codebase in angular. Any suggestions??

Comments
  • 1
    Try to share common libraries that are the same and possibly some display components if they are reusable but for overall page I suggest separate templates to avoid to much compromises.

    But it all depends on how complex structure you have, a very clean structure can probably be shared to save time.
  • 0
    @Voxera @Voxera But if i keep the same codebase and have different templates as per device detection, then it will increase the size of bundle and will not be optimized
  • 0
    @punsa first, with caching that is most likely mot a big problem, but even if it is it can be solved with for example webpack which can be configured to create multiple bundles for different endpoints and also bundle up files to reduce the number of files.

    Bu unless you have a very large application or customers with very small devices or slow network it will not make a very big difference.
  • 0
    @Voxera I am already creating page level bundles, for different routes using webpack. My concern is that if there are 2 templates 1 for web and 1 for mobile, for a particular route, where exeperience differs too much for web and mobile, then in bundle of that route, both templates will be included, I guess it will not increase size much as it is just html, but still that thought is coming in my mind.
  • 1
    @punsa unless you know its an issue it’s premature optimization at this point.

    Get it done and if you get enough traffic and can measure an impact, then recruit an expert to help.

    If you spend to much time tweaking you will never need the perfect solution you create :/

    Most likely the templates will represent a tiny fraction of the data sent with images being 90+ percent or so. And if there are no images and only text I expect the layout to be very clean with not much overhead.
  • 0
    @Voxera I agree, thanks a lot.
Add Comment