-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Introduce debug render tree
1. Before loading Ember, set `ENV._DEBUG_RENDER_TREE = true;` This has to be set before the ember JavaScript code is evaluated (i.e. before the vendor `<script>` tag). This is usually done by setting `window.EmberENV` or `window.ENV`. Setting the flag *after* Ember is already loaded will not work correctly (it may appear to work somewhat, but fundamentally broken). This flag is on by default in development mode. For production, the expected flow is that Ember Inspector will ask the user to refresh the page after enabling the feature. It could also offer a feature where the user add some domains to the "always on" list. In either case, Ember Inspector will inject the code on the page to set the flag if needed. 2. With the flag on, `Ember._captureRenderTree()` is available. It takes the *application instance* as an argument and returns an array of `CapturedRenderNode`: ```typescript export interface CapturedRenderNode { type: 'outlet' | 'engine' | 'route-template' | 'component'; name: string; args: { positional: unknown[]; named: Dict<unknown>; }; instance: unknown; bounds: Option<{ parentElement: Simple.Element; firstNode: Simple.Node; lastNode: Simple.Node; }>; children: CapturedRenderNode[]; } ``` Co-authored-by: Yehuda Katz <wycats@gmail.com>
- Loading branch information
1 parent
865ffd0
commit 1ab8536
Showing
29 changed files
with
2,421 additions
and
131 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.