koajs / koa-hbs

Handlebars templates for Koa.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

streaming compiled html.

iAmServerless opened this issue · comments

With the new renderToNodeStream React moved ahead by providing way to reduce TTFB and First paint.

Webpack generates assets which are appended to .hbs file using HtmlWebpackPlugin. React generate HTML on server using renderToString which is appended to .hbs using koa-hbs and sent to client.

To switch from renderToString to renderToNodeStream we need to separate .hbs in two parts, above and below some handlebar expression where react appends streaming data using renderToNodeStream.

With the current documentation of koa-hbs I do not found a way to get compiled html and take care of streaming by self.

Please expose an API to get comiled HTML or add support for streaming HTML.