-
-
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 controls whether to perform extra bookkeeping needed to make the `captureRenderTree` work. This has to be set before the ember JavaScript code is evaluated. This is usually done by setting one of these... ``` window.EmberENV = { _DEBUG_RENDER_TREE: true }; ``` ``` window.ENV = { _DEBUG_RENDER_TREE: true }; ``` ...before the "vendor" `<script>` tag in `index.html`. Setting the flag after Ember is already loaded will not work correctly. It may appear to work somewhat, but fundamentally broken. This is not intended to be set directly. Ember Inspector will enable the flag on behalf of the user as needed. This flag is always on in development mode. The flag is off by default in production mode, due to the cost associated with the the bookkeeping work. 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 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 <[email protected]>
- Loading branch information
1 parent
865ffd0
commit 6f8b85c
Showing
29 changed files
with
2,456 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.