Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It uses it to know what JS is needed for the client. If it sees <Section /> that means that no-JS is needed. But if it sees <Counter client:load /> it knows to build + bundle the Counter component and attach its JS to the page.


That's just a property on an element tag, you can access "client:load" under the ".properties" key of the element

Open your browser devtools, pick a random tag on the page, add "client:load" to it, and then "console.log(yourEl.properties)"

I dunno why you need an entire custom filetype for behavior and semantics that are MDX with a few extra preprocessor rules


The reason why you don't know is that you've decided in advance that it's not actually needed.

.astro is not actually like MDX at all. MDX extends Markdown, Astro does not, it extends HTML. MDX is a variant of JSX, Astro is not, it supports things that JSX does not like void elements. Astro supports text inside of script and style tags, JSX does not.

If you think you can rebuild Astro with "a few extra preprocessor rules", then by all means go for it. But you're going to fail.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: