Skip to content

Render what ember-cli-rails reports about a built application - #42

Draft
tricknotes wants to merge 12 commits into
mainfrom
claude/intelligent-goodall-foai0r
Draft

tricknotes wants to merge 12 commits into
mainfrom
claude/intelligent-goodall-foai0r

Conversation

@tricknotes

@tricknotes tricknotes commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Why

The helpers derived a built application's layout for themselves: the assets directory, the index.html that refers to it, the package.json that names it, and whether the build is Vite-based.

ember-cli-rails runs the build and reports all of it.
Deriving it twice meant the two could disagree — the Vite check here looked for a module script in the generated index.html, while ember-cli-rails reads the configuration file at the application's root.

It also meant this gem tracked EmberCli::App closely while never declaring that it needed it, which is why it feature-detected the development server with respond_to?(:dev_server?).

Depends on tricknotes/ember-cli-rails#687, which adds the API this renders and drops the dependency in the other direction.
Bundler refuses to resolve a dependency that points both ways, so that has to land first.

What

Read the application through EmberCli::Embedding from ember-cli-rails instead of deriving it:

  • #startup_tags? in place of the local Vite check and the development server feature detection
  • #startup_tags(prepend:) in place of extracting the boot tags of a Vite build
  • #javascript_assets(prepend:) and #stylesheet_assets(prepend:) in place of the local asset-map lookup

Apart from that, the helpers call only EmberCli[name] and EmberCli::App#build.

prepend goes to those readers rather than being joined on here, because which URLs it applies to is something ember-cli-rails decides: it mounts the build output, so it does not apply to an asset served from a CDN or a font service.

EmberCli::Assets::Paths, Lookup, AssetMap, DirectoryAssetMap and Url are removed, as is EmberCli::Assets::BuildError — a missing or unresolvable asset now raises EmberCli::BuildError.
The helpers are left with the one job they have: turning what ember-cli-rails reports into tags.

The dependency on ember-cli-rails is declared, so the development server no longer needs feature detection, and nokogiri is no longer a direct dependency.

The feature suite now builds a Vite application by default.
It used to build only a classic one and leave the Vite path to a scenario in ember-cli-rails that no longer renders the helpers, so nothing booted a Vite build from them any more.
bin/setup builds the dummy application from the Vite-based blueprint (ember-new-output v7.0.0) by default, and from the last Broccoli-based release with EMBER_BUILD=classic, as CONTRIBUTING.md describes.

CI follows the same default:

  • every Ruby and Rails combination runs against the Vite build, including Ruby 4.0 with Rails 7.2, 8.0 and 8.1, on Node 26
  • the classic build runs at both ends of the supported range, Ruby 3.2 with Rails 7.0 on Node 20, and Ruby 4.0 with Rails 8.1 on Node 26
  • jobs are named after what each version is for, as in build (Ruby 4.0, Rails 8.1), with classic added to the classic ones

Compatibility

EmberCli::Assets::Paths, Lookup, AssetMap, DirectoryAssetMap, Url and EmberCli::Assets::BuildError were public constants.
Anything referencing or rescuing them needs updating; ember-cli-rails documents the replacements in its UPGRADING.md.

CI job names change, so any required status check that names a job has to be updated to the new name.

Open before release

Testing

Comment thread spec/helpers/ember_cli_rails_assets_helper_spec.rb Outdated
@tricknotes
tricknotes force-pushed the claude/intelligent-goodall-foai0r branch from 9f73e58 to dea00b8 Compare September 18, 2026 00:49
The helpers derived a built application's layout for themselves: the `assets`
directory, the `index.html` that refers to it, the `package.json` that names it,
and whether the build is Vite-based.
ember-cli-rails runs the build and reports all of it, so read it from there
instead of deriving it again.

This removes `EmberCli::Assets::Paths`, `Lookup`, `AssetMap` and
`DirectoryAssetMap`, along with the Vite check that disagreed with the one
ember-cli-rails applies, and leaves the helpers with the one job they have:
turning what it reports into tags.

The helpers have always required ember-cli-rails at runtime without saying so,
which is why they feature-detected its development server.
Declare the dependency instead, on the release that reports a built application.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The declared dependency names a release that does not exist yet, so CI cannot
resolve it.
Point the Gemfile at the branch adding the API until that release is published.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The constraint named a release that does not exist.
Name it once the release that reports a built application is published.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Later keywords win, so the caller's stubs override the defaults without
building a Hash to merge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tricknotes
tricknotes force-pushed the claude/intelligent-goodall-foai0r branch from dea00b8 to 49a1747 Compare September 18, 2026 01:21
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tricknotes
tricknotes force-pushed the claude/intelligent-goodall-foai0r branch from 3a781d1 to 5fdb41c Compare September 26, 2026 02:19
The feature suite built only a classic application, and left the Vite path of
`include_ember_script_tags` to a scenario in ember-cli-rails that no longer
renders the helpers.
Nothing booted a Vite build from them any more.

`EMBER_BUILD=vite` builds the dummy application from the Vite-based blueprint
instead, and one CI job runs the feature suite against it.
The views call `include_ember_stylesheet_tags` for a classic build only, as a
Vite build refuses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ember-cli-rails reports what a built application boots from through `EmberCli::Embedding` instead of `EmberCli::App`, and decides whether it boots from startup tags, so the helpers no longer combine `dev_server?` and `vite?` themselves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tricknotes
tricknotes force-pushed the claude/intelligent-goodall-foai0r branch from 87be792 to 3a9d263 Compare September 26, 2026 07:41
`ember-cli >= 6.8` generates Vite-based applications, so `bin/setup` builds the dummy application that way unless `EMBER_BUILD=classic` asks for the Broccoli-based one.
CI names the build of every job explicitly, so its jobs are unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Ruby and Rails combination now runs the suite against the Vite-based build, which `ember-cli >= 6.8` generates and `bin/setup` now builds by default.
The classic build runs at both ends of the supported range: Ruby 3.2, Rails 7.0 and Node 20, and Ruby 4.0, Rails 8.1 and Node 22.

Jobs are named after their Ruby and Rails versions as before, with `classic` added to the classic ones.
Node defaults to 22, as the Vite-based blueprint needs Node 20.19 or later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Node defaults to 26, the newest release, while the oldest classic build stays on Node 20.
The Vite build also runs Ruby 4.0 with Rails 7.2 and 8.0, the combinations ember-cli-rails itself runs on Ruby 4.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants