Skip to content

In SSR, Store Elements of Composites on the Stack for Warnings#10187

Merged
sebmarkbage merged 1 commit intofacebook:masterfrom
sebmarkbage:fixssrstack
Jul 19, 2017
Merged

In SSR, Store Elements of Composites on the Stack for Warnings#10187
sebmarkbage merged 1 commit intofacebook:masterfrom
sebmarkbage:fixssrstack

Conversation

@sebmarkbage
Copy link
Copy Markdown
Contributor

In DEV mode this keeps an additional sub-stack within the stack of the
server renderer. This substack keeps track of all the elements that we
resolved to get to to the next processing frame.

This lets us recreate the full composite component stack for warnings.
Normally the stack only contains host components.

We reset this every time we're going to resolve another sibling.

ReactDebugCurrentFrame.getCurrentStack = getStackAddendum;
};
var pushElementToDebugStack = function(element) {
if (currentDebugElementStack !== null) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I need this null check because this reset isn't reentrant so it might be reset. See follow up in #10188

Copy link
Copy Markdown
Collaborator

@acdlite acdlite left a comment

Choose a reason for hiding this comment

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

I don't have full context but this looks ok to me

In DEV mode this keeps an additional sub-stack within the stack of the
server renderer. This substack keeps track of all the elements that we
resolved to get to to the next processing frame.

This lets us recreate the full composite component stack for warnings.
Normally the stack only contains host components.

We reset this every time we're going to resolve another sibling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants