Solved

Converting My Node-React Multi-Page Server-Side Rendered (SSR) App To Turbo-Links

tomadelaney
Shopify Partner
14 2 2

I recently upgraded my Node-React multi-page server-side rendered (SSR) app to use session token-based authentication.
I can run each (of several) pages of my app individually as a single-page embedded app on Shopify, but I'd like to run all of my pages within
the Shopify Embedded App using the new session tokens approach.

Two questions: 

1) Is Turbolinks still the recommended approach, or should we be using the newer hotwired/turbo library?

2) Is there a node-react sample application available that uses either the Hotwired Turbolinks or Turbo library to build an embedded SSR app that supports session tokens?

Thanks for your help,

Tom

Accepted Solution (1)

awwdam
Shopify Staff
249 42 36

This is an accepted solution.

Hey @tomadelaney,

Great questions here! Most of the time I would consider a 'recommended approach' more about opinion that can greatly vary from developer to developer based on comfort level, the stack being used in a current build, etc. Understandably examples, official libraries, and documentation can play a large part in decisions to use one tool or library over another. While the following resources both utilize and reference a Rails app, these are the most relevant docs we provide around this development topic at the moment:

Overview: Authenticate a server-side rendered embedded app using Rails and Turbolinks
 
Sample server-side rendered Rails app converted using Turbolinks.



Beyond that, do keep an eye out for replies or related posts from others in the community that may have additional insights or suggestions. Happy developing and hope this offers a starting point  - Cheers! 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)

awwdam
Shopify Staff
249 42 36

This is an accepted solution.

Hey @tomadelaney,

Great questions here! Most of the time I would consider a 'recommended approach' more about opinion that can greatly vary from developer to developer based on comfort level, the stack being used in a current build, etc. Understandably examples, official libraries, and documentation can play a large part in decisions to use one tool or library over another. While the following resources both utilize and reference a Rails app, these are the most relevant docs we provide around this development topic at the moment:

Overview: Authenticate a server-side rendered embedded app using Rails and Turbolinks
 
Sample server-side rendered Rails app converted using Turbolinks.



Beyond that, do keep an eye out for replies or related posts from others in the community that may have additional insights or suggestions. Happy developing and hope this offers a starting point  - Cheers! 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

tomadelaney
Shopify Partner
14 2 2

Thanks for getting back to me, Awwdam.

For the time being, I've moved all of my page navigation into index.js, using React states to simulate routing.
This is not the most efficient approach, but the SSR approach with Rails & Turbolinks probably won't work
in my case (or for the general world of Node developers). 

I do like what Shopify has done with its move to JWT, and believe this was a necessary and important advancement.
It will benefit the Node development community if Shopify does publish a best practice approach for SSR / Node / React.

Best regards,
Tom