Repository navigation
Add better Transition debugging information. - #305
Merged
Merged
Conversation
Expose a few nice debugging tools when working with a transition:
```ts
interface Transition {
/**
In non-production builds, this function will return the stack that this Transition was
created within. In production builds, this function will not be present.
@method debugCreationStack
@return string
*/
debugCreationStack?: () => string | undefined;
/**
In non-production builds, this function will return the stack that this Transition was
aborted within (or `undefined` if the Transition has not been aborted yet). In production
builds, this function will not be present.
@method debugAbortStack
@return string
*/
debugAbortStack?: () => string | undefined;
/**
In non-production builds, this property references the Transition that _this_ Transition
was derived from or `undefined` if this transition did not derive from another. In
production builds, this property will not be present.
@Property debugPreviousTransition
@type {Transition | undefined}
*/
debugPreviousTransition: Maybe<Transition<T>>;
}
```
---
Note: I've confirmed that Ember's build pipeline properly replaces the
`if (DEBUG) {` bits with `true` and `false` as appropriate:
```js
if (true
/* DEBUG */
) {
var _error = new Error(`Transition creation stack`);
this.debugCreationStack = () => _error.stack;
this.debugPreviousTransition = previousTransition;
}
```
rwjblue
force-pushed
the
debugging-info
branch
from
September 9, 2020 17:44
c33fd6d to
8c06ca9
Compare
rwjblue
commented
Sep 9, 2020
Comment on lines
+49
to
+60
| [ | ||
| 'babel-plugin-debug-macros', | ||
| { | ||
| flags: [ | ||
| { | ||
| source: '@glimmer/env', | ||
| flags: { DEBUG: isDebug, CI: !!process.env.CI }, | ||
| }, | ||
| ], | ||
| }, | ||
| '@glimmer/env inlining', | ||
| ], |
Member
Author
There was a problem hiding this comment.
FWIW, this only affects the local tests (not what consumers use). Ember's build pipeline (as well as general Ember apps) uses nearly the same thing...
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.
Expose a few nice debugging tools when working with a transition:
Note: I've confirmed that Ember's build pipeline properly replaces the
if (DEBUG) {bits withtrueandfalseas appropriate: