Add debug tooling babel plugins.#133
Merged
rwjblue merged 1 commit intoemberjs:masterfrom Apr 28, 2017
Merged
Conversation
stefanpenner
suggested changes
Apr 24, 2017
Member
stefanpenner
left a comment
There was a problem hiding this comment.
This looks awesome (but i did leave some nit-picks)
README.md
Outdated
|
|
||
| ### Debug Tooling | ||
|
|
||
| In order to allow addons to easily provide good development mode ergonomics (assertions, deprecations, etc) but |
README.md
Outdated
|
|
||
| // ...snip... | ||
| init() { | ||
| this._super.init.apply(this, arguments); |
Member
There was a problem hiding this comment.
Is it worth documenting how an addon would do this? This seems quite off the beaten path
Member
Author
|
Pushed an update for the two README tweaks that @stefanpenner mentioned... |
stefanpenner
suggested changes
Apr 27, 2017
|
|
||
| #### Debug Macros | ||
|
|
||
| To add convienient deprecations and assertions, consumers (in either an app or an addon) can do the following: |
Member
There was a problem hiding this comment.
can you add a bulleted list of available macros, or a link to where they are documented?
stefanpenner
approved these changes
Apr 28, 2017
Member
|
|
siva-sundar
pushed a commit
to siva-sundar/ember-cli-babel
that referenced
this pull request
Feb 11, 2021
Ensure logging filter for parallel stuff follows the existing convent…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ember-cli/rfcs#50 and the
@ember/debugportion of emberjs/rfcs#176.Below is the documentation being added to the README explaining the feature.
Debug Tooling
In order to allow addons to easily provide good development mode ergonomics (assertions, deprecations, etc) but still perform well in production mode ember-cli-babel automatically manages stripping / removing certain debug statements. This concept was originally proposed in ember-cli/rfcs#50, but has been slightly modified during implementation (after researching what works well and what does not).
Debug Macros
To add convienient deprecations and assertions, consumers (apps and/or addons) can do the following:
In testing and development environments those statements will be executed (and assert or deprecate as appropriate), but
in production builds they will be inert (and stripped during minification).
General Purpose Env Flags
In some cases you may have the need to do things in debug builds that isn't related to asserts/deprecations/etc. For
example, you may expose certain API's for debugging only. You can do that via the
DEBUGenvironment flag:In testing and development environments
DEBUGwill be replaced by the boolean literaltrue, and in production builds it will be replaced byfalse. When ran through a minifier (with dead code elimination) the entire section will be stripped.Disabling Debug Tooling Support
If for some reason you need to disable this debug tooling, you can opt-out via configuration.
In an app that would look like:
In an addon that would look like: