

























Updated on December 19, 2017 to include information about Ember.js 2.8-LTS.
Today the Ember project is releasing version 2.15.0 of Ember.js, Ember Data, and Ember CLI.
This release kicks off the 2.16 beta cycle for all sub-projects. We encourage our community (especially addon authors) to help test these beta builds and report any bugs before they are published as a final release in six weeks' time. The ember-try addon is a great way to continuously test your projects against the latest Ember releases.
This release also marks the conclusion of critical bugfixes support for Ember.js 2.8-LTS, which was released in October 2016. We strongly recommend LTS users to migrate to 2.12-LTS immediately. 2.8-LTS will continue to receive security patches for another four releases (around May 2017).
At the same time, this release also concludes security patch support for Ember.js 2.4-LTS, which was released in April of 2016.
We're pleased with the impact of LTS releases on the Ember project and look forward to continuing the practice.
You can read more about our general release process here:
Ember.js is the core framework for building ambitious web applications.
Ember.js 2.15.0 is an incremental, backwards compatible release of Ember with bug fixes, performance improvements, and minor deprecations.
Initial support for the public router service API (described in RFC #95) is included in this release. The effort on this feature has been split into two phases:
Phase 1 is completed in 2.15.0.
'router'.currentRouteName,
currentURL, location, and rootURL on the service.transitionTo and replaceWith as methods on the service.urlFor to the service for generating URLs based on a
route name and models.An example of this API would be to transition to another route from a component:
import Ember from 'ember';
export default Ember.Component.extend({
router: Ember.inject.service(),
actions: {
save(model) {
model.save().then(() => {
if (this.isDestroyed) { return; }
this.get('router').transitionTo('index');
});
}
}
});
For more details on these APIs see the RouterService API documentation.
Phase 2 is pending implementation of the new public RouteInfo API. It is
not included in Ember 2.15.0.
isActive, recognize, and
recognizeAndLoad.willTransition and didTransition router hooks (not the
route actions of the same name). Replace them with events emitted by the
router service which have improved timing and public API arguments:
routeWillChange and routeDidChange.Addons that wish to use the router service API and support Ember releases prior to 2.15.0 should consider the ember-router-service-polyfill.
{{mount}} helper model argumentEmber 2.15.0 implements
RFC #225 with some minor tweaks. The {{mount}}
helper, used to invoke an Ember engine, now accepts the named argument of
model for an engine's application controller.
For example, in an application you might pass some values from a template:
<div>
<h1>Application template!</h1>
{{mount 'admin' model=(hash
title='Secret Admin'
signInButton=(component 'sign-in-button')
)}}
</div>
And in an engine access those values on the model property:
{{!-- admin/app/templates/application.hbs --}}
<h2>Admin area: {{model.title}}</h2>
<div>
Please sign in: {{model.signInButton}}
</div>
Other changes include:
_lookupFactory has been removed in this release. See
the deprecation
guide
for details about moving away from this API.(component helper.No new deprecations are included in Ember 2.15.0
For more details on changes in Ember.js 2.15.0, please review the Ember.js 2.15.0 release page.
Ember.js 2.16-beta continues to improve the framework with minor bug fixes. Additionally there is a major change in conventional usage coming in 2.16.
In Ember.js 2.16 the recommended way to access framework code in Ember applications will be via the JavaScript modules API described in RFC #176. For example this basic component definition in 2.15.0:
import Ember from 'ember';
export default Ember.Component.extend({
session: Ember.inject.service(),
title: 'The Curious Case'
});
Would in 2.16 conventions be written as:
import { inject as service } from '@ember/service';
import Component from '@ember/component';
export default Component.extend({
session: service(),
title: 'The Curious Case'
});
JavaScript modules make the framework easier to document, make the distinction between public and private API much easier to maintain, and provide opportunities for performance work such as tree-shaking. Adopting a new convention for importing the framework is a big task that impacts application code, documentation, generators/blueprints, and more.
To help us test the migration path, existing applications can move to adopt the new import style immediately. Using 2.16-beta of Ember is suggested, but not actually required. To update an application:
'ember' package to
the new modules, updating files in place.npm install ember-modules-codemod -g
cd my-ember-app
ember-modules-codemod
You're using the new import API!
Many applications use the
ember-cli-shims
package. This provides the module for import Ember from 'ember'. It also
provides an earlier design of Ember's module API. This package continues
to work, however in 2.16 it will no longer be a dependency for new
Ember applications.
The eslint-plugin-ember package provides a linting rule that can remove usage of the legacy modules provided by ember-cli-shims. To run this follow these steps:
.eslintrc.js appropriately.
For more detailed instructions, see this excellent blog post:
How To Use Ember’s New Module Import Syntax Today./node_modules/.bin/eslint --fix to convert ember-cli-shims module usage to plain 'ember'
imports.By trying these migration steps on your applications, you can provide valuable feeback to improve the final process announced with 2.16.
To prepare your addons for Ember 2.16, we encourage you to take the following steps during the beta cycle:
addon/ and test/ directories.app/ and test-support/ directories (both part of the dependent
app's build) contain only re-exports.This will ensure applications have a path forward in 2.16 to drop ember-cli-shims from their dependencies.
If you have questions please join us in #-ember-cli on the Ember.js
Community Slack.
One new deprecation is introduced in Ember.js 2.16-beta:
content
that aliases the model property. Relying on this legacy behavior is
deprecated and will be unsupported in Ember 2.17. See the
deprecation guide
for more details.For more information on the upcoming changes in Ember.js 2.16, please review the Ember.js 2.16.0-beta.1 release page.
Ember Data is the official data persistence library for Ember.js applications.
Ember Data 2.14 contained a number of performance improvements summarized in the 2.14 release post. Most of the development effort in the beta cycle has been to address regressions introduced by those changes. 2.15.0 contains no new features or deprecations, but does include the same bugfixes as can be found in 2.14.11.
For details on changes in Ember Data 2.15.0, please review the Ember Data 2.15.0 release page.
Ember CLI is the command line interface for managing and packaging Ember.js applications.
You may upgrade Ember CLI separately from Ember.js and Ember Data! There is a new experimental tool for Ember CLI upgrades called ember-cli-update. To use it, run this command to install it globally:
npm install -g ember-cli-update
Then run:
ember-cli-update
It runs your system git merge tool if it finds a conflict. This can be pretty overwhelming for beginners, so you can run
ember-cli-update --ignore-conflicts
to handle the conflicts yourself.
If this new tool is giving you problems, you can still upgrade your projects
manually. To upgrade your projects using yarn run:
yarn upgrade ember-cli
To upgrade your projects using npm run:
npm install --save-dev ember-cli
After running the
upgrade command run ember init inside of the project directory to apply the
blueprint changes. You can preview those changes for applications
and addons.
Ember CLI will configure new apps to run tests in headless Chrome by default, instead of PhantomJS.
PhantomJS has served the wider JavaScript community well for a long time, being a practical alternative to running browsers headless via tools like Xvbf. It has, however, been a proxy for what we really want to test– the browsers that users are running.
Now that we can test in headless Chrome, the motivation for using PhantomJS has diminished, and as a result it is no longer actively maintained.
Ember CLI has an API for importing individual files into the built assets, by
calling app.import within ember-cli-build.js. This API now supports
importing files from within node_modules, making it easier to consume
dependencies using only npm, rather than a more complicated mix of npm and
bower.
Per the Ember CLI Node.js version support policy, Ember CLI officially supports Node 8 as the active Node.js version and will continue to do so throughout its upcoming Active LTS window.
As part of this support, Ember CLI will no longer report warnings when run under Node 8.
The improved error messages promised in the 2.14.0 release blog post is shipping with Ember CLI 2.15.0. No more checking the console for template compilation errors 🎉!
Work has begun on internal changes to support tree-shaking. This is still in its early stages but is a focus of current development.
For more details on the changes in Ember CLI 2.15 and detailed upgrade instructions, please review the Ember CLI 2.15.0 release page.
Ember CLI 2.16.0 will support addon import transformations via
importTransforms, an implementation of RFC 108.
This allows addons to register custom transformations to be run for vendor
resources included via app.import. This is an advanced feature for addon
authors. It is particularly useful for
FastBoot to allow FastBoot-aware
addons to use a declarative API for conditionally importing code in Node.js or
browser environments.
Thanks to @kratiahuja for proposing and implementing this feature.
For more details on the changes in Ember CLI 2.16.0-beta.1 and detailed upgrade instructions, please review the Ember CLI 2.16.0-beta.1 release page.
As a community-driven open-source project with an ambitious scope, each of these releases serve as a reminder that the Ember project would not have been possible without your continued support. We are extremely grateful to our contributors for their efforts.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。