In the present day the Ember mission is releasing model 4.5 of Ember.js and Ember CLI.
Model 4.4 of Ember is now promoted to LTS (Lengthy Time period Assist).
An LTS model of Ember continues to obtain safety updates for 9 launch cycles (54 weeks) and bugfixes for six cycles (36 weeks).
LTS releases sometimes happen each 4 minor variations.
The earlier LTS model of Ember was 3.28.
This launch kicks off the 4.5 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 revealed as a last launch in six weeks’ time. The ember-try addon is an effective way to constantly check your initiatives towards the newest Ember releases.
You may learn extra about our normal launch course of right here:
Ember.js
Ember.js is the core framework for constructing bold internet purposes.
Modifications in Ember.js 4.5
Ember.js 4.5 is an incremental, backwards suitable launch of Ember with bug fixes, efficiency enhancements, and minor deprecations.
Bug Fixes
Ember.js 4.5 launched 0 bug fixes.
Options
Ember.js 4.5 launched 2 new options.
- Plain operate as helpers
- A brand new
renderSettled
check helper
1. Plain capabilities as helpers
Now you can use plain capabilities as helpers in your part templates. This helps make the connection between Ember part templates and their JavaScript class extra intuitive.
For instance, right here we create a way double
and use it immediately in a template:
// my-component.js
import Element from '@glimmer/part';
export default class MyComponent extends Element {
double = num => num * 2;
}
// my-component.hbs
{{this.double 2}}
<SomeComponent @foo={{this.double 2}} />
Beforehand, you may outline this domestically, however nonetheless needed to use the helper()
operate to perform this.
We’re engaged on updating the Guides to cowl this sample.
For background, try RFC 756, which designed this function.
Additionally, preserve your eyes on this weblog: we could have a devoted weblog submit with a deep dive on this new functionality within the subsequent week or two!
2. A brand new renderSettled
check helper
Below the hood, Ember’s exams use a “check waiters” system to help you management the movement of your exams by way of the precise framework habits.
That method that your exams match precisely what the app does at runtime.
Nonetheless, making this work relies on Ember offering all the required hooks for check helpers to make use of, and there was one important lacking public API.
You can look forward to all of the check waiters to complete with settled
, however there was no public approach to look forward to simply rendering to complete.
For instance, you may need to look forward to rendering to complete however not for an Ember Knowledge save
operation to complete, as a part of testing a loading display screen.
Ember 4.5 introduces a brand new operate, renderSettled
, as a public method for check helpers to work together with the rendering part of the applying.
renderSettled
returns returns a promise which fulfills as quickly as rendering has accomplished.
It may be utilized in any rendering or software check.
(It additionally works in different exams the place you arrange the rendering hooks manually, however that is uncommon!)
import { renderSettled } from '@ember/renderer';
An latest launch of @ember/test-helpers
, v2.8.0, takes benefit of this to offer a brand new await rerender()
helper.
For extra particulars, and the way this matches into enhancements to Ember’s testing story, see RFC 785.
Deprecations
Ember.js 4.5 launched 0 deprecations.
For extra particulars on adjustments in Ember.js 4.5, please overview the Ember.js 4.5.0 launch web page.
Ember Knowledge
Ember Knowledge is the official information persistence library for Ember.js
Attributable to low availability for the Ember Knowledge group this cycle, Ember Knowledge doesn’t have a brand new launch, so it stays at 4.4.
Please see the Ember 4.4 launch weblog submit for particulars about v4.4
of Ember Knowledge.
Ember CLI
Ember CLI is the command line interface for managing and packaging Ember.js purposes.
Upgrading Ember CLI
You could improve Ember CLI utilizing the ember-cli-update
mission:
npx ember-cli-update
This utility will assist you to to replace your app or addon 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’s endorsed 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 modifying bundle.json
to revert the adjustments to the strains containing ember-source
and ember-data
.
Modifications in Ember CLI 4.5
Bug Fixes
Ember CLI 4.5 launched quite a lot of small bug fixes and documentation enhancements.
You’ll find the total checklist within the Ember CLI 4.5.0 launch web page.
Options
Ember CLI 4.5 launched 0 options.
Deprecations
Ember CLI 4.5 launched 2 deprecations.
- Utilizing the phrases
whitelist
andblacklist
construct choices are deprecated. Please use
embrace
andexclude
as an alternative. Solely the title of the choice has modified, and
the performance is unchanged. This work so as to add the
new choice naming was initially deliberate in
RFC 639,
and the deprecation RFC is
RFC 801. - Assist for
ember-cli-jshint
is deprecated.
The addonJsFiles
methodology that was beforehand deprecated in v3.13
of Ember CLI has now been eliminated.
For extra particulars on the adjustments in Ember CLI 4.5 and detailed improve
directions, please overview the Ember CLI 4.5.0 launch web page.
Thank You!
As a community-driven open-source mission with an bold scope, every of those releases serves as a reminder that the Ember mission wouldn’t have been potential with out your continued assist. We’re extraordinarily grateful to our contributors for his or her efforts.