Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 16 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ addressing a single deprecation at a time, and prevents backsliding

### Compatibility

4.x

- Ember.js 3.28 until at least 6.10
- ember-auto-import, or embroider with webpack and vite

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the bit below here about enabling/disabling in ember-cli-build still apply?

How about the part about setting config via window.deprecationWorkflow

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

window.deprecationWorkflow still exists and works.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay -- but the enabling/disabling was removed with #222 as was excluding the code from prod (unless that moved somehow that I didn't notice?)

We should document guarding the import as an alternative.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ye, added towards the end of the readme

3.x

- Ember.js 3.28 until at least 5.4
Expand Down Expand Up @@ -55,7 +60,17 @@ addressing a single deprecation at a time, and prevents backsliding
3. In your `app/app.js`, do:

```js
import './deprecation-workflow';
import { macroCondition, isDevelopingApp, importSync } from '@embroider/macros';

// Will only import your deprecation-workflow file while isDevelopingApp is true
// and will be stripped from your build if isDevelopingApp is false
//
// If you want to always include deprecation-workflow,
// use:
// import './deprecation-workflow.js';
if (macroCondition(isDevelopingApp())) {
importSync('./deprecation-workflow.js'),
}
```

4. Run your test suite\* with `ember test --server`.
Expand Down Expand Up @@ -103,21 +118,6 @@ nice Json like JS object with all the deprecations in your app. The
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:
```javascript
'ember-cli-deprecation-workflow': {
enabled: true,
},
```

### Catch-all

To force all deprecations to throw (can be useful in larger teams to prevent
Expand All @@ -130,40 +130,6 @@ window.deprecationWorkflow.config = {
};
```

### 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 `app/environment.js`:

```javascript
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.

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

## Contributing

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