Skip to content

Commit ba98f36

Browse files
committed
Includes macros in first example
1 parent 84c0803 commit ba98f36

1 file changed

Lines changed: 11 additions & 22 deletions

File tree

README.md

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,17 @@ addressing a single deprecation at a time, and prevents backsliding
6060
3. In your `app/app.js`, do:
6161

6262
```js
63-
import './deprecation-workflow';
63+
import { macroCondition, isDevelopingApp, importSync } from '@embroider/macros';
64+
65+
// Will only import your deprecation-workflow file while isDevelopingApp is true
66+
// and will be stripped from your build if isDevelopingApp is false
67+
//
68+
// If you want to always include deprecation-workflow,
69+
// use:
70+
// import './deprecation-workflow.js';
71+
if (macroCondition(isDevelopingApp())) {
72+
importSync('./deprecation-workflow.js'),
73+
}
6474
```
6575

6676
4. Run your test suite\* with `ember test --server`.
@@ -108,27 +118,6 @@ nice Json like JS object with all the deprecations in your app. The
108118
pass a string that must match the console message exactly or a `RegExp` for
109119
`ember-cli-deprecation-workflow` filter the log by.
110120

111-
### Production builds
112-
113-
By default, production ember-cli builds already remove deprecation warnings. Any
114-
deprecations configured to `throw` or `log` will only do so in non-production
115-
builds.
116-
117-
### Enable / Disable
118-
119-
inclusion of `ember-cli-deprecation-workflow` is controlled by imports, so if there is an environment that you wish to disable `ember-cli-deprecation-workflow` in, that can be controlled via `@embroider/macros` conditions
120-
121-
```js
122-
// app.js
123-
import { macroCondition, isDevelopingApp, importSync } from '@embroider/macros';
124-
125-
// Will only import your deprecation-workflow file while isDevelopingApp is true
126-
// and will be stripped from your build if isDevelopingApp is false
127-
if (macroCondition(isDevelopingApp())) {
128-
importSync('./deprecation-workflow.js'),
129-
}
130-
```
131-
132121
### Catch-all
133122

134123
To force all deprecations to throw (can be useful in larger teams to prevent

0 commit comments

Comments
 (0)