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