Friday, April 26, 2024
HomeJavaScriptEmber 3.20 Launched

Ember 3.20 Launched


As we speak the Ember undertaking is releasing model 3.20 of Ember.js, Ember Knowledge, and Ember CLI. This launch of Ember.js is an LTS (Lengthy Time period Assist) candidate. LTS candidates prioritize stability over the addition of latest options, and have an prolonged help schedule.

This launch kicks off the three.21 beta cycle for all sub-projects. We encourage our group (particularly addon authors) to assist check these beta builds and report any bugs earlier than they’re revealed as a last launch in six weeks’ time. The ember-try addon is an effective way to constantly check your tasks towards the most recent Ember releases.

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


Ember.js

Ember.js is the core framework for constructing bold internet functions.

Modifications in Ember.js 3.20

Ember.js 3.20 is an incremental, backwards appropriate launch of Ember with bugfixes, efficiency enhancements, and minor deprecations.

Builders who improve their Ember apps to v3.20 also needs to replace @glimmer/part to v1.0.1 to keep away from a deprecation warning that comes from the @glimmer/part bundle’s use of a personal API.

New Options (1)

{{in-element}}

Have you ever ever wished you might render a part someplace exterior of the same old HTML circulation? To assist with this, Ember.js now supplies the {{in-element}} helper as public API. When you’ve got used group addons like ember-wormhole or ember-elsewhere, you might be most likely accustomed to the problem that {{in-element}} goals to resolve.

To make use of the helper, go in a DOM aspect to focus on (this.myDestinationElement within the instance beneath) and a block to render:

{{#in-element this.myDestinationElement}}
  <div>Some content material</div>
{{/in-element}}

This new public API behaves a little bit in a different way from the non-public API:

  • For the general public API {{in-element}}, by default, the rendered content material will substitute all of the content material of the vacation spot, successfully changing into its innerHTML. If you’d like it to be appended as an alternative of changing the content material, you’ll be able to go in insertBefore=null.
  • Within the non-public API {{-in-element}}, the rendered content material was appended to any present content material within the vacation spot.

Builders ought to use the general public API, {{in-element}}, and discontinue utilizing {{-in-element}}.

See RFC 287 for extra details about the motivation for this new function.

Deprecations (1)

Meta.prototype.setSourceDestroyed and Meta.prototype.setSourceDestroying

Earlier variations of the @glimmer/part bundle relied on this intimate API, which is now deprecated.
To resolve deprecation warnings in your personal apps and addons, replace your model of @glimmer/part to not less than v1.0.1.

Deprecations are added to Ember.js when an API shall be eliminated at a later date. Every public API deprecation has an entry within the deprecation information describing the migration path to a extra secure API. Deprecated public APIs are usually not eliminated till a serious launch of the framework.

Think about using the ember-cli-deprecation-workflow addon if you need to improve your software with out instantly addressing deprecations.

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


Ember Knowledge

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

Modifications in Ember Knowledge 3.20

Along with a brand new function, this launch additionally contains some efficiency optimizations for visiting relating data and updating has-many relationships.

New Options (1)

isEmbeddedRecordsMixinCompatible

Beforehand, for those who used the EmbeddedRecordsMixin and JSONAPISerializer collectively, the app would present a warning that this mixture didn’t work.
Nonetheless, some builders might have APIs that will have theoretically been appropriate.
For these use circumstances, now you can set this.isEmbeddedRecordsMixinCompatible = true within the serializer, and you’ll not see the warning.

For apps that mistakenly use the EmbeddedRecordsMixin and JSONAPISerializer collectively, with out setting the boolean, the app will now assert as an alternative of warn.

Deprecations (0)

No new deprecations launched in Ember Knowledge 3.20.

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


Ember CLI

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

Upgrading Ember CLI

You might improve Ember CLI simply utilizing the ember-cli-update undertaking:

npx ember-cli-update

This utility will assist you to replace your app or addon to the most recent Ember CLI model. You’ll most likely encounter merge conflicts, wherein the default conduct is to allow you to resolve conflicts by yourself. For extra info on the ember-cli-update undertaking, see the GitHub README.

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

Modifications in Ember CLI 3.20

New Options (1)

Syncing Blueprints

Apps and addons can replace the ember-cli model of their app with out impacting future ember-cli-update runs.

Earlier than this new function, ember-cli-update used the present model of ember-cli within the bundle.json to find out which model to try to replace from. Sadly, that meant that for those who have been to replace your ember-cli model with out additionally operating the total blueprint replace, you’d have a a lot more durable time updating your common undertaking construction sooner or later.

See the Syncing Blueprints RFC to study extra in regards to the motivation and design of this function!

Deprecations (2)

  • Utilization on Node 13 will now subject a warning
  • Utilization of the PACKAGER experiment is deprecated. This solely impacts apps that opted into setting the EMBER_CLI_PACKAGER atmosphere variable.

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

Thank You!

As a community-driven open-source undertaking with an bold scope, every of those releases serves as a reminder that the Ember undertaking 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