Repository navigation
Stop passing format: :html to the Ember app route - #700
Merged
Merged
Conversation
Rails ignored a Symbol `format:` until rails/rails#59418, which turns it into a format requirement with `html` as the default. With that, the `(*rest)` glob of the route `mount_ember_app` draws swallowed the extension of an asset path such as `/assets/app.js`, the request's format became `html`, and `EmberConstraint` let it through, so assets were answered with the application's `index.html` instead of reaching the mounted `Rack::Files` or the development server proxy. The option has been a no-op on every Rails version the helper ran on until now, so dropping it keeps their behaviour and restores it on Rails main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The experimental Rails main job has been failing since 2026-11-01 (hidden by
continue-on-error) with 8 failures, all of them asset requests answered with the Ember app's HTML.Cause
rails/rails#59418 makes a Symbol
format:route option take effect: it used to fall throughnormalize_formatand be ignored, and now becomes a format requirement withhtmlas the default.mount_ember_apphas passedformat: :htmlto its(*rest)route since the helper was introduced. With the option now honoured, a path such as/assets/app.jsmatches that route asrest: "assets/app.js", format: "html",EmberConstraintsees an HTML request, and the request never reaches the mountedRack::Filesor the development server proxy.Fix
Drop
format: :html. It was a no-op on every Rails version until now, so released Rails keeps its behaviour and Rails main gets the previous behaviour back.Verification
In Docker (Ruby 4.0, Node 26),
rspec --tag ~js:f1e1f3c): the 4 previously failing request specs passThe only failure left in both is
EmberCli::App#test, which needs Chrome, which the container lacked. The browser feature specs weren't run locally; CI covers them.🤖 Generated with Claude Code