Skip to content

WarpDrive: A framework-agnostic build plugin for WarpDrive - #1233

Draft
runspired wants to merge 1 commit into
emberjs:mainfrom
runspired:runspired-warp-drive-build-plugin
Draft

WarpDrive: A framework-agnostic build plugin for WarpDrive#1233
runspired wants to merge 1 commit into
emberjs:mainfrom
runspired:runspired-warp-drive-build-plugin

Conversation

@runspired

Copy link
Copy Markdown
Contributor

Proposes replacing WarpDrive's babel-based build configuration (@embroider/macros + setConfig wiring) with a single unplugin-based bundler plugin imported from @warp-drive/core/build-plugin, working across Vite, Rollup, Rolldown, Webpack, Rspack, and esbuild for Ember, React, Vue, Svelte, and Angular apps.

Propose WarpDrive: A framework-agnostic build plugin for WarpDrive

Rendered

Summary

This pull request is proposing a new RFC.

To succeed, it will need to pass into the Exploring Stage, followed by the Accepted Stage.

A Proposed or Exploring RFC may also move to the Closed Stage if it is withdrawn by the author or if it is rejected by the Ember team. This requires an "FCP to Close" period.

An FCP is required before merging this PR to advance to Accepted.

Upon merging this PR, automation will open a draft PR for this RFC to move to the Ready for Released Stage.

Exploring Stage Description

This stage is entered when the Ember team believes the concept described in the RFC should be pursued, but the RFC may still need some more work, discussion, answers to open questions, and/or a champion before it can move to the next stage.

An RFC is moved into Exploring with consensus of the relevant teams. The relevant team expects to spend time helping to refine the proposal. The RFC remains a PR and will have an Exploring label applied.

An Exploring RFC that is successfully completed can move to Accepted with an FCP is required as in the existing process. It may also be moved to Closed with an FCP.

Accepted Stage Description

To move into the "accepted stage" the RFC must have complete prose and have successfully passed through an "FCP to Accept" period in which the community has weighed in and consensus has been achieved on the direction. The relevant teams believe that the proposal is well-specified and ready for implementation. The RFC has a champion within one of the relevant teams.

If there are unanswered questions, we have outlined them and expect that they will be answered before Ready for Release.

When the RFC is accepted, the PR will be merged, and automation will open a new PR to move the RFC to the Ready for Release stage. That PR should be used to track implementation progress and gain consensus to move to the next stage.

Checklist to move to Exploring

  • The team believes the concepts described in the RFC should be pursued.
  • The label S-Proposed is removed from the PR and the label S-Exploring is added.
  • The Ember team is willing to work on the proposal to get it to Accepted

Checklist to move to Accepted

  • This PR has had the Final Comment Period label has been added to start the FCP
  • The RFC is announced in #news-and-announcements in the Ember Discord.
  • The RFC has complete prose, is well-specified and ready for implementation.
    • All sections of the RFC are filled out.
    • Any unanswered questions are outlined and expected to be answered before Ready for Release.
    • "How we teach this?" is sufficiently filled out.
  • The RFC has a champion within one of the relevant teams.
  • The RFC has consensus after the FCP period.

Proposes replacing WarpDrive's babel-based build configuration
(@embroider/macros + setConfig wiring) with a single unplugin-based
bundler plugin imported from @warp-drive/core/build-plugin, working
across Vite, Rollup, Rolldown, Webpack, Rspack, and esbuild for Ember,
React, Vue, Svelte, and Angular apps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AVxFCVeSYADB6iPtnnQJUR
@runspired runspired added T-ember-data RFCs that impact the ember-data library S-Proposed In the Proposed Stage labels Sep 2, 2026
else):

1. **Published WarpDrive packages.** WarpDrive's published code carries its flags as
`@embroider/macros` expressions (`macroCondition(getGlobalConfig().WarpDrive...)`). The

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we have 2 options here:

  1. we would maintain the published version using @embroider/macros statements until the existing babel config approach is deprecated and removed

  2. since the babel config uses a util imported from warp-drive, we could swap it to process these via a babel-shim for the new plugin and migrate our publishing format to something with zero risk of confusion for @embroider/macros

`@embroider/macros` expressions at all, switching to plain flag imports with working runtime
defaults — at which point a build with no plugin configured still runs correctly (as an
unoptimized development-flavored build that logs a one-time warning), and `@embroider/macros`
leaves WarpDrive's dependencies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

once this is achieved, WarpDrive itself can simplify its own build process,

  1. drop the build-config package (remaining code can just move into core since core will no longer need a prebuilt plugin to build itself)
  2. all library builds can drop the babel step maintained purely for converting boolean imports into macros statements for publish.

During migration, an app may have both the plugin and an embroider babel pass wired. This is
safe in both orders:

- The plugin runs ahead of babel (`enforce: 'pre'`). After it transforms a WarpDrive file, no

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note we don't need pre if we opt to move away from publishing embroider/macros statements immediately

...Macros.babelMacros,
// ...decorators, templates, etc.
],
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we should also show the migration of the currently recommended shorthand

temporarily get identical output (same config, either order) or a loud conflict error if the
two ever disagree — never silent divergence.

Classic ember-cli apps migrate by doing nothing: `setConfig(app, __dirname, config)` is

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if we were to shift off of embroider/macros as our publishing format, classic apps would necessarily need to either add a new thing into their build (updated babel plugin perhaps) or move off of the classic build system.

@runspired runspired self-assigned this Sep 2, 2026

## Unresolved questions

- The classic ember-cli story at 6.0 relies on the addon automatically injecting the babel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

another unresolved q: whether the under-development AQL and DSL build plugins ought to be combined into this. It's less clear that's possible due to how they produce virtual imports from directory and file scans.

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

Labels

S-Proposed In the Proposed Stage T-ember-data RFCs that impact the ember-data library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants