Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significant refactor of the Routes plugin #882

Merged
merged 5 commits into from
Apr 23, 2024
Merged

Conversation

jaredcwhite
Copy link
Member

@jaredcwhite jaredcwhite commented Apr 15, 2024

There was some not-particularly-attractive code lurking in the file-based routes plugin. It had been brute-forced to work, and then didn't receive the necessary spit 'n' polish it deserved. This PR provides that.

  • More modular and OOP-like code
  • Better Roda plugin layout
    • We're not using Roda's before hook anymore, which means end-user developers can leverage it if they so choose
  • Downstream plugins can leverage file-based routing themselves
  • Dynamic index route is now supported instead of static index.html

That last one is huge, as it means a Bridgetown + Roda site could effectively be a completely dynamic Ruby application! And it closes #736.

Also moved previously monkey-patched Roda Public code into a streamlined standalone SSG plugin (to be extracted out later — it's really just a small wrapper around Rack::Files as was the earlier Public plugin), and now it's serving static index.html using the same Rack::Files server.

- More modular and OOP
- Better Roda plugin layout
- Dynamic `index` route now supported instead of static index.html
- Downstream plugins can leverage file-based routing themselves
Copy link

render bot commented Apr 15, 2024

Copy link

render bot commented Apr 15, 2024

@jaredcwhite jaredcwhite added the SSR Dynamic rendering of Bridgetown pages label Apr 15, 2024
@jaredcwhite jaredcwhite added this to the 2.0 milestone Apr 15, 2024
@jaredcwhite
Copy link
Member Author

I should mention here: a longer-term goal is to extract most of this functionality out into a standalone Roda plugin which would be view layer-agnostic, so it could work even with Roda's own render plugin. Then any Roda app developer could leverage the file-based routing convention.

@jaredcwhite jaredcwhite merged commit 24b39fa into main Apr 23, 2024
3 checks passed
@jaredcwhite jaredcwhite deleted the refactor-routes-manifest branch April 23, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SSR Dynamic rendering of Bridgetown pages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSR Home page (index.html)
1 participant