DEV Community

Discussion on: What has the Marko Team Been Doing all These Years?

Collapse
 
peerreynders profile image
peerreynders

One possible architecture is presented in

Building a multi-page PWA

Article: Beyond SPAs: alternative architectures for your PWA

SO PWA live demo
SO PWA GitHub project

The repo has been updated from using plain JavaScript Template literals to rendering with lit-html and lit-html-server.

These days I'd look at µhtml + µhtml-ssr (and perhaps JSX2TAG if jsx support is desired).

Using template based rendering seems the logical choice here as it should be easier to optimize on the server as it isn't burdened with spinning up an entire component framework just to render the HTML for a single page.

The demo has the ServiceWorker serve primarily from the Cache while updating the cache in the background. However the application could just as easily render from data stored and managed in IndexedDB (perhaps via a sqlite-worker).

That said with this architecture you'll have a substantial download hit on the first request as the entire app downloads itself after the first (server side) page has been rendered - and the application has to carefully elide parts of the pages that are preferrably absent rather than stale. But at least this setup can make use of multiple (perhaps slow) cores on the client device. Also while the ServiceWorker is a promising technology, it isn't without it's problems.

Marko fits an entirely different use case. The page(s) need to always show up-to-date information on render (stock levels, pricing, etc.) and perform well even on casual engagement (i.e. perform as much work as possible on the server while not delaying client rendering, delivering later content asynchronously or via stream without necessarily committing to building a separate HTTP-API).

In many ways as certain legacy server-side stacks look to be updated it could be more effective to adopt Marko rather than building a separate React frontend and hiding the entire server-side capability behind an HTTP-API.

Thread Thread
 
stereobooster profile image
stereobooster

I'm more interested in China view. I know what west have to say about that

Thread Thread
 
 
132 profile image
Yisar

Yes, Miniapp is our main architecture. I am an architect. I have developed a dedicated miniapp architecture for our company(ctrip.com).