3 ms·
"No build step" is a weird pitch when what actually happens is that, in production, they'll fetch a WASM module on the fly to do bundling at request time. That
by yencabulator 4y ago
"No build step" is a weird pitch when what actually happens is that, in production, they'll fetch a WASM module on the fly to do bundling at request time.
That build step was there to avoid doing this work over and over!
https://github.com/lucacasonato/fresh/blob/458fe2ca3c12508a60cb304bd0f17e1087f553f1/src/server/bundle.ts#L33-L99 https://github.com/lucacasonato/fresh/blob/458fe2ca3c12508a6...
https://github.com/lucacasonato/fresh/blob/458fe2ca3c12508a60cb304bd0f17e1087f553f1/src/server/bundle.ts#L10 https://github.com/lucacasonato/fresh/blob/458fe2ca3c12508a6...
- meowtimemania 4y agoI thought this too. Isn’t it a better user experience if the bundling happens ahead of time rather than at request time?
- hunterb123 4y agoI'm not familiar with their implementation, but it could be that the bundling is only a temporary solution for browsers that don't support import maps. Or a light layer on top of it. Import maps are pretty cool, you don't need to bundle in modern browsers and it plays to http2's parallel request strengths.
- pier25 4y agoMaybe it has a cache and this only happens the first time? It would be a bit ridiculous to re-compile JSX into JS on every request.
- yencabulator 4y agoI didn't say every request. It'll still happen on every cold serverless request, every first request to every scale-up VM, ...
- lucacasonato 4y agoYeah, it doesn't do this. The transpiled output is cached indefinitely for a given deployment.
- pier25 4y agoHey Luca, any chance you might add other front end frameworks in addition to Preact?