Replies: 0 comments 8 replies
-
This seems like a quite hard question to answer directly. Could you make a setup we can try out things in? What kind of setup do you have to eventually render the react app? |
Beta Was this translation helpful? Give feedback.
-
I have React components are rendered with I will create a setup right now. |
Beta Was this translation helpful? Give feedback.
-
Since ExecJS doesn't support modules, I'd be surprised if it's possible this way, but interested to see what you have so far |
Beta Was this translation helpful? Give feedback.
-
Here is a demo setup : https://github.com/babgyy/ssr-instantsearch-rails I documented a bit how to setup and how to make it fail. As soon as I added a facet search, the feeding of React Instantsearch with JSON results from ruby began to fail. Activating SSR just produces the error sooner but fails the same way.
In my understanding, Webpack & Babel handle modules and produce a JS edible by ExecJS |
Beta Was this translation helpful? Give feedback.
-
Any opinion on this ? |
Beta Was this translation helpful? Give feedback.
-
Can you show where in that repository the SSR is actually happening? Note that for |
Beta Was this translation helpful? Give feedback.
-
Sure, as stated in the Argument section, SSR is handled by the For more details on how this is all passed to ExecJS, we would have to drill into the implementation of the gem. Not uninteresting but irrelevant to this question in my opinion
Precisely my point :) I understand that
|
Beta Was this translation helpful? Give feedback.
-
I recommend using node for server side rendering in general, you'll have a lot less headaches, and will always fit in the "simple path" of server side rendering. You can set up the server for server side rendering separately from your other backend easily. |
Beta Was this translation helpful? Give feedback.
-
I use React-Instantsearch with a Ruby on Rails backend. I would like to have the initial view rendered server-side for SEO reasons. But I can't find a way to make it work.
I can easily make an Algolia query server-side in ruby, get a JSON payload from the
algoliasearch-rails
gem with theraw_result
method, however this does not work when given as aresultsState
prop to InstantSearch.Somebody had this same question 2 years ago. But I feel a lot of work has been done by Algolia since then to make this possible. Is it ?
How would you suggest doing SSR without
Is there a way to use
findResultsState
in my context ?Is there any clear schema documentation for the
resultsState
prop ?I have read InstantSearch's documentation of resultsState props that recommends to use
findResultsState
. Does this method have a Ruby / Rails equivalent ?I have read the Server side rendering guide but it assumes I have a JS backend.
Any directions would be appreciated
Beta Was this translation helpful? Give feedback.
All reactions