Ember 3.27 released


Today, the Ember project announced version 3.27 of Ember.js, Ember Data, and Ember CLI. This is a small version, stable version.

We also announced the start of the 3.28 test cycle for all sub-projects. We encourage our community (especially plugin authors) to help test the beta version and report any bugs before releasing it as a stable version in six weeks.This Embers try Plugins are a great way to continuously test your project against the latest Ember version.

Ember.js 3.28 (start again Beta Today) is the final planned version of the 3.x release cycle and will become the LTS version. With the release of 3.28-beta, the main development branch of all Ember projects will become 4.0. Find out more about Ember 4.0 on the blog next week.

You can read more about our general publishing process through the following resources:


Ember.js

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

Changes in Ember.js 3.27

Ember.js 3.27 is an incremental and backward compatible version of Ember with bug fixes, performance improvements and deprecations.For the complete set of changes, see CHANGELOG.md.

Notable bug fixes

  • Before 3.27 <:inverse> Will not always alias the else block.This is glimmerjs / glimmer-vm # 1296.
  • Ember.js 3.27.0 was released in early May and included several regressions. These are largely related to changes in glimmer VM and some deprecated implementations, and have been corrected in patch versions prior to 3.27.5.

Function addition

Context helpers and modifiers

For several years, Ember has provided a mechanism called “contextual components”. This API allows developers to generate components (optionally with parameters to be applied) into blocks.

in RFC #432
Additional APIs have also been proposed, allowing helpers and modifiers to be used in the same way.

For example, the layout is SuperForm The components may be implemented as:

// app/components/super-form.hbs
<form>
  {{yield (hash

    Input=(component "super-input" form=this model=this.model)
    Textarea=(component "super-textarea" form=this model=this.model)
    Submit=(component "super-submit" form=this model=this.model)

    is-valid=(helper "super-is-valid" form=this model=this.model)
    error-for=(helper "super-error-for" form=this model=this.model)

    auto-resize=(modifier "super-auto-resize")

  )}}
</form>

And used as:

// app/templates/index.hbs
<SuperForm @model={{this.post}} as |f|>

  {{! Invoke a contextual component }}
  <f.Input @name="title" />

  {{! Invoke contextual helpers }}
  {{#unless (f.is-valid "title")}}
    <div class="error">This field {{f.error-for "title"}}</div>
  {{/unless}}

  {{! Invoke a contextual modifier on a contextual component invocation }}
  <f.Textarea @name="body" {{f.auto-resize maxHeight="500"}} />

  <f.Submit />
</SuperForm>

These APIs open the door to creating new and more powerful UI abstractions.

Deprecated

Ember 3.27 introduces the last set of deprecations for Ember 4.0. The newly introduced deprecation mainly affects less commonly used APIs.As always, the deprecated API is Deprecation guide.

Several notable deprecations added in 3.27 are:

Call the helper without parameters and parentheses at the named parameter position

In some templates, helpers passed as parameters can be treated as calls instead of uncalled assistants being passed as values. E.g:

{{! is someHelper invoked, or passed as a reference? }}
<SomeComponent @arg={{someHelper}} />

In order to better align the behavior of the helper with components and modifiers in the same settings, parentheses are now required to cause the call:

{{! (someHelper) is clearly an invocation with no arguments }}
<SomeComponent @arg={{(someHelper)}} />

The non-parametric version of the auxiliary pass will pass a reference to the auxiliary in Ember 4.0.see Deprecation guide entry
more details.

Import legacy built-in components

Historically, the Ember application has been able to import definitions <Input>, <Textarea>, with <LinkTo> Used for reopening or subclassing. In Ember 4.0, we intend to improve the internal implementation of these built-in functions. In order to achieve this, we have been gradually deprecating some built-in APIs in the 3.x version series.

In 3.27, it is not recommended to import the base class of Ember’s built-in functions. In Ember 4.0, these modules will not be available. The specific deprecated imports are:

import Checkbox from '@ember/component/checkbox';
import Textarea from '@ember/component/text-area';
import TextField from '@ember/component/text-field';
import LinkToComponent from '@ember/routing/link-component';

Accessing these classes through other paths (such as the owner interface) is also deprecated.

see Deprecation guide entry
More detailed information and guidance on migrating from these APIs.

In addition, reopen these classes (e.g. change tagName in a
<LinkTo>) Has been deprecated and will not be supported in 4.0.Look Deprecation guide for migration strategies.

Deprecated old parameters of built-in parameters

Ember’s built-in components have a public interface, which is mainly defined as classic Ember components by their implementation. In order to refactor these built-in functions into more modern implementations and improve their interfaces, most of their APIs have been deprecated in 3.27.

These deprecations are divided into two parts. First of all, some parameters are essentially setting HTML attributes or handling events.Look This guide entry on old attribute parameters
A detailed list of deprecated parameters and migration paths.

Second, there is a set of parameters that are actually leaks of private implementations, or no longer have a clear meaning (or usefulness) in modern application development.Look This guide entry on legacy parameters Get a detailed list and migration path.

Deprecated Ember Global

Ember has already set a property window or globalThis Global so that it can be accessed by window.Ember, E.g. This method of using Ember is not compatible with static analysis tools, which may result in a more optimized application load.

In Ember 3.27, visit Ember It is not recommended to import objects through non-modules. Support for using Ember in this way will be removed in Ember 4.0.

Instead, the application should adopt the Ember module API.Which means import Ember Object or specific API from module API:

// Bad, deprecated
export default Ember.Component.extend({});
// Better
import Ember from 'ember';
export default Ember.Component.extend({});
// Best
import Component from '@ember/component';
export default Component.extend({});

Look Deprecation guide with RFC 706
More details and conversion paths for other use cases.

More information about the upgrade schedule

For application maintainers who wish to upgrade their application to Ember.js 4.0 on the release date, the deprecation list in this version means that their challenges are now clearly defined.Application maintainers should consider using
ember-cli-deprecated-workflow
After upgrading to 3.27, gradually solve the problem of deprecated plugins. ember-cli-deprecation-workflow 2.0 released Nowadays To prepare for solving Ember 3.x deprecated applications. Provide us with feedback about the repurchase issue.

For application maintainers who are not so anxious, Please note that the upcoming Ember.js 3.28 will not include the new deprecation for Ember.js 4.0In addition, Ember.js 3.28 will be upgraded to LTS on the same day that Ember.js 4.0 is released.

We recommend using the LTS version of the application to wait for the first LTS upgrade of Ember.js 4.x, which is Ember.js 4.4. Ember’s 6-week release cycle means that we expect the application to upgrade from LTS to LTS to resolve the deprecation issue for 4.0 will take approximately 44 weeks (from today) before Ember.js 4.4-LTS is available.

For more details about the changes in Ember.js 3.27, please check Ember.js 3.27.5 release page.


Embers data

Ember Data is the official data persistence library for Ember.js applications. The 3.27 version of Ember Data mainly includes compatibility with Ember.js.

For more details about the changes in Ember Data 3.27, please check
Ember Data 3.27.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.27

Ember CLI 3.27 introduced a flag to enable Embroider (Ember CLI’s new build pipeline) for new applications and plugins. E.g:

ember new my-app --embroider

Learn more about the features provided by Embroider and how to
Embroidery construction/embroidery Repurchase.

For more details about the changes and bug fixes in Ember CLI 3.27, please refer to Ember 2.7.0 update log
with Ember CLI 3.27.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 *