home
  • Blog
5.11
  • Introduction
  • Getting Started
  • Tutorial
  • Core Concepts
  • Components
  • Routing
  • Services
  • EmberData
  • In-Depth Topics
  • Application Development
  • Application Concerns
  • Accessibility
  • Configuration
    • Configuring Your App
    • Configuring Ember CLI
    • Handling Deprecations
    • Disabling Prototype Extensions
    • Specifying the URL Type
    • Embedding Applications
    • Feature Flags
    • Optional Features
    • Build targets
    • Debugging
  • Testing
  • Addons and Dependencies
  • Using TypeScript
  • Developer Tools
  • Ember Inspector
  • Code Editors
  • Additional Resources
  • Upgrading
  • Contributing to Ember.js
  • Glossary
Old Guides - You are viewing the guides for Ember v5.11.0.
Go to v6.3.0

Disabling Prototype Extensions


Zoey says...
Not disabling prototype extensions is deprecated at Ember 5.10 and will be removed at Ember 6.0. See the deprecation guide for more detail.

Historically, Ember.js extended the prototypes of native JavaScript arrays to implement the Ember.Enumerable, Ember.MutableEnumerable, Ember.MutableArray and Ember.Array interfaces. This is the default behavior up until 6.0, at which point it will no longer be supported.

To prepare for 6.0, you can disable prototype extensions immediately. To do so, set the EmberENV.EXTEND_PROTOTYPES flag to false:

config/environment.js
ENV = {
  EmberENV: {
    EXTEND_PROTOTYPES: false
  }
}

Life Without Array Prototype Extension

There are two major differences to how arrays will behave after you disable array prototype extensions.

No more non-standard methods

Arrays no longer have the non-standard methods listed in the deprecation guide like pushObject, etc. Follow the deprecation guide to replace each usage with a standard JavaScript alternative.

Tracking of Changes in Arrays

If you disable prototype extensions and attempt to use native arrays with things like a template's {{#each}} helper, Ember.js will have no way to detect changes to the array and the template will not update as the underlying array changes.

You can restore automatic tracking of changes by replacing your native array with a TrackedArray from the 'tracked-built-ins' library.

import { TrackedArray } from '@glimmer/tracking';

class Ocean {
  islands = new TrackedArray(['Oahu', 'Kauai']);

  addIsland(newIsland) {
    this.islands.push(newIsland);
  }
}

Alternatively, you can refactor your code to use an "immutable update" style with tracked properties:

import { tracked } from '@glimmer/tracking';

class Ocean {
  @tracked islands = ['Oahu', 'Kauai'];

  addIsland(newIsland) {
    this.islands = this.islands.concat(newIsland);
  }
}
left arrow
Handling Deprecations
Specifying the URL Type
right arrow
On this page

  • Life Without Array Prototype Extension
  • No more non-standard methods
  • Tracking of Changes in Arrays
Team Sponsors Security Legal Branding Community Guidelines
Twitter GitHub Discord Mastodon

If you want help you can contact us by email, open an issue, or get realtime help by joining the Ember Discord.

© Copyright 2025 - Tilde Inc.
Ember.js is free, open source and always will be.


Ember is generously supported by
blue Created with Sketch.