<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="135187" data-post-id="135187">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<blockquote>
<p>SSR because I want to have offline support</p>
</blockquote>
<p>SSR isn’t a prerequisite for offline support.</p>
<p>Offline support is accomplished via <a href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker" rel="noopener nofollow ugc">Service Workers</a>. Now in the simplest case a Service Worker can cache responses which could be rendered pages but client side JavaScript can be cached as well. With an SPA you would tend to also use <a href="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API" rel="noopener nofollow ugc">IndexedDB</a> (<a href="https://github.com/jakearchibald/idb" rel="noopener nofollow ugc">with Promises</a>) to stash some data for offline use.</p>
<p>Have a look at<br>
<a href="https://codelabs.developers.google.com/dev-pwa-training/" class="inline-onebox" rel="noopener nofollow ugc">Progressive Web Apps: Going Offline &nbsp;|&nbsp; Google for Developers</a><br>
<a href="https://developers.google.com/training/courses/progressive-web-apps" class="inline-onebox" rel="noopener nofollow ugc">Gemini-powered solutions | Google for Developers</a><br>
<a href="https://youtu.be/psB_Pjwhbxo?list=PLNYkxOF6rcIB2xHBZ7opgc2Mv009X87Hh" rel="noopener nofollow ugc">https://youtu.be/psB_Pjwhbxo?list=PLNYkxOF6rcIB2xHBZ7opgc2Mv009X87Hh</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135187" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-phoenix-api-be-integrated-directly-into-nextjs/23753/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-135187" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135187"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-solved cat-solved" title="Marked as solution"></div>
  </section>
</div>
    <div class="postbit" id="135188" data-post-id="135188">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="wolfiton" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wolfiton/120/15884_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  wolfiton
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you very much for showing me this link.</p>
<p>Also wanted to ask about SEO with this approach, is it seo friendly?</p>
<p>After watching a couple of videos, I understood that this doesn’t influence SEO just adds the service worker ability to the website.</p>
<p>This handles:</p>
<ul>
<li>offline support</li>
<li>home screen instalation</li>
<li>and a lot more</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135188" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-phoenix-api-be-integrated-directly-into-nextjs/23753/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-135188" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135188"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="135190" data-post-id="135190">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>As far as I know server rendered pages are preferred for SEO. And while Google can process some JavaScript they only recently switched from Chrome 41 (2015) to 74.</p>
<p>This might be a good starting point for understanding some of the issues:<br>
<a href="https://www.onely.com/blog/ultimate-guide-javascript-seo/" rel="noopener nofollow ugc">https://www.onely.com/blog/ultimate-guide-javascript-seo/</a></p>
<p>A PWA doesn’t need to be an (SSR) SPA (the <a href="https://developers.google.com/web/fundamentals/architecture/app-shell" rel="noopener nofollow ugc">App Shell Model</a> created this confusion) - it is entirely possible to build a PWA where the page is rendered with EEx - but it’s the responsibility of the JS delivered with those pages to enable the PWA functionality on the browser end:</p>
<aside class="quote no-group">
<blockquote>
<ul>
<li><a href="https://developers.google.com/web/progressive-web-apps/#reliable" rel="noopener nofollow ugc"> <strong>Reliable</strong> </a> - Load instantly and never show the downasaur, even in uncertain network conditions.</li>
<li><a href="https://developers.google.com/web/progressive-web-apps/#fast" rel="noopener nofollow ugc"> <strong>Fast</strong> </a> - Respond quickly to user interactions with silky smooth animations and no janky scrolling.</li>
<li><a href="https://developers.google.com/web/progressive-web-apps/#engaging" rel="noopener nofollow ugc"> <strong>Engaging</strong> </a> - Feel like a natural app on the device, with an immersive user experience.</li>
</ul>
</blockquote>
</aside>
<p>… that doesn’t automatically imply SPA. PWAs are supposed to extend “<a href="https://alistapart.com/article/understandingprogressiveenhancement/" rel="noopener nofollow ugc">Progressive Enhancement</a>”:</p>
<ol>
<li>Content is the foundation</li>
<li>Markup is an Enhancement (HTML)</li>
<li>Visual Design is an Enhancement (CSS)</li>
<li>Interaction is an Enhancement (ECMAScript)</li>
<li><strong><em>Network is an Enhancement</em></strong> (<a href="http://offlinefirst.org/" rel="noopener nofollow ugc">Offline first</a>)</li>
</ol>
<hr>
<p><a href="https://love2dev.com/blog/pwa-spa/" rel="noopener nofollow ugc">https://love2dev.com/blog/pwa-spa/</a><br>
<a href="https://love2dev.com/blog/yes-fast-food-frameworks-cost-too-much/" rel="noopener nofollow ugc">https://love2dev.com/blog/yes-fast-food-frameworks-cost-too-much/</a><br>
<a href="https://love2dev.com/blog/large-javascript-frameworks-are-like-fast-food-restaurants/" rel="noopener nofollow ugc">https://love2dev.com/blog/large-javascript-frameworks-are-like-fast-food-restaurants/</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135190" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-phoenix-api-be-integrated-directly-into-nextjs/23753/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-135190" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135190"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="135191" data-post-id="135191">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="wolfiton" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/wolfiton/120/15884_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  wolfiton
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thank you very much for this information I will take my time reading through everything you given me.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="135191" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-phoenix-api-be-integrated-directly-into-nextjs/23753/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-135191" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="135191"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="198670" data-post-id="198670">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Sleepful" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Sleepful/120/21282_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Sleepful
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You would need to use both, nextjs and phoenix as the API. You would call the phoenix API inside <a href="https://nextjs.org/docs/basic-features/data-fetching#getserversideprops-server-side-rendering" rel="noopener nofollow ugc">getServerSideProps</a>… I <em>guess</em>. I found this related github repo <a href="https://github.com/valo/phoenix_with_nextjs" class="inline-onebox" rel="noopener nofollow ugc">GitHub - valo/phoenix_with_nextjs: An app template which used Phoenix for API and next.js for rendering frontend with server side rendering · GitHub</a></p>
<p>It sounds like a lot of work, and fun too.</p>
<p>I think ReactDOMServer is typically used with NodeJs because it is JavaScript code, React being a JavaScript library, so it integrates easily into NodeJs. I think there is nothing wrong with using ReactDOMServer to accomplish the same goals that NextJs seeks out to accomplish. I <em>believe</em> the difference is that NextJs seeks to make it really simple by handling all the SSR parts with high optimization and automagically for you (hydration, routing, client state).</p>
<p>CMIIW.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="198670" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/can-phoenix-api-be-integrated-directly-into-nextjs/23753/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-198670" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="198670"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>