Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quest: Update deprecations to include since property #14811

Closed
5 tasks
locks opened this issue Jan 10, 2017 · 13 comments
Closed
5 tasks

Quest: Update deprecations to include since property #14811

locks opened this issue Jan 10, 2017 · 13 comments

Comments

@locks
Copy link
Contributor

locks commented Jan 10, 2017

Why

With the eventual introduction of Svelte builds, there will be a mechanism to say "strip out any code for deprecated features from 2.0 to 2.8". However, to enable this range-based decision, we need both the start of the range as well as the end, and we currently only have the end in the form of the until property passed to the deprecate() method.

How

Ways to find deprecations:

  • deprecate() method in the codebase
  • [DEPRECATE] and [DEPRECATION] tags in the CHANGELOG.

Let's see an example of how we'd do it for Ember.K:

Before:

    deprecate(
      'Ember.K is deprecated in favor of defining a function inline.',
      false,
      {
        id: 'ember-metal.ember-k',
        until: '3.0.0',
        url: 'http://emberjs.com/deprecations/v2.x#toc_code-ember-k-code'
      }
    );

After:

    deprecate(
      'Ember.K is deprecated in favor of defining a function inline.',
      false,
      {
        id: 'ember-metal.ember-k',
        since: '2.11.0',
        until: '3.0.0',
        url: 'http://emberjs.com/deprecations/v2.x#toc_code-ember-k-code'
      }
    );

What

Phase 1

Compile a list of all the deprecations present in the master branch.

Phase 2

Update deprecations to include a since field:

@tomdale
Copy link
Member

tomdale commented Jan 10, 2017

This looks good to me. First step for the quest issue is building a list of all the current deprecations in the code base.

@rwjblue
Copy link
Member

rwjblue commented Jan 10, 2017

We also need to update deprecate to require since flag. This will look similar to deprecation when options.until is not present and deprecation when options.id is not present.

@rwjblue
Copy link
Member

rwjblue commented Jan 10, 2017

Also, does this new public API require an RFC? For reference, the until an id options were introduced in emberjs/rfcs#65 (see final rendered version here).

@Serabe
Copy link
Member

Serabe commented Jan 13, 2017

I did an ag "deprecate\(" -l and reviewed file by file and got this list:

  • packages/container/lib/registry.js:768 `function deprecateResolverFunction
  • packages/container/lib/container.js
    • :147 lookupFactory review until field too
    • :564 and :571 in injectDeprecatedContainer for getter and setters in the defined property.
  • packages/ember/lib/index.js
    • :219 in Ember.K definition.
    • :254 in Ember.Backburnerdefinition
  • packages/ember-application/lib/system/application-instance.js:501 in ApplicationInstance.prototype container definition.
  • packages/ember-application/lib/system/engine.js:129 in runInitializers
  • packages/ember-application/lib/utils/validate-type.js:25 in validateType
  • packages/ember-debug/lib/deprecate.js:122, :134, :146 in deprecate
  • packages/ember-debug/lib/warn.js:46, :58 in warn
  • packages/ember-debug/tests/main_test.js deprecate test should be adapted
  • packages/ember-glimmer/lib/component.js:545 in init
  • packages/ember-glimmer/lib/components/link-to.js:764 in _getModels
  • packages/ember-glimmer/lib/make-bound-helper.js:52 in makeBoundHelper
  • packages/ember-glimmer/lib/utils/string.js:23 in getSafeString
  • packages/ember-metal/lib/binding.js:304,:309,:314 in fireDeprecation
  • packages/ember-metal/lib/events.js:85 in addListener
  • packages/ember-metal/lib/mixin.js
    • :674 in required
    • :751 in observer
    • :797 in _immediateObserver
  • packages/ember-metal/lib/transaction.js:10 in top level
  • packages/ember-routing/lib/system/dsl.js:92 in resource
  • packages/ember-routing/lib/system/router.js:1482 in appendLiveRoute
  • packages/ember-runtime/lib/mixins/-proxy.js
    • :116 in unknownProperty
    • :137 in setUnknownProperty
  • packages/ember-runtime/lib/mixins/action_handler.js
    • :198 in willMergeMixin
    • :220 in deprecateUnderscoreActions (getter)
  • packages/ember-runtime/lib/mixins/array.js:305 in contains
  • packages/ember-runtime/lib/mixins/controller_content_model_alias_deprecation.js:44 in willMergeMixin
  • packages/ember-runtime/lib/mixins/copyable.js:61 in frozenCopy
  • packages/ember-runtime/lib/mixins/enumerable.js:231 in contains
  • packages/ember-runtime/lib/mixins/freezable.js:74 in init
  • packages/ember-runtime/lib/mixins/registry_proxy.js:288 in buildFakeRegistryFunction
  • packages/ember-runtime/lib/system/string.js:98 in fmt
  • packages/ember-template-compiler/lib/plugins/deprecate-render-model.js:20 in transform
  • packages/ember-template-compiler/lib/plugins/deprecate-render.js:19 in transform
  • packages/ember-template-compiler/lib/plugins/transform-input-on-to-onEvent.js:53, :67, :86 in transform
  • packages/ember-template-compiler/lib/plugins/transform-old-binding-syntax.js:30 in transform
  • packages/ember-testing/lib/test/waiters.js:113 in generateDeprecatedWaitersArray
  • packages/ember-views/lib/mixins/view_support.js
    • :27 in oldAttrs
    • :36 in newAttrs
    • :270 in renderToElement
    • :500, :510, :520, :530 in init

@andyhot
Copy link

andyhot commented Feb 8, 2017

Hi all. Is anyone actively working on this? I'd like to take a stab at it since it should benefit my front-facing app. I also recently did the 1.11 -> canary upgrade so I have some familiarity with the deprecations. Is it just a matter of gathering the info here or would you accept normal PRs?

@locks
Copy link
Contributor Author

locks commented Feb 9, 2017

@andyhot we need a related RFC first, since this will impact the public API of the deprecate method. Except some news on that very soon.

@andyhot
Copy link

andyhot commented Feb 9, 2017

ok - i've started gathering since versions for those deprecations (and added a few more found by deprecateFunc) at https://gist.github.com/andyhot/0c574101afc3ff25f95469453447930f

@chadhietala
Copy link
Contributor

Why do we need this again? The way I did the initial pass at svelte was that Ember would provide something like this:

export const DEPRECATE_RENDER_HELPER = '2.10.0';

And then in the code you would do:

import { DEPRECATE_RENDER_HELPER } from '@ember/features';

if (DEPRECATE_RENDER_HELPER) {
  // all the deprecated code
}

The consumer of ember-source would then do:

svelte: {
  'ember-source': "2.15.0"
}

This will strip all deprecated code >=2.15.0.

@chadhietala
Copy link
Contributor

We need to strip more than just deprecate.

@andyhot
Copy link

andyhot commented Feb 9, 2017

I personally don't mind gathering the since versions - even if it ends up as an exercise. It already helped me appreciate the code more and perhaps it can even have a 'marketing' value.

I've already found there are 3 leftovers from 1.13 that you all probably are aware of (one from 1.13.0 and two from 1.13.3)

@btecu
Copy link
Contributor

btecu commented Feb 9, 2017

Any reason why @andyhot couldn't make a PR just for the missing since tags without the deprecate updates?

@Serabe
Copy link
Member

Serabe commented Mar 8, 2017

@btecu even if it is not for the svelte, it would still be useful.

@chadhietala
Copy link
Contributor

chadhietala commented Mar 24, 2017

Thanks everyone for the interest. I have created a new issue that supersedes this with the deprecation ids. Please see #15062 if you would like to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants