News for hackers. Stuff that matters.
Re:TailwindCSS v2.0 by fareesh on Wednesday November 18, 2020 @04:42PM (#25142806)
Can you help me understand the architecture a bit better? I have some reservations.

If you extract components then you require JS (low lighthouse score, lots of JS processing on slow devices, likely SEO problems) or SSR to render the page and then serve it (high TTFB)

Ideally you would have some kind of build step that can pre-process all the vue components and spit out pre-rendered HTML for all pages but preserve the interactive parts of the component scripts.

Re:TailwindCSS v2.0 by darekkay on Wednesday November 18, 2020 @06:11PM (#25143900)
> If you extract components then you require JS

Only for interactive components. You can use PHP or a static site generator and create components with no runtime JS at all.

Re:TailwindCSS v2.0 by fareesh on Wednesday November 18, 2020 @07:53PM (#25144908)
Yeah I suppose if you use a server-side framework you can use a templating engine to create partials for your components and have a single source of truth that way. I was curious to know if there was a way to do it with just Vue + some build step and pre-rendering
Re:TailwindCSS v2.0 by darekkay on Thursday November 19, 2020 @02:33AM (#25147095)
Not sure about Vue, but in React the simplest thing you could do is to use ReactDOMServer.renderToStaticMarkup(). You can develop your whole "app" in React and then create a JS-less HTML output. There's also Charge [1], a React static site generator with no client-side JavaScript.

[1] https://github.com/brandonweiss/charge