parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.29k stars 2.25k forks source link

🙋 feature request: built-in SSR for using bundler middleware #737

Open dbkaplun opened 6 years ago

dbkaplun commented 6 years ago

See also: #355

devongovett commented 6 years ago

The problem with this request is that Parcel is not specific to react. So we must design our features in a generic way that considers all possible frameworks.

That being said, if there is a way to have parcel enable this in a generic way so that e.g. plugins could implement SSR for react and other frameworks, that would be awesome. Let's figure out what that looks like.

lbguilherme commented 6 years ago

Just would like to add that for SSR to be useful, it is quite complicated. It must:


And parcel serve is not a production server in any way, I don't think it should handle SSR. Maaaybe parcel would output a separated bundle suitable to run on Node that is a server with SSR for that application. But that sounds too much.

dbkaplun commented 6 years ago

FWIW Rogue does this with Parcel+React.

DeMoorJasper commented 6 years ago

I've also recently released https://github.com/DeMoorJasper/blazingly which is an experiment to create a universal and powerfull SSR server and cli tool for parcel (in the future blazingly will be stable and extendable)

I've also been chatting with the maintainer of Rogue on how to write Rogue as a blazingly extension

st0ffern commented 6 years ago

@DeMoorJasper i think there is a problem doing boilerplates or boilerplated-tools all the time. This is why i created https://github.com/velop-io/server .

Supports multiple React apps, SSR, Webpack, HotReloading, Relay, Authenticated routes, FoundRouter, Graphql, custom routes +++ out of the box!

DeMoorJasper commented 6 years ago

@stoffern I was actually thinking of rewriting certain parts of blazingly to make it extendable, probably similar to how other SSR projects are doing it. Perhaps I'll find some time this weekend to dig into these improvements.

My main worry about supporting everything is that I dont's want to make the install gigantic, which is quite a bad thing, definitely as I'd like to make blazingly usable in production eventually (which isn't really possible if the install is ginormous, def on small cloud based servers). The concept of blazingly in production is actually to create server and client bundles to run, so that the actual runtime of blazingly can be quite small and not responsible for anything except just running some scripts in a sandbox and serving some files (this could potentially also be hosted on a cdn)

st0ffern commented 6 years ago

take a look at https://github.com/velop-io/server then