Skip to content

Commit ace7938

Browse files
committed
Add more detail to the RFC
- Include a deprecation guide
1 parent 3969d7d commit ace7938

File tree

1 file changed

+62
-8
lines changed

1 file changed

+62
-8
lines changed

text/1101-deprecate-ember-vendor-bundles.md

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ teams: # delete teams that aren't relevant
88
- framework
99
- learning
1010
prs:
11-
accepted: # Fill this in with the URL for the Proposal RFC PR
11+
accepted: https://github.com/emberjs/rfcs/pull/1101
1212
project-link:
1313
suite:
1414
---
@@ -33,13 +33,29 @@ suite: Leave as is
3333

3434
## Summary
3535

36-
The published ember-source package contains two different builds of Ember. This RFC deprecates the older one.
36+
The published `ember-source` package contains several AMD-specific bundled builds
37+
of Ember that are appended to `vendor.js` in the classic build system.
38+
This RFC deprecates the following files:
39+
40+
- `ember.debug.js`
41+
- `ember.prod.js`
42+
- `ember-testing.js`
43+
- `ember-template-compiler.js`
44+
45+
Instead, Ember will be included in application builds as ES module library via `ember-auto-import`.
3746

3847
## Motivation
3948

40-
We don't want to to forever maintain the legacy, AMD-specific bundled copies of Ember that ember-cli traditionally appends to vendor.js. Instead, we want everybody consuming Ember as a modern ES module library.
49+
Maintaining the legacy AMD-specific bundled copies of Ember is no longer necessary.
50+
Modern Ember applications should consume Ember as ES modules, which aligns with
51+
the broader JavaScript ecosystem. This change simplifies the build pipeline and
52+
reduces maintenance overhead.
4153

42-
## Detailed design
54+
This deprecation will have no effect on applications using Embroider with
55+
`staticEmberSource: true` or Embroider v4 (Vite). It only impacts applications
56+
using the classic build system without Embroider.
57+
58+
## Transition Path
4359

4460
> This is the bulk of the RFC.
4561
@@ -63,6 +79,19 @@ We don't want to to forever maintain the legacy, AMD-specific bundled copies of
6379
- Introduce an optional feature that opts into the new behavior (this is not hard to implement, it's mostly just disabling some existing compat code)
6480
- Deprecate not enabling the optional feature
6581

82+
### Classic Build System
83+
84+
We will introduce a new optional feature for projects to opt into consuming
85+
Ember as ES modules. Not having this optional feature enabled will result in
86+
a deprecation warning.
87+
88+
Addons that rely on accessing Ember from `treeForVendor` or on accessing Ember
89+
from vendor will need to update their implementation.
90+
91+
### Embroider v4 or with `staticEmberSource: true`
92+
93+
This deprecation will have no effect on these projects. They already consume Ember as ES modules.
94+
6695
## How we teach this
6796

6897
> What names and terminology work best for these concepts and why? How is this
@@ -78,8 +107,35 @@ We don't want to to forever maintain the legacy, AMD-specific bundled copies of
78107
79108
> Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc.
80109
81-
- Need to explain what addon authors should do if they were accessing Ember from code in treeForVendor.
82-
- Explain that this whole thing is a no-op for Embroider users with `staticEmberSource:true` or `@embroider/core >= 4.0`.
110+
### Deprecation Guide
111+
112+
Ember will no longer publish legacy AMD-specific Ember builds. To opt-in to
113+
consuming Ember as ES modules and clear this deprecation, enable the
114+
`ember-modules` optional feature by running `ember feature:enable ember-modules`.
115+
116+
This applies only to the classic build system or to Embroider < 4.0 without the
117+
`staticEmberSource: true` option. If you see this deprecation warning in these
118+
setups, please [open an issue](https://github.com/emberjs/ember.js/issues/new/choose).
119+
120+
Alternatively, you can also clear the deprecation by moving to Embroider v4 by
121+
running the [Ember Vite Codemod](https://github.com/mainmatter/ember-vite-codemod),
122+
but this may require additional changes to your project.
123+
124+
The AMD-specific Ember builds will no longer be published in next Ember major release
125+
and no longer be bundled into `vendor.js`, even on the classic build system. These files are:
126+
-
127+
- `ember.debug.js`
128+
- `ember.prod.js`
129+
- `ember-testing.js`
130+
- `ember-template-compiler.js`
131+
132+
- In rare cases, Addons were relying on accessing Ember from `vendor`. If you have
133+
addons that do so they will need to be updated to consume Ember as ES modules.
134+
135+
A known addon that previously relied on accessing Ember from `vendor` is
136+
[ember-cli-deprecation-workflow](https://github.com/ember-cli/ember-cli-deprecation-workflow).
137+
Please ensure you are on the latest version of this addon as that reliance has
138+
been removed.
83139

84140
## Drawbacks
85141

@@ -95,8 +151,6 @@ We don't want to to forever maintain the legacy, AMD-specific bundled copies of
95151
96152
> This section could also include prior art, that is, how other frameworks in the same domain have solved this problem.
97153
98-
This RFC will cover ember.debug.js and ember.prod.js. It could also cover ember-template-compiler.js, or that can be a separate RFC.
99-
100154
## Unresolved questions
101155

102156
> Optional, but suggested for first drafts. What parts of the design are still

0 commit comments

Comments
 (0)