DEV Community

Discussion on: Back to Basics: Building a HackerNews Clone with Marko

Collapse
ryansolid profile image
Ryan Carniato Author • Edited

With a Marko project not using our basic starter(@marko/serve) like our Webpack-Express starter it is a very easy one line change. You just change the render entry point to:

const html = await template.render(input);
Enter fullscreen mode Exit fullscreen mode

However the basic project template I used in this demo is all preconfigured to work with streaming. You could make the <await> the topmost component on the page and remove the client-reorder and placeholder and it should wait to render anything and still benefit from streaming in the head of the document for quicker script loading, but that only works effectively in a simple case like this. And I'm just hacking it.

That being said getting started with a Webpack-Express project is just as easy using @marko /create but it doesn't have the built-in routing but it gives you full control of the configuration.

And this might be a little exaggerated but this is why there is a preference for this loading pattern: markojs.com/#streaming. This is more or less the difference Marko's streaming/progressive rendering makes.