News for hackers. Stuff that matters.
Re:The Joy of Mixing Custom Elements, Web Components, and Ma... by jpjuni0r on Tuesday August 12, 2025 @02:10AM (#44872970)
> if you use simple unchanged files for other dynamic stuff like JSON etc, you can just generate those on build and serve those files in the host directly

Other web frameworks support this too, if you look for "static export" options. Next.js, for example, supports this via the getInitialProps function.

What I like especially about Astro, that you perform this data loading during build time from any component/file on your page. With Next.js, this is only possible via the top level Page component.

Re:The Joy of Mixing Custom Elements, Web Components, and Ma... by pjmlp on Wednesday August 13, 2025 @03:19AM (#44885527)
That is legacy, the current way with page router model is to use getStaticProps or getServerSideProps.

And if using app router model, that is part of React server components.