• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ember-cli-deprecation-workflow

An addon geared towards making Ember upgrades easier by allowing you to work through deprecations without massive console noise.

History

Upgrading Ember versions can be very daunting. One of the largest factors is the massive console.log noise that the deprecations introduced in those versions (to help us know what we need to do to stay up to date) is so overwhelming that we quite literally have no idea what to do.

The "deprecation spew" issue became very obvious as we progressed into the later 1.13 beta releases. At that point, @mixonic and @rwjblue came up with a wild scheme.

The scheme was to build tooling which made dealing with deprecations an incremental process. ember-cli-deprecation-workflow allows you to focus on addressing a single deprecation at a time, and prevents backsliding (re-introduction of a deprecated API use) in a codebase.

Usage

Compatibility

2.x

  • Ember.js 2.12 or above
  • Ember CLI 3.16 or above
  • Node.js 12 and 14 or above

1.x

  • Ember.js 1.13 until at least 3.4
  • Ember CLI 3.4 as well as many versions before and after
  • Node.js 6, 8, and 10 until at least 14

Getting started

The initial steps needed to get started:

  1. Install the ember-cli-deprecation-workflow addon (ember install ember-cli-deprecation-workflow).
  2. Run your test suite* with ember test --server.
  3. Navigate to your tests (default: http://localhost:7357/)
  4. Run deprecationWorkflow.flushDeprecations() from your browsers console.
  5. Copy the string output into config/deprecation-workflow.js in your project.

Once this initial setup is completed the "deprecation spew" should be largely "fixed". Only unhandled deprecations will be displayed in your console.

*Note: Unless your test coverage is amazing (>90%), it's likely that running the test suite alone will not reveal every deprecation. It may be prudent to run through the app's workflows live and flush deprecations a second time, merging the resulting output list with that generated from your test suite.

Now that the spew has settled down, you can process one deprecation at a time while ensuring that no new deprecations are introduced.

Workflow

What does that individual deprecation workflow look like?

  1. Change one entry in config/deprecation-workflow.js from silence to throw.
  2. Run your tests or use your application.
  3. Errors will be thrown for just that one deprecation, and you can track down the fixes needed in relative isolation of the rest of the deprecations.
  4. Once the deprecation has been dealt with, remove its entry from config/deprecation-workflow.js.
  5. Lather and repeat.

Handlers

There are 3 defined handlers that have different behaviors

Handler Behavior
silence Keeps this deprecation from spewing all over the console
log Normal deprecation behavior runs for this deprecation and messages are logged to the console
throw The error is thrown instead of allowing the deprecated behavior to run. WARNING: APPLICATION MAY GO πŸ’₯

Matchers

the output from running deprecationWorkflow.flushDeprecations() gives you a nice Json like JS object with all the deprecations in your app. The matchMessage property determines what to filter out of the console. You can pass a string that must match the console message exactly or a RegExp for ember-cli-deprecation-workflow filter the log by.

Production builds

By default, production ember-cli builds already remove deprecation warnings. Any deprecations configured to throw or log will only do so in non-production builds.

Enable / Disable through configuration

If your app has disabled test files in development environment you can force enabling this addon through configuration in ember-cli-build.js instead:

'ember-cli-deprecation-workflow': {
  enabled: true,
},

Catch-all

To force all deprecations to throw (can be useful in larger teams to prevent accidental introduction of deprecations), update your config/deprecation-workflow.js:

window.deprecationWorkflow.config = {
  throwOnUnhandled: true,
};

Template Deprecations

By default, the console based deprecations that occur during template compilation are suppressed in favor of browser deprecations ran during the test suite. If you would prefer to still have the deprecations in the console, add the following to your config/environment.js:

module.exports = function (env) {
  var ENV = {};

  // normal things here

  ENV.logTemplateLintToConsole = true;
};

Configuration

In some cases, it may be necessary to indicate a different config directory from the default one (/config). For example, you may want the flushed deprecations file to be referenced in a config directory like my-config.

Adjust the configPath in your package.json file. The / will automatically be prefixed.

{
  'ember-addon': {
    configPath: 'my-config'
  }
}

Contributing

Details on contributing to the addon itself (not required for normal usage).

See the Contributing guide for details.

License

This project is licensed under the MIT License.

More Repositories

1

ember-cli

The Ember.js command line utility.
JavaScript
3,261
star
2

ember-exam

Run your tests with randomization, splitting, and parallelization for beautiful tests.
JavaScript
286
star
3

ember-cli-update

Update Ember CLI projects
JavaScript
277
star
4

ember-twiddle

JSFiddle type thing for ember-cli style code
JavaScript
268
star
5

eslint-plugin-ember

An ESLint plugin that provides set of rules for Ember applications based on commonly known good practices.
JavaScript
260
star
6

ember-ajax

Service for making AJAX requests in Ember applications
JavaScript
213
star
7

ember-page-title

Page title management for Ember.js Apps
JavaScript
188
star
8

ember-try

An ember-cli addon to test against multiple npm dependencies, such as ember and ember-data.
JavaScript
179
star
9

ember-fetch

HTML5 fetch polyfill from github wrapped and bundled for ember-cli users.
JavaScript
176
star
10

ember-cli-mocha

Mocha and Chai tests for ember-cli applications
JavaScript
147
star
11

ember-cli-eslint

Ember CLI addon for linting Ember projects with ESLint
JavaScript
116
star
12

ember-new-output

Change history of new Ember-CLI apps
JavaScript
91
star
13

ember-resolver

JavaScript
87
star
14

broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
JavaScript
86
star
15

ember-rfc176-data

JSON data for Ember.js RFC #176
JavaScript
83
star
16

loader.js

minimal amd loader mostly stolen from wycats.
JavaScript
79
star
17

ember-cli-htmlbars

JavaScript
77
star
18

ember-template-imports

Template import support in Ember!
JavaScript
74
star
19

ember-cli-htmlbars-inline-precompile

πŸ“ƒ Precompile inline HTMLBars templates via ES6 tagged template strings
JavaScript
67
star
20

ember-cli-todos

JavaScript
67
star
21

babel-plugin-feature-flags

A babel transform for managing feature flags
JavaScript
57
star
22

ember-cli-app-version

Adds your app's version to Ember Inspector's Info tab
JavaScript
55
star
23

ember-cli-shims

DEPRECATED - ES6 import shims for Ember.js
JavaScript
46
star
24

ember-octane-blueprint

App and Addon blueprints for Ember Octane
JavaScript
46
star
25

rfcs

Archive of RFCs for changes to ember-cli (for current RFC repo see https://github.com/emberjs/rfcs)
45
star
26

ember-cli-babel-polyfills

Split-build polyfills for evergreen and legacy browsers
JavaScript
34
star
27

ember-cli-qunit

QUnit testing package for ember-cli applications
JavaScript
30
star
28

ember-compatibility-helpers

Helpers that allow you to write backwards compat Ember addons
JavaScript
24
star
29

ember-cli-version-checker

Dependency version checker for Ember CLI addons
JavaScript
24
star
30

broccoli-viz

library to read/parse and produce various visualizations of broccoli.
JavaScript
23
star
31

ember-cli-blueprint-test-helpers

Test helpers for testing ember-cli blueprints
JavaScript
23
star
32

ember-cli-terser

JavaScript minification for Ember-CLI
JavaScript
23
star
33

ember-cli-inject-live-reload

Ember CLI plugin that injects live-reload script into HTML content
JavaScript
22
star
34

ember-cli-chai

Chai assertions for Ember.js
JavaScript
21
star
35

babel-plugin-filter-imports

A babel transform for filtering out imports
JavaScript
18
star
36

broccoli-caching-writer

JavaScript
17
star
37

ember-addon-output

Change history of new Ember-CLI addons
JavaScript
16
star
38

core-object

JavaScript
16
star
39

babel-plugin-ember-modules-api-polyfill

Polyfill for Ember JS API
JavaScript
15
star
40

ember-load-initializers

JavaScript
14
star
41

console-ui

JavaScript
14
star
42

broccoli-es6modules

new es6 module transpiler
JavaScript
14
star
43

ember-export-application-global

JavaScript
14
star
44

babel-plugin-debug-macros

TypeScript
13
star
45

ember-cli.github.io

Our documentation site
SCSS
13
star
46

ember-router-generator

JavaScript
12
star
47

ember-welcome-page

Welcome page for Ember CLI applications
JavaScript
12
star
48

broccoli-terser-sourcemap

Broccoli filter to uglify with sourcemaps
JavaScript
10
star
49

broccoli-asset-rewrite

Broccoli plugin to rewrite a source tree from an asset map.
JavaScript
10
star
50

ember-cli-test-loader

JavaScript
10
star
51

ember-source-channel-url

JavaScript
10
star
52

stress-app

HTML
9
star
53

capture-exit

JavaScript
9
star
54

ember-next

A home for experiments that aim to become the defaults when running ember-new.
JavaScript
9
star
55

babel-plugin-htmlbars-inline-precompile

Babel plugin to replace tagged template strings with precompiled HTMLBars templates
JavaScript
9
star
56

broccoli-lint-eslint

Integrates JavaScript linting with ESLint as part of your Broccoli build pipeline.
JavaScript
8
star
57

blprnt

JavaScript
7
star
58

ember-cli-clean-css

CSS minification via clean-css for Ember CLI
JavaScript
6
star
59

exists-sync

Deprecated, please use fs.existsSync instead
JavaScript
6
star
60

ember-disable-prototype-extensions

Disables Ember's prototype extensions
JavaScript
6
star
61

silent-error

JavaScript
5
star
62

ember-cli-jshint

JSHint lint tests for your Ember CLI projects
JavaScript
5
star
63

create-ember-app

yarn create ember-app <name>
JavaScript
4
star
64

broccoli-middleware

Broccoli asset builder middleware
HTML
4
star
65

ember-cli-babili

JavaScript
4
star
66

ember-cli-update-codemods-manifest

Master list of codemods and their instructions used by ember-cli-update
JavaScript
4
star
67

amd-name-resolver

Algorithm for resolving AMD module names
JavaScript
3
star
68

ember-cli-string-utils

JavaScript
3
star
69

ember-cli-legacy-blueprints

Ember and Ember-Data specific blueprints for ember-cli projects not using the Ember and Ember-Data addons.
JavaScript
3
star
70

ember-cli-lodash-subset

JavaScript
2
star
71

ember-cli-default-packager

Default Packager for Ember CLI. More details in https://github.com/ember-cli/rfcs/pull/110.
TypeScript
2
star
72

codesandbox

Official Ember.js template for codesandbox.io
JavaScript
2
star
73

broccoli-amd-funnel

Funnel based on whether a module is AMD or not
JavaScript
1
star
74

broccoli-builder

JavaScript
1
star
75

calculate-cache-key-for-tree

ember-cli addon tree cache key builder
JavaScript
1
star
76

broccoli-funnel-reducer

JavaScript
1
star
77

app-blueprint-test

JavaScript
1
star
78

ember-cli-preprocess-registry

JavaScript
1
star
79

ember-cli-import-polyfill

Backports newer addon import API to older ember-cli versions.
JavaScript
1
star
80

node-modules-path

JavaScript
1
star
81

ember-build-utilities

A suite of build utilities for constructing Ember CLI build pipelines
JavaScript
1
star
82

ember-try-config

Config helper for ember-try
JavaScript
1
star
83

broccoli-config-replace

Simple templating using a config.json and regex patterns.
JavaScript
1
star
84

ember-cli-changelog

Tool used to generate changelogs for ember-cli.
JavaScript
1
star
85

create-ember-addon

yarn create ember-addon <name>
JavaScript
1
star