简体   繁体   English

如何使用 ember-2-legacy?

[英]How to use ember-2-legacy?

We have the post in the documentation for Ember 2.16 about addition deprecation ember-2-legacy :我们在 Ember 2.16 的文档中有关于添加弃用ember-2-legacy的帖子:

Ember 2 Legacy until: 3.4 id: ember-2-legacy Ember provides ember-2-legacy which is an addon to help app with deprecations during the transition from the 2.x series to 3.x. Ember 2 Legacy until: 3.4 id: ember-2-legacy Ember 提供了 ember-2-legacy,这是一个在从 2.x 系列过渡到 3.x 期间帮助应用程序弃用的插件。

https://deprecations.emberjs.com/v2.x/#toc_ember-2-legacy https://deprecations.emberjs.com/v2.x/#toc_ember-2-legacy

We also have some configuration in README:我们在 README 中也有一些配置:

In ember-cli-build.js you can specify a config for ember-2-legacy在 ember-cli-build.js 中,您可以为 ember-2-legacy 指定配置

https://github.com/emberjs/ember-2-legacy#what-deprecations-are-covered https://github.com/emberjs/ember-2-legacy#what-deprecations-are-covered

So, as I understand, if we specify some flag with false , like this:所以,据我了解,如果我们用false指定一些标志,如下所示:

new EmberApp(defaults, {
  'ember-2-legacy': {
    'enumerable-contains': false

then this particular feature will be off in ember app.那么这个特殊功能将在 ember 应用程序中关闭。

Should my App raise some error or notify me by console warning?我的应用程序应该引发一些错误还是通过控制台警告通知我? In general, I have a case of all flags false and all tests passed, so my question is: is it mean that my application has no those deprecations usage cases?一般来说,我有一个所有标志都为false并且所有测试都通过的情况,所以我的问题是:这是否意味着我的应用程序没有那些弃用用例?

Shall I keep ember-2-legacy with config in ember-cli-build.js til Ember upgrade 3.0我应该在ember-cli-build.js中保留ember-2-legacy的配置,直到 Ember 升级 3.0

or或者

case with no errors on CI build means that: my App already has no deprecation and I can remove this addon at all? CI构建没有错误的情况意味着:我的应用程序已经没有弃用,我可以完全删除这个插件吗?

ember-2-legacy should be installed after you upgrade to 3.0 . ember-2-legacy应该在升级到3.0安装。

If you have no deprecations on 2.18 you dont need it.如果您在2.18上没有弃用,则不需要它。 But if you for example use Ember.K which is deprecated on 2.18 you can upgrade to 3.0 and use ember-2-legacy with 'ember-k': true without having to remove the Ember.K code.但是,例如,如果您使用在2.18上已弃用的Ember.K ,您可以升级到3.0并将ember-2-legacy'ember-k': true一起使用,而无需删除Ember.K代码。

Which gives you time until ember 3.4 to remove the use of Ember.K .这使您有时间在 ember 3.4之前删除对Ember.K的使用。

So installing ember-2-legacy on ember 2.x should not do anything.所以在 ember 2.x上安装ember-2-legacy不应该做任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM