Coder Social home page Coder Social logo

Server Side Rendering (SSR) about mantra HOT 20 OPEN

kadirahq avatar kadirahq commented on June 26, 2024
Server Side Rendering (SSR)

from mantra.

Comments (20)

natecox avatar natecox commented on June 26, 2024

@arunoda I think I'm behind the times here. Can you give me a link to the references you're using for Meteor 1.3's structure?

from mantra.

arunoda avatar arunoda commented on June 26, 2024

You mean this one? https://github.com/mantrajs/mantra-sample-blog-app

from mantra.

natecox avatar natecox commented on June 26, 2024

@arunoda no, sorry, in reference to Meteor 1.3 itself. From a few comments made it seems like Meteor 1.3 is making changes to the directory structure, but I haven't been able to find a good explanation of what those are yet.

from mantra.

arunoda avatar arunoda commented on June 26, 2024

Check this: https://atmospherejs.com/meteor/modules

from mantra.

natecox avatar natecox commented on June 26, 2024

ah! Yes, that'll do. I'll explore that and then come back to this with a more informed opinion.

from mantra.

achtan avatar achtan commented on June 26, 2024

what's new with the SSR, now as we put our modules into /imports does this solve our problem with SSR?

or what is the issue with SRR?

from mantra.

arunoda avatar arunoda commented on June 26, 2024

Actually, now we've come back to the client directory.
See: mantrajs/mantra-sample-blog-app@1a2ecbc

There are some ways. We'll take care of this after the module release coming on Monday.

from mantra.

arunoda avatar arunoda commented on June 26, 2024

Note:

Here with SSR, we need to create a context from the scratch for every request. We need to find a way to deal with that.

Otherwise, this will lead to race conditions and other issues.

from mantra.

achtan avatar achtan commented on June 26, 2024

@arunoda any update on this one?

from mantra.

tonyxiao avatar tonyxiao commented on June 26, 2024

Was playing around with this. Naively loading mantra modules on the server doesn't work due to things like method_stubs and use of Meteor.[user|subscribe] methods inside containers and actions. To support SSR will some explicit effort.

from mantra.

natecox avatar natecox commented on June 26, 2024

I'm coming to the conclusion that SSR is a pain in the ass in general. I just had an issue on a large project where SSR would fail because the components being rendered used libraries like GoogleMaps from atmosphere, with the code exported to use client only... meaning it just wasn't there on the server side render and everything failed horribly. Same type of issue with Redux.

My solution was to write a router specifically for the server and just serve simple pages. Works fine for opengraph, not nearly as good for actual SEO.

from mantra.

SachaG avatar SachaG commented on June 26, 2024

@natecox I feel like it's fine to use the No-SSR packages for cases like this? Personally so far I've found SSR to work pretty well (although it's in a non-Mantra app).

from mantra.

natecox avatar natecox commented on June 26, 2024

@SachaG That's actually pretty cool, I hadn't seen that one yet. Not sure it solves the issues I was having with Redux, because that's so tightly coupled with global state, but that's probably more to do with the fact that I added Redux late into the project and it's probably not set up optimally.

from mantra.

tonyxiao avatar tonyxiao commented on June 26, 2024

Oh No-SSR that's a really clever package. Yea right now I'm using https://github.com/thereactivestack/meteor-react-router-ssr as an example to inject OpenGraph meta tags into pages served by meteor. Quite a hack but does get the most important use case covered.

from mantra.

natecox avatar natecox commented on June 26, 2024

@tonyxiao I'm probably going to have to do the same thing on my project now. Any advice on getting it implemented properly and converting from FlowRouter?

from mantra.

tonyxiao avatar tonyxiao commented on June 26, 2024

@natecox Here I just created it gist - https://gist.github.com/tonyxiao/92e3d994eec0d762a17e. It's a real hack but if @eXon uses it it must be ok.

from mantra.

tonyxiao avatar tonyxiao commented on June 26, 2024

I ended up converting from FlowRouter to ReactRouter due to the tighter integration with react ecosystem. Was a bit painful but took one day in total so not too bad. Biggest gotcha was that you can't just pass any props into component rendered by ReactRouter. That required architecting components a bit differently. (Mapping more closely to pages if you want to parse the params). Anyways that's probably off topic so I'll stop here.

from mantra.

achtan avatar achtan commented on June 26, 2024

I think ill just use spiderable for now

from mantra.

rvetere avatar rvetere commented on June 26, 2024

Any updates on the general SSR topic for mantra @arunoda? ;)

from mantra.

bompi88 avatar bompi88 commented on June 26, 2024

+1 This would be a really nice feature

from mantra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.