mercredi 10 février 2016

How do I turn off deprecateion warnings in ember.js 2.3?

I've seen this:

How to disable deprecation warnings in Ember.js?

and this:

http://ift.tt/1SgB0Br

and now my code looks like this:

//app.js
import Ember from 'ember';

import Resolver from 'ember-resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';

Ember.deprecate = () => {};
Ember.warn = function(i){};

and my environment file right now includes this:

EmberENV: {
      LOG_STACKTRACE_ON_DEPRECATION: false,
      FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. 'with-controller': true
      }
    },

This has gotten me half the results I wanted: the log stacktrace is gone, but I still get the one line deprecation warnings. While I will be using these warnings to as a guideline to refactor in the future, the logging of these deprecation warnings is interfering with my debugging process. I need them gone - temporarily. The source of these deprecations are most likely the libraries I use (legacy-controller, legacy-view, auth0, etc.) but regardless, I need to silence these warnings so that they do not pollute the console.

I'm using Ember 2.3, and I suspect the solutions I found (linked in this question) are for Ember 1.13.

Aucun commentaire:

Enregistrer un commentaire