Are SPAs (Single Page Applications) suitable for sites aimed for mobiles?

前端 未结 8 1195
野趣味
野趣味 2021-01-31 03:27

I am planning to create a website with around different 20 views/pages primary for mobile phones.

If I want to focus on a making the user experience very responsive (as

8条回答
  •  一生所求
    2021-01-31 03:37

    TL;DR: Yes, it's feasible but you need to be disciplined and the benefit is on perception of performance

    I've been working on transitioning a traditional server-centric "desktop" web application to a responsive SPA over the past few months. Specifically we've chosen a MV* design supported by a mediator router an decoupled fetching with AMD. We're exploring shifting this to RVP.

    I've included some of our design principles below:

    • Decide early the extent to which your platform will support progressive enhancement. Less scripts that are needed the better. We rely on our build process to ensure we can support dynamically generated but statically served HTML and other content
    • Build your toolchain early (minification, image crunching or spriting, etc)
    • Decouple fetching from user actions as much as possible, with use of local storage and techniques like pre-fetching or predictive fetching.
    • Ensure you measure what your users are doing so you can (if it makes sense), progressively fetch application logic or content
    • Be really fussy on which frameworks support the rest of your architecture (rather than dictate it).
    • Be really fussy on which third-party components and utilities you use. Avoid frameworks where you're not using a significant proportion of the feature set (anything you're not using is extra cost in weight, latency, on-device processing, etc)

    You may find this framework comparision useful

提交回复
热议问题