Thursday, April 25, 2024
HomeJavaScriptEmber 3.14 Launched (Octane Preview Cont.)

Ember 3.14 Launched (Octane Preview Cont.)


The Ember mission has lately launched model 3.14 of Ember.js, Ember Knowledge, and Ember CLI. This kicks off the three.15 beta cycle for all sub-projects. We encourage our neighborhood (particularly addon authors) to assist check these beta builds and report any bugs earlier than they’re printed as a ultimate launch in six weeks’ time. The ember-try addon is a good way to repeatedly check your tasks in opposition to the newest Ember releases.

You possibly can learn extra about our common launch course of right here:


The Octane Preview, Continued

As described within the Octane Launch Replace, Octane will proceed to be opt-in in Ember 3.14. By persevering with the Octane preview interval in 3.14, we’re permitting extra time for Octane to be polished earlier than it turns into the default Ember expertise.

Though Octane continues to be opt-in in 3.14, all Octane options are steady public APIs with our regular SemVer ensures. When you construct an app utilizing APIs within the Octane preview, it would proceed to work in future variations.


Apart from an up to date launch of @glimmer/part, the steps to check out the Octane preview stay the identical in 3.14 as they have been in 3.13:

Add the next packages if they are not already current at this model:

npm set up --save-dev @ember/version-utils@^1.1.1
npm set up --save-dev @glimmer/part@^1.0.0-beta.1

Disable legacy habits by setting the next function flags:

ember function:allow template-only-glimmer-components
ember function:disable application-template-wrapper

Specify the Octane version in .ember-cli.js by including the next strains to the start of the file:

// .ember-cli.js
const { setEdition } = require("@ember/edition-utils");

setEdition("octane");

When you have an .ember-cli file as a substitute of an .ember-cli.js file, you may convert it by renaming it to .ember-cli.js, then taking the prevailing JSON object and assigning it to module.exports. For instance, you probably have an .ember-cli file with:

// .ember-cli
{
  "disableAnalytics": false
}

The equal .ember-cli.js file could be:

// .ember-cli.js
module.exports = {
  disableAnalytics: false
};

When you want extra data on how one can migrate away from these legacy options, take a look at the Octane launch plan weblog publish.


Ember.js

Ember.js is the core framework for constructing formidable net functions.

Modifications in Ember.js 3.14

Ember.js 3.14 is an incremental, backwards appropriate launch of Ember with bugfixes, efficiency enhancements, and minor deprecations. There’s one new function, no deprecations, and several other bugfixes on this model.

New Options (1)

@mannequin in Route Templates (1 of 1)

Route templates can now entry the route’s mannequin with @mannequin along with this.mannequin. By treating @mannequin as an argument, route templates higher parallel part templates. Moreover, the idea of educating a this context for templates could be delayed.

These motivations in addition to the detailed design of this function are described in RFC 523.

A template comparable to the next can now be refactored from utilizing this.mannequin:

{{!-- The mannequin for this route is the present consumer --}}

<div>
  Hello <img src="{{this.mannequin.profileImage}}" alt="{{this.mannequin.identify}}'s profile image"> {{this.mannequin.identify}},
  this can be a legitimate Ember template!
</div>

{{#if this.mannequin.isAdmin}}
  <div>Bear in mind, with nice energy comes nice duty!</div>
{{/if}}

To make use of @mannequin:

{{!-- The mannequin for this route is the present consumer --}}

<div>
  Hello <img src="{{@mannequin.profileImage}}" alt="{{@mannequin.identify}}'s profile image"> {{@mannequin.identify}},
  this can be a legitimate Ember template!
</div>

{{#if @mannequin.isAdmin}}
  <div>Bear in mind, with nice energy comes nice duty!</div>
{{/if}}

The guides will quickly be up to date to show the @mannequin type first-and-foremost.

Deprecations (0)

There are not any new deprecations in Ember.js 3.14.

For extra particulars on modifications in Ember.js 3.14, please evaluation the Ember.js 3.14.0 launch web page.


Ember Knowledge

Ember Knowledge is the official knowledge persistence library for Ember.js functions.

Modifications in Ember Knowledge 3.14

Ember Knowledge 3.14 comprises a lot of bugfixes, in addition to some documentation
cleanup, efficiency enhancements, and deprecations. Notable modifications are
described under.

Relationship Fetching Efficiency

Releases of Ember Knowledge since 3.4 include vital efficiency regressions for
fetching relationship by way of hyperlinks. Ember Knowledge 3.14 addresses lots of these
regressions, with efficiency enhancements of roughly 3.5X in some circumstances as
in contrast with v3.13.

Deprecations (1)

Default Adapters and Serializers (1 of 1)

Ember Knowledge 3.14 introduces deprecations for the default adapters and
serializers. The motivation for these deprecations is described in RFC
522
:

The adapter and serializer packages present reference implementations and base
courses that aren’t required for functions that implement their very own
following the required interfaces for adapters and serializers as outlined in
their respective base courses. Deprecating them permits us to simplify the
lookup sample and take away computerized injection and registration of doubtless
unused courses.

Along with eradicating use of initializer injection, this takes a big
step towards simplifying the conceptual mannequin for how one can decide what
adapter/serializer is in use. Eradicating the defaults forces app builders to
be extra cognizant about the kind of software stage considerations vs
model-specific considerations; they’ll now have to explicitly outline and use
particular adapters/serializers.

For extra particulars on modifications in Ember Knowledge 3.14, please evaluation the
Ember Knowledge 3.14.0 launch web page.


Ember CLI

Ember CLI is the command line interface for managing and packaging Ember.js functions.

Upgrading Ember CLI

You could improve Ember CLI with ease by utilizing the ember-cli-update mission:

npm set up -g ember-cli-update
ember-cli-update

This utility will enable you to replace your app or add-on to the newest Ember CLI model. You’ll in all probability encounter merge conflicts, through which the default habits is to allow you to resolve conflicts by yourself. For extra data on the ember-cli-update mission, see the github README.

Whereas it is suggested to maintain Ember CLI variations in sync with Ember and Ember Knowledge, this isn’t required. After updating ember-cli, you may preserve your present model(s) of Ember or Ember Knowledge by enhancing bundle.json to revert the modifications to the strains containing ember-source and ember-data.

Modifications in Ember CLI 3.14

Ember CLI 3.14 include some bugfixes, updates to blueprints, and one new deprecation.

“Classier” Blueprints

The blueprints for ember new and ember addon have been modernized to outline an software’s Utility and Router as native ES courses (i.e. class App extends Utility { ... } as a substitute of const App = Utility.lengthen({ ... })). Though each approaches are nonetheless legitimate and EmberObject is way from deprecated, this modification improves the consistency and approachability of contemporary Ember functions.

Deprecations (1)

MODULE_UNIFICATION flag (1 of 1)

Ember CLI 3.14 comprises a brand new deprecation for tasks that use the MODULE_UNIFICATION flag. This flag has all the time required utilizing canary variations of Ember and Ember CLI. Now that ember-source has turned off the function fully, apps can not allow the function in any respect.


For extra particulars on the modifications in Ember CLI 3.14 and detailed improve
directions, please evaluation the Ember CLI 3.14.0 launch web page.

Thank You!

As a community-driven open-source mission with an formidable scope, every of those releases function a reminder that the Ember mission wouldn’t have been doable with out your continued help. We’re extraordinarily grateful to our contributors for his or her efforts.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments