|
| 1 | +--- |
| 2 | +stage: released |
| 3 | +start-date: 2025-05-13T00:00:00.000Z |
| 4 | +release-date: |
| 5 | +release-versions: |
| 6 | + ember-source: 6.10.0 |
| 7 | +teams: |
| 8 | + - cli |
| 9 | + - framework |
| 10 | + - learning |
| 11 | +prs: |
| 12 | + accepted: 'https://github.com/emberjs/rfcs/pull/1101' |
| 13 | + ready-for-release: 'https://github.com/emberjs/rfcs/pull/1156' |
| 14 | + released: 'https://github.com/emberjs/rfcs/pull/1159' |
| 15 | +project-link: |
| 16 | +suite: |
| 17 | +--- |
| 18 | + |
| 19 | +<!--- |
| 20 | +Directions for above: |
| 21 | +
|
| 22 | +stage: Leave as is |
| 23 | +start-date: Fill in with today's date, 2032-12-01T00:00:00.000Z |
| 24 | +release-date: Leave as is |
| 25 | +release-versions: Leave as is |
| 26 | +teams: Include only the [team(s)](README.md#relevant-teams) for which this RFC applies |
| 27 | +prs: |
| 28 | + accepted: Fill this in with the URL for the Proposal RFC PR |
| 29 | +project-link: Leave as is |
| 30 | +suite: Leave as is |
| 31 | +--> |
| 32 | + |
| 33 | +<!-- Replace "RFC title" with the title of your RFC --> |
| 34 | + |
| 35 | +# Deprecate Ember Vendor Bundles |
| 36 | + |
| 37 | +## Summary |
| 38 | + |
| 39 | +The published `ember-source` package contains several AMD-specific bundled builds |
| 40 | +of Ember that are appended to `vendor.js` in the classic build system. |
| 41 | +This RFC deprecates the following files: |
| 42 | + |
| 43 | +- `ember.debug.js` |
| 44 | +- `ember.prod.js` |
| 45 | +- `ember-testing.js` |
| 46 | +- `ember-template-compiler.js` |
| 47 | + |
| 48 | +Instead, Ember will be included in application builds as ES module library via `ember-auto-import`. |
| 49 | + |
| 50 | +## Motivation |
| 51 | + |
| 52 | +Maintaining the legacy AMD-specific bundled copies of Ember is no longer necessary. |
| 53 | +Modern Ember applications should consume Ember as ES modules, which aligns with |
| 54 | +the broader JavaScript ecosystem. This change simplifies the build pipeline and |
| 55 | +reduces maintenance overhead. |
| 56 | + |
| 57 | +This deprecation will have no effect on applications using Embroider with |
| 58 | +`staticEmberSource: true` or Embroider v4 (Vite). It only impacts applications |
| 59 | +using the classic build system without Embroider. |
| 60 | + |
| 61 | +## Transition Path |
| 62 | + |
| 63 | +> This is the bulk of the RFC. |
| 64 | +
|
| 65 | +> Explain the design in enough detail for somebody |
| 66 | +> familiar with the framework to understand, and for somebody familiar with the |
| 67 | +> implementation to implement. This should get into specifics and corner-cases, |
| 68 | +> and include examples of how the feature is used. Any new terminology should be |
| 69 | +> defined here. |
| 70 | +
|
| 71 | +> Please keep in mind any implications within the Ember ecosystem, such as: |
| 72 | +> |
| 73 | +> - Lint rules (ember-template-lint, eslint-plugin-ember) that should be added, modified or removed |
| 74 | +> - Features that are replaced or made obsolete by this feature and should eventually be deprecated |
| 75 | +> - Ember Inspector and debuggability |
| 76 | +> - Server-side Rendering |
| 77 | +> - Ember Engines |
| 78 | +> - The Addon Ecosystem |
| 79 | +> - IDE Support |
| 80 | +> - Blueprints that should be added or modified |
| 81 | +
|
| 82 | + |
| 83 | +### Classic Build System |
| 84 | + |
| 85 | +We will introduce a new optional feature for projects to opt into consuming |
| 86 | +Ember as ES modules. Not having this optional feature enabled will result in |
| 87 | +a deprecation warning. |
| 88 | + |
| 89 | +Addons that rely on accessing Ember from `treeForVendor` or on accessing Ember |
| 90 | +from vendor will need to update their implementation. |
| 91 | + |
| 92 | +### Embroider v4 or with `staticEmberSource: true` |
| 93 | + |
| 94 | +This deprecation will have no effect on these projects. They already consume Ember as ES modules. |
| 95 | + |
| 96 | +## How we teach this |
| 97 | + |
| 98 | +> What names and terminology work best for these concepts and why? How is this |
| 99 | +> idea best presented? As a continuation of existing Ember patterns, or as a |
| 100 | +> wholly new one? |
| 101 | +
|
| 102 | +> Would the acceptance of this proposal mean the Ember guides must be |
| 103 | +> re-organized or altered? Does it change how Ember is taught to new users |
| 104 | +> at any level? |
| 105 | +
|
| 106 | +> How should this feature be introduced and taught to existing Ember |
| 107 | +> users? |
| 108 | +
|
| 109 | +> Keep in mind the variety of learning materials: API docs, guides, blog posts, tutorials, etc. |
| 110 | +
|
| 111 | +### Deprecation Guide |
| 112 | + |
| 113 | +Ember will no longer publish legacy AMD-specific Ember builds. To opt-in to |
| 114 | +consuming Ember as ES modules and clear this deprecation, enable the |
| 115 | +`ember-modules` optional feature by running `ember feature:enable ember-modules`. |
| 116 | + |
| 117 | +This applies only to the classic build system or to Embroider < 4.0 without the |
| 118 | +`staticEmberSource: true` option. If you see this deprecation warning in these |
| 119 | +setups, please [open an issue](https://github.com/emberjs/ember.js/issues/new/choose). |
| 120 | + |
| 121 | +Alternatively, you can also clear the deprecation by moving to Embroider v4 by |
| 122 | +running the [Ember Vite Codemod](https://github.com/mainmatter/ember-vite-codemod), |
| 123 | +but this may require additional changes to your project. |
| 124 | + |
| 125 | +The AMD-specific Ember builds will no longer be published in next Ember major release |
| 126 | +and no longer be bundled into `vendor.js`, even on the classic build system. These files are: |
| 127 | +- |
| 128 | +- `ember.debug.js` |
| 129 | +- `ember.prod.js` |
| 130 | +- `ember-testing.js` |
| 131 | +- `ember-template-compiler.js` |
| 132 | + |
| 133 | +- In rare cases, Addons were relying on accessing Ember from `vendor`. If you have |
| 134 | +addons that do so they will need to be updated to consume Ember as ES modules. |
| 135 | + |
| 136 | +A known addon that previously relied on accessing Ember from `vendor` is |
| 137 | +[ember-cli-deprecation-workflow](https://github.com/ember-cli/ember-cli-deprecation-workflow). |
| 138 | +Please ensure you are on the latest version of this addon as that reliance has |
| 139 | +been removed. |
| 140 | + |
| 141 | +## Drawbacks |
| 142 | + |
| 143 | +> Why should we _not_ do this? Please consider the impact on teaching Ember, |
| 144 | +> on the integration of this feature with other existing and planned features, |
| 145 | +> on the impact of the API churn on existing apps, etc. |
| 146 | +
|
| 147 | +> There are tradeoffs to choosing any path, please attempt to identify them here. |
| 148 | +
|
| 149 | +## Alternatives |
| 150 | + |
| 151 | +> What other designs have been considered? What is the impact of not doing this? |
| 152 | +
|
| 153 | +> This section could also include prior art, that is, how other frameworks in the same domain have solved this problem. |
| 154 | +
|
| 155 | +## Unresolved questions |
| 156 | + |
| 157 | +> Optional, but suggested for first drafts. What parts of the design are still |
| 158 | +> TBD? |
0 commit comments