Ember 3.25 released


Today, the Ember project released version 3.25 of Ember.js, Ember Data, and Ember CLI.

This version started the 3.26 test cycle of all sub-projects. We encourage our community (especially plugin authors) to help test these beta versions and report any bugs before they are released as the final version in six weeks.This Embers try Plugins are a great way to continuously test your project against the latest Ember version.

You can read more about our general publishing process here:


Ember.js

Ember.js is the core framework for building ambitious web applications.

Changes in Ember.js 3.25

Ember.js 3.25 is an incremental and backward compatible version of Ember, with bug fixes, performance improvements, and a small number of deprecations.

Bug fix

Ember.js 3.25 contains several bug fixes, including:

  • empty htmlSafe The string is now considered fake. (#18148)
  • Template local variables no longer destroy component calls with the same name. (#19351)
  • Improved error messages when calling nested components, for example <Foo:Bar />. (#19336)
  • Improved error messages and stack trace <LinkTo />. (#19342)

feature

Ember.js 3.25 introduced 2 features.

  1. Template strict mode (#19302, #19306, #19319)

Although this feature will not affect Ember developers yet, it is an important step towards allowing more experimental work in templates, such as template import and single-file components.

If you are interested in these topics, please follow our RFC Activity library and participation opportunities!

  1. Named block (#19318)

This feature enables developers to generate different blocks from components, thereby unlocking powerful combination modes for components.

This feature is very useful when you want to present different content based on the incoming data. Let’s implement a shopping cart, list the items in it, or display a message indicating that it is empty.We will use {{gt}} From ember-truth-helpers To help achieve this.

First we write the component template:

// app/components/cart.hbs
{{#if (gt @list.length 0)}}
  <ul>
    {{#each @list as |item|}}
      <li>{{yield item}}</li>
    {{/each}}
  </ul>
{{else}}
  {{yield to="empty"}}
{{/if}}

It can be used like this:

<Cart @list={{this.shoppingList}}>
  <:default as |listItem|>
    <p>You have a {{listItem}}.</p>
  </:default>
  <:empty>
    <p>Your cart is empty.</p>
  </:empty>
</Cart>

Then when shoppingList Contains multiple elements, such as [ "apple", "pear", "banana" ], It presents the following:

<ul>
  <li><p>You have a apple.</p></li>
  <li><p>You have a pear.</p></li>
  <li><p>You have a banana.</p></li>
</ul>

but if shoppingList Empty, it will present the following:

<p>Your cart is empty.</p>

A named block is also useful if you want to ensure that the HTML has a certain structure, but you want to enable customization of the content.An example of this is <Article> Components, as shown in the yieldable named block RFC (Mime private 460).

You can Component API documentation.

Deprecated

Ember.js 3.25 introduced 0 deprecations.

For more details about the changes in Ember.js 3.25, please check Ember.js 3.25.0 release page.


Embers data

Ember Data is the official data persistence library for Ember.js applications.

Ember data 3.25 changes

Except for document repair and internal cleanup of feature flags, there are no changes.

For more details about the changes in Ember Data 3.25, please check
Ember Data 3.25.0 release page.


Ember command line interface

Ember CLI is a command line interface for managing and packaging Ember.js applications.

Upgrade Ember CLI

You can upgrade Ember CLI with the following command ember-cli-update project:

npx ember-cli-update

This utility will help you update your application or plug-in to the latest Ember CLI version. You may encounter merge conflicts, where the default behavior is to let you resolve the conflict yourself.For more information ember-cli-update Item, see GitHub Readme.

Although it is recommended to keep the Ember CLI version synchronized with Ember and Ember Data, it is not required. After updating ember-cli, you can keep the current version of Ember or Ember Data by editing package.json Revert changes to contained lines ember-source with ember-data.

Changes in Ember CLI 3.25

There are no changes except for the updated dependencies and plug-in blueprints in the application.

For more details about the changes in Ember CLI 3.25 and detailed upgrade instructions, please check Ember CLI 3.25.0 release page.

thank you!

As an ambitious community-driven open source project, each of these releases reminds us that without your continued support, the Ember project is impossible to achieve. We are very grateful for the efforts of our contributors.

Leave a Reply

Your email address will not be published. Required fields are marked *