-
Notifications
You must be signed in to change notification settings - Fork 3
SSR Status #420
Comments
For the code splinter and SSR of Meteor, an official solution is expected |
Hi @Saeeed-B what specific issues are you having with Meteor and SSR? I mean, issues, bugs, problems. For example, I just search on Google and I found this repo https://github.com/juliancwirko/scotty and I just updated bcrypt and it's working for me. I know it's not updated but if it was working on METEOR@1.6.1.1 I believe it is still working in Meteor 1.12.1. What I think you are saying as "not working" actually you mean that we don't have up-to-date examples and education resources. Is that what you mean? I know of some members in the community interested and probably using Meteor with SSR like Kevin Newman and The Spider. We even have this item in our Roadmap https://github.com/meteor/meteor/blob/devel/Roadmap.md#ssr-documentation specifically for SSR documentation (@CaptainN @eric-burel) but it didn't move forward as we were expecting then we need to restart this work. Let's list here what are the items that we need to work on and then we can move forward. |
@filipenevola Hi 1. Do not support data subscription Server-side rendering should be flawless and transparent, with data support embedded in the meteor core. @CaptainN I think you have made a lot of efforts in this regard, thank you, explain the issue in detail |
Until this one is resolved I'd be happy to help with SEO using pre-rendering service. P.S. yes, I'm affiliated with posted link. |
@dr-dimitru I also use prerender now, but I believe the software should be integrated and have few external dependencies. |
@Saeeed-B no worries, and thank you for sharing your vision. I won't jump in this thread unless you mentioned SEO. True, for other purposes proper SSR can get handy. I tired and comprehensively tested SSR in all major JS frameworks with purpose of SEO, unless it's based on rendering JS-pages to HTML, it won't serve SEO needs. |
For information we worked out with another member from the meteor forums a SSR boilerplate with Meteor/React/Apollo/React-Helmet-Async/React-Router/Styled-Component, all the latest libraries: |
@Saeeed-B supporting
Implementing a quick fix like this on the core to support ssr for |
@nathanschwarz Finally, this offer must be tested in the subscription method itself. |
@Saeeed-B If you want SSR you have no other choice, basically all the data on the first load is passed to the client as a string... So you must have all the data in hand before sending the response to the client (so you can't send a cursor).
that's just what I said...
meaning, modifying the publication/subscription methods... |
@filipenevola |
Need an example of code splitting, in your near-perfect project go |
So, I've been thinking on how exactly the implementation should go, and I think we should go for an So if
On the client :
Maybe implementing a sort of serializeable |
@Saeeed-B you can easily add a Meteor.subscribe on the server, and wrap Meteor.publish on the server to do what you exactly want. |
@pjsofts |
@filipenevola One of the most important reasons for ssr is that it greatly reduces the initial response time of the server. |
Hello, @Saeeed-B. In the server, you call:
This will preload your minimongo on each page load with the array of cursors you return there. Also, this.userId and Meteor.user() are available inside this function. Minimongo is automatically filled. Let me know if this does work for you and for others. A complete SSR solution, as proposed by @nathanschwarz would be really good, but I think this can do for now. It's also possible to return data based on routes. At least, it solved for us ;) |
@renanccastro If your package can provide data based on subscriptions, then it will good work |
In general, the package that wants to provide data on the server side must be fully compatible with the Meteor kernel, including the publishing and subscription system. |
It's another approach. If you are using a SPA, you can't have server-side routing, unless you are doing a full SSR with react or something alike. In this case, It's also possible to use my package to get the right data, as you do have access to the current route being accessed, and then it's only a matter of returning the right cursors. |
Hi, lately I've been focused more on static + SSR rendering for authenticated apps, so I am not sure I can be of any help with Meteor specifics (I use graphql as my data layer), but I'll try to give a few insights. Rendering subscriptions during SSR feels problematic to me, because subscriptions are per design a client-side feature. If you really need to have some data rendered during SSR, maybe "duplicate" your subscription logic: write a method that fetches a first set of data, without subscription, and then rely on subscription client side. More broadly, I am not eager to automatically render data during SSR. Nowadays, the trend is instead to prefill caches, send the cache, and let the client actually render the data. Loading all data at once is often more costly (and thus damaging for SEO) than loading client-side. During SSR, you can instead focus on rendering page skeleton and actual static content + prefilling caches. Very theoretical, sorry in advance if it's not actionnable for your use cases |
@nathanschwarz We really need to do a strong test, thank you very much if you can let us know the result. |
I have said this elsewhere, perhaps it is worth further investigation. This is how my subscriptions work:
Client StartUp :
Server StartUp :
But the result is amazing, so I see that all the data is also rendered on the server and rendered in the view page source. However, the case should have been the opposite and all components were rendered without data I have no explanation for exactly what is happening. @CaptainN If you have an explanation thank you, join us, maybe this is the perfect ssr solution |
@nathanschwarz @CaptainN Have you seen my experience too? Right now it is working well at the following address, that is, with the combination I mentioned above, the data is also rendered on the server : |
Hello everyone, do not be tired.
Due to that, the server rendering package is incomplete.
1. Cannot subscribe to data
2. Cannot render based on user login status
Also, the packages included in this to solve these problems are incomplete:
1. They are no longer supported.
2. And they can not be used with the current situation, that is, they have many bugs.
I ask this question on behalf of many people, does meteor have a plan to solve this problem?
Does it intend to solve this problem from within and not pass users to incomplete packages?
I think after all these requests, we have the right to receive a clear answer.
The text was updated successfully, but these errors were encountered: