whitestorm-typescript-boilerplate icon indicating copy to clipboard operation
whitestorm-typescript-boilerplate copied to clipboard

Server Hot Reload and SSR

Open zhenyulin opened this issue 6 years ago • 1 comments

I just started to move to typescript, and found this boilerplate to be very nice and similar to what I've been using previously with flow previously

During the process of set it up, I also find some features can be further added, e.g. Server-side Hot Reload, and SSR, would be happy to make contribution here, but would be great to have some initial direction.

Currently, it seems I'm not able to use ES6 module import on the server side yet. While tslint-loader is set up on the client side webpack config, the server file is also hooked on it in some way. Would be great to have an idea of how this part is structured.

Furthermore, the client side code seems to be built twice when start the server in development, once by the build command, and another time by the 'webpack-dev-middleware'.

zhenyulin avatar Aug 18 '17 11:08 zhenyulin

@zhenyulin thanks for your comments, and sure you are welcome to contribute.

A few reasons first to explain the lack of support of the tech you mentioned:

  • Server side hot reload Since webGL content is pretty much all on the front end, there is little need to support hot reload on the server code as there is almost nothing in there. If the boilerplate evolved into full fledged server resources, such as supporting sockets to fetch data from the server etc, then yes it would make total sense (I doubt this boilerplate should bloat itself with too much).

  • SSR (assuming you refer to server side rendering) Same deal, the server templating and rendering html content is a very efficient approach to boost performance for first paint/interaction, however, since webGL assets are usually very heavy weight, it would provide very little benefit in this use case.

  • ES6 module import on the server Probably an oversight on my part, and didn't pay attention since there is little to nothing on the server, would be good simply add it.

  • Build twice? Seems like a bug. yes we should fix that.

thanks-

hirako2000 avatar Aug 19 '17 01:08 hirako2000