Skip to content

Add Rails engine support to UrlHelpers compiler#2632

Open
bdewater-thatch wants to merge 1 commit into
Shopify:mainfrom
thatch-health:url-helpers-engine-support
Open

Add Rails engine support to UrlHelpers compiler#2632
bdewater-thatch wants to merge 1 commit into
Shopify:mainfrom
thatch-health:url-helpers-engine-support

Conversation

@bdewater-thatch
Copy link
Copy Markdown
Contributor

Motivation

Discover Rails engines during URL helper generation and register their engine-scoped path and URL helper modules. Fixes #474

Generate mounted helper RBIs for engine mount points, including typed routes proxy classes that include the engine helper modules. Add mounted helper mixins only for classes/modules that actually receive Rails' mounted helpers, and cover the new behavior with regression tests.

Implementation

AI assisted with manual refactoring + testing on our own app.

@bdewater-thatch bdewater-thatch requested a review from a team as a code owner May 25, 2026 15:14
@bdewater-thatch bdewater-thatch force-pushed the url-helpers-engine-support branch from 5dab70a to 33f1327 Compare May 25, 2026 15:39
Copy link
Copy Markdown
Contributor

@KaanOzkan KaanOzkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks fine to me but as someone without much context on the compiler it was difficult to wrap my head around it. I have some suggestions on how to improve maintainability. Curious to hear if you have more ideas.

Comment thread lib/tapioca/dsl/compilers/url_helpers.rb Outdated
Comment thread lib/tapioca/dsl/compilers/url_helpers.rb Outdated
Comment thread lib/tapioca/dsl/compilers/url_helpers.rb
Comment thread lib/tapioca/dsl/compilers/url_helpers.rb
Comment thread lib/tapioca/dsl/compilers/url_helpers.rb
Comment thread lib/tapioca/dsl/compilers/url_helpers.rb
@KaanOzkan KaanOzkan added the enhancement New feature or request label Jun 4, 2026
@bdewater-thatch bdewater-thatch force-pushed the url-helpers-engine-support branch from 33f1327 to 006de5e Compare June 4, 2026 17:00
Discover Rails engines during URL helper generation and register their engine-scoped path and URL helper modules.

Generate mounted helper RBIs for engine mount points, including typed routes proxy classes that include the engine helper modules. Add mounted helper mixins only for classes/modules that actually receive Rails' mounted helpers, and cover the new behavior with regression tests.
@bdewater-thatch bdewater-thatch force-pushed the url-helpers-engine-support branch from 006de5e to e96f1f5 Compare June 4, 2026 19:25
@bdewater-thatch
Copy link
Copy Markdown
Contributor Author

@KaanOzkan addressed your feedback, PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make UrlHelpers generator Rails Engine aware

2 participants