Live data from Hacker News

Marko – A declarative, HTML‑based language

markojs.com

51–60 of 189 posts

Re: Marko – A declarative, HTML‑based language

#51
post #48
post #37

Maybe just me but I actually think building web apps is already fun. I’ve got a hot reloading instant dev environment, I can publish to users in an instant… it’s great! Looking at the Marko examples I feel the same way I do whenever similar stuff gets showcased: it’s trying to focus too hard on brevity and/or cutesiness and doesn’t seem like it would scale well to a full, complex web app. But maybe it’s not supposed…

FWIW, marko comes from Ebay. So, it scales - and being primarily SSR, its a better UX than your preferred frameworks

Pretty much every JS framework has SSR, the question is really how quickly does it hydrate. React typically rates poorly there but Svelte does great, at least partially because it has a compiler to optimize (like Marko does, it appears).

Re: Marko – A declarative, HTML‑based language

#53

Earlier quoted context omitted.

Personally, I'd either just put the content in an ID-ed span and have a script to replace the content. Another, perhaps better, way is to use Alpine.JS which excels at this kind of stuff.

> I'd either just put the content in an ID-ed span and have a script to replace the content And so your script is broken when someone else in your team (or maybe even yourself) renames or removes the ID and forgets to search in the whole project if some piece of code depends on this ID. JSX fixed all that mess 10+ years ago.

Yet you still need IDs for ARIA attributes, so now the JSX also needs a pile of shared variables

Re: Marko – A declarative, HTML‑based language

#54
post #46

This sort of stuff is just a big nope: Why make a special language? Just use HTML and TypeScript that will be compatible with editors, tooling, etc. This is the same mistake Imba made. It's a shame because the core of Marko looks phenomenal: streaming, fine-grained bundling, rendering performance, etc. Also not sure about the file-based routing of Marko Run. That was a big reason why I abandoned SvelteKit.

File-based routing is fundamentally flawed and it cannot be fixed. A number of libraries opt for it since it's easier for newcomers to pick up, but eventually you run into all of the cases where you do need something else. This in turn leads you to a hybrid system of multiple things where there's no single source of truth and everything is spaghetti.

Re: Marko – A declarative, HTML‑based language

#55
post #26

Earlier quoted context omitted.

this comment really proves that people do not consider the information presented to them marko is not comparable to php it is much closer to svelte i used to sympathize with people complaining about js-fatigue, but at some point its a skill issue

Marko is server side. How is that closer to svelte?

Svelte can also be used for SSR

Re: Marko – A declarative, HTML‑based language

#57
post #56

It looks interesting and in a past life I probably would have tried it out but do you know why I like React? Because it's just JavaScript. This ` ` and ` ` syntax is awful.

I mostly agree with you but React isn’t just JavaScript. JSX is not JavaScript. It’s just that we’re so used to it we don’t consider it notable any more. Worth keeping in mind when you’re looking at a brand new framework.

Re: Marko – A declarative, HTML‑based language

#60
post #57
post #56

It looks interesting and in a past life I probably would have tried it out but do you know why I like React? Because it's just JavaScript. This ` ` and ` ` syntax is awful.

I mostly agree with you but React isn’t just JavaScript. JSX is not JavaScript. It’s just that we’re so used to it we don’t consider it notable any more. Worth keeping in mind when you’re looking at a brand new framework.

That's true, sure. My response to that is in React you have JavaScript & JSX and there are clear boundaries. It's not mixed. I don't write

In JSX I write JavaScript that returns JSX:

{data.map(node => )}

^ ----- JS ----^ ^ ------ JSX -------^

or

const elements = data.map(node => ) ... {elements}

Really the most obscure syntax there is the splatting but it makes sense to you when you realize that JSX is just syntactic sugar for JS:

data.map(node => React.createElement(Element, { ...node }))

Post reply on HN