DEV Community

Discussion on: A First Look at MarkoJS

Collapse
 
dendihandian profile image
Dendi Handian

So there are must be so many javascript libraries for the 5th contender, but so far only Angular, React, Vue and Svelte who stands out.

Collapse
 
peerreynders profile image
peerreynders

It's not a popularity contest. One has to assume that MarkoJS exists because it's the best fit for eBay's particular use case - and because it's open sourced others can use it. Sometime before 2017 they moved from a more traditional Java-based web stack to MarkoJS to accelerate their iteration cycles.

What sets MarkoJS apart from current mainstream JS frameworks is that it evolves and extends the traditional server-rendering model rather than starting out with a client-side rendering approach.

For client-side rendering frameworks SSR is typically added after the fact (React -> Next.js, Vue.js -> Nuxt.js, Svelte -> Svelte Kit).

And unlike more recent server-side entries like Nest.js MarkoJS's rendering capabilties encompass both the server and client-side - with emphasis on server-side performance.

Current efforts seem to be geared towards reducing the client-side JS payload size and computational requirements - so that the resulting UX will still be acceptable even on (less than) modest client device hardware.

So MarkoJS isn't about "emulating native apps" but building commercial web applications that a company like eBay can benefit from. And there are likely lots of other use cases that could benefit from that as well.

A clean start for the web

My first thought is that there are two webs: ... The document web ... The "application" web

The truth is that there is a full spectrum from the document to application web and I think that MarkoJS aims for the "highly interactive document" to "application with static parts" slice.

Given the possible range of use cases "one-framework" is just as unrealistic as one-language. Currently the industry's obsession with native-envy and "web application" glamour (vs. just a web site) seems to make React/Next.js the de facto standard regardless of the potential trade-offs (in TCO and UX).

And if it was a popularity contest ... then there is the vocal faction of developers who won't even look at MarkoJS because "it doesn't support TypeScript out of the box". Svelte had to deal with it - adding support this year. Only time will tell if that vocal faction is sufficiently large to make a noticable difference in adoption going forward.

"Marko extends the HTML language" while Svelte is "using a superset of HTML" and both seem to have a philosophy of investing in design time solutions to reduce runtime requirements (e.g. by using compilers). This trend seems a more natural direction for web technology to evolve along compared to anything else that has appeared since AngularJS in 2010.

Collapse
 
ryansolid profile image
Ryan Carniato

Yeah so many. To be fair Svelte is still relatively new in the 4th spot. There was a time where Ember was established enough to even be uncontested 3rd spot. What I like about the popular libraries is that Angular, React, Svelte all have a clear identity so it is easy for people to choose between them. There has been clear narrative on the client side of things.

That being said what makes Marko particular interesting is it does things that none of those libraries do. There is some work in 3rd party space for sure, but Marko is built on it to the point it is optimized at the core level. I'm not going to say those features are necesary to make good sites and apps. But given the interest around things like Next, Gatsby, Nuxt, Nest, Sapper, etc.. its interesting when there is a mature library built on these constructs and not where they are patched on as an afterthought.