Skip to content

Support Ember apps generated with the Vite-based blueprint - #652

Merged
tricknotes merged 4 commits into
mainfrom
support-vite
Aug 22, 2026
Merged

Support Ember apps generated with the Vite-based blueprint#652
tricknotes merged 4 commits into
mainfrom
support-vite

Conversation

@tricknotes

Copy link
Copy Markdown
Owner

ember-cli >= 6.8 generates applications that are built with Vite instead of the classic Broccoli-based pipeline. Support both build systems, detecting the Vite-based one by the presence of a vite.config.* file in the Ember application's root.

ember build and ember test keep working for Vite-based applications (they delegate to vite build via @embroider/compat), so the command layer is unchanged. The differences are:

  • ember-cli-rails-addon is incompatible with the Vite-based build: it forces storeConfigInMeta off, which Embroider no longer supports, and it ships an initializer that imports the removed ember module. Vite-based applications must not install it.
  • Without the addon there is no build lock, so in development a Vite-based application is built synchronously on first request instead of being rebuilt with ember build --watch.
  • include_ember_script_tags and include_ember_stylesheet_tags are not supported for Vite-based applications: their output uses ES module script tags and loads its configuration from a meta tag in the generated index.html, neither of which the helpers can inject. Use render_ember_app instead.

The dummy application's blueprint version is now selectable with the EMBER_VERSION environment variable (default 7.0.0), and CI covers the classic build with 5.12.0 and 6.7.2 alongside the full matrix on 7.0.0.

ember-cli >= 6.8 generates applications that are built with Vite instead
of the classic Broccoli-based pipeline. Support both build systems,
detecting the Vite-based one by the presence of a vite.config.* file in
the Ember application's root.

`ember build` and `ember test` keep working for Vite-based applications
(they delegate to `vite build` via `@embroider/compat`), so the command
layer is unchanged. The differences are:

* `ember-cli-rails-addon` is incompatible with the Vite-based build: it
  forces `storeConfigInMeta` off, which Embroider no longer supports,
  and it ships an initializer that imports the removed `ember` module.
  Vite-based applications must not install it.
* Without the addon there is no build lock, so in development a
  Vite-based application is built synchronously on first request instead
  of being rebuilt with `ember build --watch`.
* `include_ember_script_tags` and `include_ember_stylesheet_tags` are
  not supported for Vite-based applications: their output uses ES module
  script tags and loads its configuration from a meta tag in the
  generated index.html, neither of which the helpers can inject. Use
  `render_ember_app` instead.

The dummy application's blueprint version is now selectable with the
EMBER_VERSION environment variable (default 7.0.0), and CI covers the
classic build with 5.12.0 and 6.7.2 alongside the full matrix on 7.0.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The `build (4.0, main, 7.0.0)` job fails while loading the spec files,
before any example runs:

    An error occurred while loading ./spec/features/user_views_ember_app_spec.rb.
    FrozenError:
      can't modify frozen Hash: {}

The failure comes from an incompatibility between rspec-rails 6.1.5 and
the current rails/rails main branch, not from this repository's code:
requiring `rspec/rails` eagerly loads `action_view/test_case` and
`action_controller/base` before the dummy application initializes (Rails
main warns ":action_controller was loaded before application
initialization" and ":action_view_test_case was loaded before
application initialization"), and defining the first feature example
group then hits the FrozenError.

rspec-rails 6.x is the newest series the gemspec allows
(`rspec-rails >= 3.6.0, < 7.0`), so the job cannot be fixed without
first upgrading that dependency to a series that supports Rails main.
Comment the job out until then instead of letting it fail on every run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
claude added 2 commits August 22, 2026 14:43
ember-cli-rails-assets 0.8.0 makes `include_ember_script_tags` work for
Vite-based applications: it extracts the configuration meta tag, the
stylesheet and modulepreload links, and the ES module script tags from
the generated index.html. Require that version and drop the skip that
marked the asset-helpers feature spec as unsupported on Vite.

`include_ember_stylesheet_tags` is still classic-only (its stylesheet
lookup cannot resolve the `/@embroider/virtual/*` references in a Vite
build), and it is unnecessary on Vite because the script-tags helper
already emits the stylesheets. The dummy application's view now calls it
only for classic builds, and the documentation describes the same usage.

Verified locally against both blueprints: 93 examples, 0 failures each
with ember-new-output 7.0.0 (Vite) and 6.7.2 (classic).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tricknotes
tricknotes merged commit f65b21b into main Aug 22, 2026
11 checks passed
@tricknotes
tricknotes deleted the support-vite branch August 22, 2026 15:47
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