Deploying a dynamic Redwood site on render.com

Hey @eraoul, welcome to Redwood!

When we say “static”, what we mean is “does this run any code in a server”. Right now, the answer to that is no - a RedwoodJS app is still a SPA (SPA (Single-page application) - MDN Web Docs Glossary: Definitions of Web-related terms | MDN). What this means is that the front end of your app is basically Javascript files that mutate the web page using a virtual DOM (React Virtual DOM Explained in Simple English - Programming with Mosh).

If you look at your website in the developer console, you’ll see that your entire site is being rendered in a div with id="redwood-app". Everything inside of this div is basically controlled by client-side Javascript - everything outside of it is static. In fact, if you disable javascript and reload the page, you’ll see…nothing. Your site will not render at all, and the DOM will look like this:

In terms of the rewrite rules, there’s two things going on:

  • The API route rewrite - this is primarily to bypass CORS issues. The docs has a great interlude on this.
  • The index.html one - this is related to the above stuff about the virtual DOM. Your website really only ships the one html file - if you go to your site’s build output, you’ll see only index.html.

It’s worth noting that in v7 of Redwood, this may be changing with the adoption of React Server Components - you can start your journey down that rabbit hole with @thedavid’s recent post: Bighorn Epoch Updates (aka the React Server Components roadmap)

1 Like