Skip to content

feat: migrate to zeitwerk#878

Merged
gildesmarais merged 9 commits intofeat/revamp-frontendfrom
feat/zeitwerk-roda-loader
Mar 15, 2026
Merged

feat: migrate to zeitwerk#878
gildesmarais merged 9 commits intofeat/revamp-frontendfrom
feat/zeitwerk-roda-loader

Conversation

@gildesmarais
Copy link
Copy Markdown
Member

@gildesmarais gildesmarais commented Mar 15, 2026

This pull request introduces a major refactor of the backend code structure to adopt the Zeitwerk autoloader, improves backend maintainability, and updates development and linting workflows. It removes manual requires and directory-specific namespace wiring, reorganizes files under the app/web/** directory, and ensures that all code is autoloaded in a consistent, Rails-like fashion. Additionally, it adds a Zeitwerk eager-load check to the linting process and updates documentation accordingly. Several files are renamed or removed to reflect the new structure, and some error-handling and validation logic is refactored for clarity and consistency.

Backend autoloading and structure improvements:

  • Introduced the zeitwerk gem and removed the rack-unreloader gem, enabling Zeitwerk-based autoloading for backend code under the Html2rss::Web namespace, and updated app.rb to use Html2rss::Web::Boot for setup and eager loading. [1] [2]
  • Moved backend files into the app/web/** directory to match Zeitwerk's expectations, and removed manual require statements in favor of autoloading. [1] [2] [3] [4] [5] [6] [7]

Development and linting workflow updates:

  • Added a Zeitwerk eager-load verification task (rake zeitwerk:verify) to the Makefile linting process and as part of make ready, ensuring loader drift is caught early in development. [1] [2] [3]

Error handling and validation refactoring:

  • Updated error handling in API modules to reference error classes via the fully qualified Html2rss::Web namespace, and refactored validation logic in CreateFeed for clarity and maintainability. [1] [2] [3] [4] [5]

Roda plugin and middleware changes:

  • Added the :head and :not_allowed plugins to Roda configuration, improving HTTP method handling.

Documentation updates:

  • Updated README.md to explain the new backend file structure, Zeitwerk integration, and contributor guidelines for backend code placement.

@gildesmarais gildesmarais marked this pull request as ready for review March 15, 2026 09:43
@gildesmarais gildesmarais merged commit 85ab667 into feat/revamp-frontend Mar 15, 2026
5 of 8 checks passed
@gildesmarais gildesmarais deleted the feat/zeitwerk-roda-loader branch March 15, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant