Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR with Blaze #545

Open
mitar opened this issue Feb 27, 2016 · 6 comments
Open

SSR with Blaze #545

mitar opened this issue Feb 27, 2016 · 6 comments
Labels

Comments

@mitar
Copy link
Contributor

mitar commented Feb 27, 2016

Blaze is not available on the server side, but Blaze Components are. I have not done much testing with SSR, but I am opening ticket here if anyone is interested to try to implement it.

(Just to be clear, if you use Blaze Components, you can also use pure Blaze, so using Blaze Components instead of Blaze gives you also normal Blaze support on the server side. So this can work even for simple Blaze templates.)

See related ticket in Blaze Components repository: peerlibrary/meteor-blaze-components#110

@arunoda
Copy link
Contributor

arunoda commented Feb 28, 2016

Okay. If so, I think this is super cool.
This is how to add the support for SSR.

Make sure BlazeComponents are rendered inside a FlowRouter action.
In the client, do it normally.
In the server, generate the HTML and send it to FlowRouter like this:

See: https://github.com/kadirahq/react-mounter/blob/master/lib/server.js#L26

@mitar
Copy link
Contributor Author

mitar commented Feb 28, 2016

What about wrapping subscribe calls inside Blaze Components? Will this be done automatically?

@arunoda
Copy link
Contributor

arunoda commented Feb 28, 2016

Yes. They are automatic. But they need to happen in the same eventloop cycle where FlowRouter .action() is called.

Using it inside a Tracker.autorun is fine.

@mkpazon
Copy link

mkpazon commented Apr 27, 2016

+1

@brown2rl
Copy link

I would like to contribute. Is anyone actively doing this? Seems like the guide dropped iron router

@mitar
Copy link
Contributor Author

mitar commented May 19, 2016

See some discussion here and related tickets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants