Ember.js Guides

repository·master·Indexed 41 days ago

https://github.com/ember-learn/guides-source

Official documentation and guides for the Ember.js framework, covering project setup, directory structure, environment configuration, and core concepts. Includes version-specific content from v1.10.0 through v2.12.0, including tutorials on Ember CLI, ES6 modules, and the Deprecation Handler API.

Tokens
55.5K
Snippets
161
Records
242
Agent score
41%

What's inside Ember.js

  1. What is Ember?

    master

    Ember is a JavaScript front-end framework designed for building websites with rich and complex user interactions. It provides features to manage application complexity and an integrated development toolkit for rapid iteration.

    Key components of the Ember ecosystem include:

    • Ember CLI: A robust development toolkit used to create, develop, and build applications. Commands are typically prefixed with $ ember <command>.
    • Routing: The central mechanism that allows developers to drive application state from the URL.
    • Templating engine: Uses Handlebars syntax to write application templates.
    • Data layer (Ember Data): Provides a consistent way to manage application state and communicate with external APIs.
    • Ember Inspector: A browser extension or bookmarklet used to inspect applications live during development.
  2. Overview of Ember.js Core Features

    master

    Ember is a JavaScript front-end framework for building complex web applications. Key components you will interact with include:

    • Ember CLI: A development toolkit used to create, develop, and build applications. Commands are typically prefixed with $ ember <command>.
    • Routing: The mechanism used to drive application state via the URL.
    • Templating engine: Uses Handlebars syntax for application templates.
    • Data layer (Ember Data): A system for managing application state and communicating with external APIs.
    • Ember Inspector: A browser extension or bookmarklet used to inspect live applications.

    For exhaustive technical details on every feature, refer to the Ember.js API documentation.

  3. What is Ember.js?

    master

    Ember is a JavaScript front-end framework designed for building websites with rich and complex user interactions. It provides features to manage application complexity and an integrated development toolkit for rapid iteration.

    Key components of the Ember ecosystem include:

    • Ember CLI: A robust development toolkit used to create, develop, and build applications. Commands are typically prefixed with $ ember <command>.
    • Routing: The core of an Ember application that allows developers to drive application state via the URL.
    • Templating engine: Uses Handlebars syntax for writing application templates.
    • Data layer (Ember Data): Provides a consistent way to manage application state and communicate with external APIs.
    • Ember Inspector: A browser extension or bookmarklet used to inspect applications live during development.
  4. Common tools for making API requests in Ember

    master

    Ember supports various back-end types including REST, JSON:API, and GraphQL. You can use the following tools to perform CRUD (create, read, update, delete) operations:

    • EmberData: The official data persistence library. It handles request formatting, response normalization, and local data caching. It is included by default in new Ember applications.
    • Native fetch: Use the standard JavaScript fetch API. For support in older browsers, install the ember-fetch addon and use import fetch from 'fetch';
    • jQuery Ajax: Available if you enable optional features and import jQuery from 'jquery' in your app.
    • Ember Addons: Search Ember Observer for specialized data loading addons.
    • General JS Libraries: Any standard JavaScript data fetching library can be used by managing them as dependencies.
  5. Core components of the Ember ecosystem

    master

    Ember is a JavaScript front-end framework for building complex web applications. Key components you will interact with include:

    • Ember CLI: A development toolkit used to create, develop, and build applications. Commands are typically prefixed with $ ember <command>.
    • Routing: The mechanism used to drive application state via the URL.
    • Handlebars: The templating engine used to write application templates.
    • Ember Data: The data layer used to manage application state and communicate with external APIs.
    • Ember Inspector: A browser extension or bookmarklet used to inspect live applications during development.
  6. Tools for making API requests in Ember

    master

    Ember supports various back-end types including REST, JSON:API, and GraphQL. You can use several tools to perform CRUD (create, read, update, delete) operations:

    • Ember Data: The official data persistence library. It handles request formatting, response normalization, and local data caching. It is included by default in new Ember applications.
    • Native fetch: Use the standard JavaScript fetch API. For support in older browsers, install the ember-fetch addon and use import fetch from 'fetch'.
    • jQuery Ajax: Available if you enable optional features in your Ember configuration to allow import jQuery from 'jquery'.
    • Addons & Libraries: You can search Ember Observer for specific data-loading addons or use general JavaScript libraries by managing them as dependencies.
  7. Core features of Ember.js

    master

    Ember is a JavaScript front-end framework for building complex web applications. Key components of the Ember ecosystem include:

    • Ember CLI: A development toolkit for creating, developing, and building applications. Commands are typically prefixed with $ ember <command>.
    • Routing: The mechanism used to drive application state via the URL.
    • Templating engine: Uses Handlebars syntax for application templates.
    • Ember Data: A data layer for managing application state and communicating with external APIs.
    • Ember Inspector: A browser extension or bookmarklet used to inspect applications live during development.
  8. Core concepts of the Ember.js framework

    master

    Ember is a JavaScript front-end framework designed for building websites with rich, complex user interactions. It provides a set of essential features to manage application complexity and an integrated development toolkit for rapid iteration. Key pillars of the Ember ecosystem include:

    • Ember CLI: A robust development toolkit used to create, develop, and build applications. Commands are typically invoked via $ ember <command>.
    • Routing: The central mechanism that allows developers to drive application state directly from the URL.
    • Templating engine: Uses Handlebars syntax to define application templates.
    • Data layer (Ember Data): Provides a consistent way to manage application state and communicate with external APIs.
    • Ember Inspector: A browser extension or bookmarklet used to inspect applications live during development.
  9. Core components of an Ember application

    master

    Ember applications are built using several key integrated tools and concepts:

    • Ember CLI: A development toolkit used to create, develop, and build applications. Commands are typically invoked via $ ember <command>.
    • Routing: The mechanism that drives application state from the URL.
    • Templating engine: Uses Handlebars syntax to define application templates.
    • Data layer (Ember Data): A system for managing application state and communicating with external APIs.
    • Ember Inspector: A browser extension or bookmarklet used to inspect running applications live.
  10. What is Ember Octane?

    master

    Ember Octane is the first 'Edition' of Ember, introducing a new programming model designed for better productivity and performance. It shifts the framework from a custom object model to native JavaScript patterns.

    Core Features

    • Native JavaScript Classes: Replaces extend() and create() with standard ES6 classes.
    • Decorators: Used for customizing class behavior.
    • Tracked Properties (@tracked): Simplifies DOM updates by replacing computed properties and observers.
    • Async/Await: Native support for asynchronous code.
    • Glimmer Components: Includes "Outer HTML" templates (supporting fragments), customizable DOM attributes via ...attributes, and <AngleBracket> syntax.
    • Modifiers: A unified way to interact with the DOM from templates.
    • NPM Integration: Import packages with zero additional configuration.

    Legacy Features Replaced

    Octane makes the following features optional or replaces them entirely:

    • jQuery: Use templates or native DOM APIs instead.
    • Non-native classes: Use Native Classes instead of extend() or mixins.
    • Computed properties/Observers: Use @tracked instead.
    • Curly component invocation: Use <AngleBracket> syntax instead.
    • The Run Loop: Developers should no longer interact with the run loop directly.
    • "Inner HTML" components: Components no longer require a wrapping element or complex JS configuration like tagName or classNameBindings.
  11. Use auto-tracking with getters for computed values

    master

    In Ember, you don't need to manually mark getters as @tracked. Ember uses a feature called auto-track to automatically monitor dependencies.

    When a getter accesses a property that is tracked (such as any argument via this.args.*), Ember automatically tracks that dependency. If the underlying argument changes, Ember knows the getter's value is now stale and will re-render the template automatically.

    Key takeaway: You only need @tracked for instance variables that you intend to assign new values to. For computed values derived from other data, use a standard JavaScript get syntax.