meteor-blaze-components
meteor-blaze-components copied to clipboard
Server side rendering
Preliminary testing looks pretty promising. Many tests are already passing. It seems that if the author is precise how they define components, things work. So no jQuery changes of DOM, and state local to the component instance, without global state.
This pull request would help that we do not have to copy too much code from the templating package: https://github.com/meteor/meteor/pull/5903
Some questions with server side rendering:
- ~~what to do with
*.htmlfiles which add things to<head>and<body>~~ - can we use this for spiders?
- and that content is rendered on the server, send to the client, and then replaced with the client dynamic version?
- how to integrate routing, how to support rendering without routing?
- when rendering the page, how to know what should be the value of
Meteor.userId() - what to do with subscriptions from the component? should we just make
component.subscribeimmediately return, be a no-op, and pretend it is subscribed? how do we provide then things like subscription scope? also, publish functions tend to limit the fields available to the client, and client might assume that no extra fields are available and render everything available, with no-op implementation of subscribe, all fields would be available and this might reveal sensitive information (imagine a component which simply callsEJSON.stringifyon documents)
I have a general question about SSR in Meteor in combination with BlazeComponents.
Let's say I have a shop and want everything to be static (SSR or Caching p.e. thru Ngnix), except the "add-to-shopping-cart"-functionality and "your-last-viewed-products-history"-functionality.
How would you approach this as a pro? is this currently possible in Meteor at all?
Not really sure. I have not looked yet much into server-side rendering.
I created a topic for discussion on https://forums.meteor.com/t/ssr-rendering-wholepunching/20680