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

Compiling templates on server-side #223

Closed
mitar opened this issue Dec 31, 2016 · 13 comments
Closed

Compiling templates on server-side #223

mitar opened this issue Dec 31, 2016 · 13 comments

Comments

@mitar
Copy link
Collaborator

mitar commented Dec 31, 2016

Blaze Components support it and it is more or less easy to get templates to be compiled on the server-side.

Some things to change:

We are introducing .blaze extension (#97). So we should decide if we want only that one on the server-side, or both .html and .blaze.

The downside is that it seems this will slow-down compilation as it prevents client-only compilation and push, but it then restarts the server-side, even if file is added to client-side only in packages (not sure about client directory). At least this happened with Blaze Components when server-side rendered was added.

@marcoschwartz
Copy link

Great to hear about server side rendering :) How would that compare to https://github.com/meteorhacks/meteor-ssr for example ?

@mitar
Copy link
Collaborator Author

mitar commented Jan 3, 2017

We will see. But hopefully it will be compatible.

@j-jackson
Copy link

This is excellent news!

I was about to start rewriting my application with react for SSR, but if this is isn't too far off I can stick with blaze.

Do you have a rough idea on when this might be ready?

@mitar
Copy link
Collaborator Author

mitar commented Feb 18, 2017

I do not think anyone is working on this at the moment. But pieces are mostly around ready.

@j-jackson
Copy link

Thanks Mitar!

@mave99a
Copy link

mave99a commented Mar 8, 2017

Thanks! We are about to work on this SSR part. Thanks for the good work!

@mitar do you work for Meteor? Is this SSR official feature ?

@mitar
Copy link
Collaborator Author

mitar commented Mar 8, 2017

No, I do not work for Meteor. I just help keep Blaze around. Blaze is now maintained by the community.

There is no concept of "official feature". If community will make it, it will be there.

And again, "compiling templates on server" is not the same as SSR. SSR also requires management of how you pass correct data to templates to be compiled, and probably also management of life-cycle of templates on server, and then how you merge client side template with what server side rendered.

Also #26 is needed.

@mave99a
Copy link

mave99a commented Mar 8, 2017

Thanks @mitar for the clarification!

@janat08
Copy link

janat08 commented Jul 25, 2017

@janat08
Copy link

janat08 commented Jul 25, 2017

Comment belongs in SSR given package description, so duplicating it there.

@marcoschwartz
Copy link

I was one of the people complaining on the Meteor forum actually :) For now I still don't see how to use server-render with Blaze & iron-router

@juho
Copy link

juho commented Mar 3, 2018

Hey, I'd like to start checking this out as we'll need SSR and are on Blaze for the foreseeable future.

@mitar, could you help out with finding the right places to look at to begin with? I haven't done much with the compiler before and am prepared to dive in, but the whole build plugin lifetime is a bit of a mystery still to me. Not sure which parts should be changed and how they function together and I think writing about it would help a few others as well.

Are some of these completed?

Some things to change:

- web-only architecture should be removed
- Template.body.renderToDocument noop on the server
- head tag should not be processed on the server, see #167

@filipenevola
Copy link
Collaborator

I'm closing this issue because it's too old.

If you think this issue is still relevant please open a new one.

Why? We need to pay attention to all the open items so we should keep opened only items where people are involved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Blaze development
Planned – server-side
Development

No branches or pull requests

7 participants