-
-
Notifications
You must be signed in to change notification settings - Fork 406
Description
- Proposed Target: Ember v5.0.0
- Alternative: Native Classes
EmberObject and the Ember Object model have served this community well for a long time, but with native syntax now fully supported in Ember applications, it no longer makes sense to continue shipping a full class model to every user, and the maintenance burden for it is quite large. Removing the object model from the framework will make apps lighter, and make it easier for us to maintain at the same time.
Migration Path
There are a few different aspects of this migration:
- Migrating Components. Classic Components are inextricably tied to the object model, so it's not possible for us to migrate them directly. Instead, users will have to rewrite their components to Glimmer Components. This means that
EmberObjectcan only be removed after Classic Components have been deprecated and removed as well. - Migrating framework classes.
Route,Controller,Service, andHelperall extend fromEmberObjectcurrently. This pre-RFC proposes that rather than provide alternatives, like we do for components, we instead deprecate all of the methods that these classes inherit fromEmberObject. For instance,Route.extend()would be deprecated, andthis.get()on all of these classes. The base functionality of each class would be preserved, and it would be possible for users to migrate in place, without having to adopt a new base class. - Utility classes (classes that don't extend from a framework object) need to be converted to native classes in general, and shouldn't extend from
EmberObjectat all. We should create a conversion guide specifically for these.
Deprecation Timeline
The object model is deeply embedded in Ember and in the ecosystem, so it will take some time for users to migrate. That is why this pre-RFC proposes that we push out the deprecation until Ember v5.0.0 at the earliest. This will give users time to migrate to the new idioms, and will ideally give us plenty of breathing room in this migration.