Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] Integrate DebugRenderTree #1192

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

pzuraq
Copy link
Member

@pzuraq pzuraq commented Nov 10, 2020

Integrates the DebugRenderTree into Glimmer VM directly, so it doesn't
have to be managed by individual component managers.

Major changes:

  1. getDebugRenderTreeName API added if managers need to override the
    name provided by getDebugName
  2. getCustomDebugRenderTree API added, allows managers like outlet
    and mount to specify custom render trees via a list of render nodes.
  3. TemplateOnly components can now integrate in the render tree without
    having to optionally have createArgs or createInstance
    capabilities.

Breaking changes:

  • env.debugRenderTree has been made optional, it could potentially be undefined and will not assert if it is not
  • DebugRenderTree#setTemplate has been removed

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems good, a few high level questions though:

  • Can you add tests for this using the highest level APIs possible? (rendering a tree of things, asserting on the deep state of the render tree)
  • Can you make a draft PR to Ember showing the integration side (so we can get a feel for how it looks over there)?
  • Can you update the PR description to be clearer about what specifically is breaking (e.g. these props / classes were removed/renamed/etc)?

@pzuraq
Copy link
Member Author

pzuraq commented Nov 12, 2020

Here is the integration PR in Ember: emberjs/ember.js#19261

Integrates the DebugRenderTree into Glimmer VM directly, so it doesn't
have to be managed by individual component managers.

Major changes:

1. `getDebugRenderTreeName` API added if managers need to override the
  name provided by `getDebugName`
2. `getCustomDebugRenderTree` API added, allows managers like `outlet`
  and `mount` to specify custom render trees via a list of render nodes.
3. TemplateOnly components can now integrate in the render tree without
  having to optionally have `createArgs` or `createInstance`
  capabilities.
@pzuraq pzuraq force-pushed the integrate-debug-render-tree-into-vm branch from f434e15 to d3d097d Compare November 12, 2020 00:49
Comment on lines +133 to +135
if (didError !== true) {
endTrackingTransaction!();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a tad surprising, since runInTrackingTransaction always calls beginTrackingTransaction why wouldn't it always call endTrackingTransaction?

Is it because we already call resetTracking (basically in our callsite)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly that. With the current structure of things, there is a case where this can happen unfortunately. I think we can work on restructuring it in the future to make it a bit more bulletproof.

@pzuraq pzuraq merged commit c284e26 into master Nov 12, 2020
@pzuraq pzuraq deleted the integrate-debug-render-tree-into-vm branch November 12, 2020 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants