




























The Ember project is excited to announce the release of Ember v7.0. Following Ember's Major Version Policy, the major includes only the removal of features that were deprecated until 7.0 as well as other bugfixes. This release of Ember.js means the previous version, 6.12, is now an LTS (Long Term Support) version.
When it comes to introducing new features, Ember generally aims to ship new features in minor releases, offering backwards compatibility for existing code at the same time as giving developers the chance to try out new capabilities. This approach reduces the challenges that teams face for major upgrades, compared to producing big, breaking, splashy major versions with lots of new features.
In Ember 6.x minor releases, we landed many notable features:
ember-source as a v2 addon, which enabled Embroider to consume ember-source directly.Embroider and Vite-based build system as the default.strict-mode (aka template-tag) component authoring format as the default.renderComponent API that allows rendering individual components without a full project.trackedArray, trackedObject, trackedMap, trackedSet, trackedWeakMap, and trackedWeakSet.Ember v6.8 was the biggest change to how an Ember project is built in recent memory. The Ember Core Teams have been working on the Embroider+Vite build system and the strict-mode-templates (a.k.a template-tag) for literal years, and this is the first version that we made them the default experience for newly generated Ember apps. Early adopters have been opting into these features for quite some time, but generating an app with Ember v6.8 (or newer) now gives you an incredibly modern developer experience 🎉
Along with these features, countless bugfixes, deprecations that cleared the way for future improvements, RFCs setting the stage for new features, in 6.x the community also:
glimmer-vm monorepo into ember.js to faciliate faster iteration on the rendering engine and the integration with ember.js.router.js repo into the ember.js repo to prepare for experimentation with a new router architecture and the implementation of the Route Manager RFCOIDC.broccoli and other dependencies in an ongoing effort to reduce the number of security vulnerabilities. Current vulnerability warnings are only a concern in development mode and should not be exploitable but are annoying.Thank you to all the contributors that helped make this major-version cycle possible!
The most common approach for upgrading to 7.0 is to upgrade your app to the last version of Ember 6, which is 6.12, resolve all deprecation warnings, and then upgrade to 7.0. If your app or addon runs with no deprecations in the latest release of 6.12, you should be able to upgrade to Ember 7 with no additional changes. Step-by-step directions are below.
If your app is at a much earlier version in the 6.x series, we recommend upgrading in steps across the LTS versions: 6.4, 6.8, and then 6.12.
Follow these steps in order:
Consider upgrading addons used in your app to the latest version that you can. This will reduce the uses of deprecated APIs in your dependencies.
Upgrade your project to the latest patch version of Ember 6.12.
Many projects can do this by running
npx ember-cli-update --to 6.12.
When upgrading across the 6.8 boundary, due to changes in the build system, you need to adjust the configuration for ember-cli.
Make sure your app builds successfully.
Resolve all deprecation warnings. These Deprecated APIs are removed in Ember 7.0. You may need to upgrade some of your addon dependencies if they are using deprecated APIs. See the Ember Deprecation Guide for more details about specific deprecations and how to resolve them. Applications that need to upgrade through several versions may want to consider isolating individual deprecations by using ember-cli-deprecation-workflow.
Make sure your app builds successfully and your test suite passes with no deprecations.
Upgrade your app to Ember 7.0. Again,
many developers can do this by running
npx ember-cli-update --to 7.0.
For help or advice along the way, visit Ember's forums or chat groups.
Ember.js 7.0 introduces no new public API. Instead, it comprises bug fixes and the breakage of previously deprecated public API from the 6.x cycle.
Ember.js 7.0 introduced no new deprecations. It removed all deprecations that were introduced before 6.10 and slated for removal in 7.0.
Ember 7.0 removes the following features deprecated during 6.x:
import Ember from 'ember'. See the RFC or deprecations in your project for a guide on replacement APIs.ember-source. This can be opted-into before 7.0 by using an optional feature: see the deprecation guide for more details. This also requires certain dependency updates.inject from @ember/service. It is now import { service } from '@ember/service'.For more details on how to resolve these deprecations in your app, see the deprecations guide.
Ember.js 7.0 includes many bug fixes, the following are some of the more notable ones:
this in explicit scope for the runtime template compiler.LinkTo inside inline SVG reloads your applicationdelete() returning true for non-existent entries{{#each}} runtime crash when array contains null/undefined items with keytrackedMap and trackedWeakMap reactivity for existing keysBrandedArray fix for Array-as-parent bug in destroyablesEmberArray.reduce to match native behavior<LinkTo>'s @current-when argument with nested routes containing dynamic segmentsEmber CLI 7.0 introduces no new public API, adds no new deprecations, and adds no new bugfixes. This release only adds an automatic breakage to previously deprecated public API from the 6.x cycle. This code will be cleaned up in future releases. You can read more about the deprecations in the deprecation guide
As a community-driven open-source project with an ambitious scope, each of these releases serves 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阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。