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

Exclude forwardRef and memo from stack frames #18559

Merged
merged 1 commit into from Apr 9, 2020

Conversation

@sebmarkbage
Copy link
Member

@sebmarkbage sebmarkbage commented Apr 9, 2020

We can't patch the row with the new trick. So they won't be called Memo(Name) in the stack anymore.

We could give these their own "built-in" stack frame since they're conceptually HoCs. I.e.

  at Name
  at Memo

However, from a debugging perspective this is not very useful meta data and quite noisy. So I'm just going to exclude them.

@codesandbox
Copy link

@codesandbox codesandbox bot commented Apr 9, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e1885ab:

Sandbox Source
sweet-elion-wcqiv Configuration
@gaearon
Copy link
Member

@gaearon gaearon commented Apr 9, 2020

You kept forwardRef?

@@ -121,7 +121,7 @@ export function describeUnknownElementTypeFrameInDEV(
case REACT_FORWARD_REF_TYPE:
return describeFunctionComponentFrame(type.render, source, ownerFn);
case REACT_MEMO_TYPE:
return describeFunctionComponentFrame(type.type, source, ownerFn);

This comment has been minimized.

@sebmarkbage

sebmarkbage Apr 9, 2020
Author Member

This was also a bug because the inner one might not be a function.

<Outer inner={false} middle={false} outer={false} />,
<div>
<Outer inner={false} middle={false} outer={false} />
</div>,

This comment has been minimized.

@sebmarkbage

sebmarkbage Apr 9, 2020
Author Member

The warning no longer includes any stack because there's only a Memo. This triggers our internal warning about not expecting a stack on the warning. However, that's not realistic so let's test it with a stack.

@sizebot
Copy link

@sizebot sizebot commented Apr 9, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against e1885ab

@sebmarkbage
Copy link
Member Author

@sebmarkbage sebmarkbage commented Apr 9, 2020

I kept SimpleMemoComponent and ForwardRef in the Fiber describing thing but they just describe their function name. It's only one Fiber for both the function and wrapper. I removed Memo because it's not the actual function, the function is represented by its own Fiber as a child so it's already there.

For elements I was already doing this by only naming the function.

@gaearon
gaearon approved these changes Apr 9, 2020
We can't patch the row. We could give these their own "built-in" stack
frame since they're conceptually HoCs. However, from a debugging
perspective this is not very useful meta data and quite noisy. So I'm
just going to exclude them.
@sebmarkbage sebmarkbage force-pushed the sebmarkbage:fixmemo branch from 0face84 to e1885ab Apr 9, 2020
@sizebot
Copy link

@sizebot sizebot commented Apr 9, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against e1885ab

@sebmarkbage sebmarkbage merged commit cbab25b into facebook:master Apr 9, 2020
31 checks passed
31 checks passed
ci/circleci: NODE_ENV_production_yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: NODE_ENV_production_yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_NODE_ENV_production_yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_NODE_ENV_production_yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_build Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_build Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_build_prod Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_dom_fixtures Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_persistent Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_prod Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: RELEASE_CHANNEL_stable_yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/circleci: build_devtools_and_process_artifacts Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts_experimental Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: sizebot_experimental Your tests passed on CircleCI!
Details
ci/circleci: sizebot_stable Your tests passed on CircleCI!
Details
ci/circleci: yarn_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_flow Your tests passed on CircleCI!
Details
ci/circleci: yarn_lint Your tests passed on CircleCI!
Details
ci/circleci: yarn_lint_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_test Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build_devtools Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_build_prod Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_prod Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_www Your tests passed on CircleCI!
Details
ci/circleci: yarn_test_www_variant Your tests passed on CircleCI!
Details
ci/codesandbox Building packages succeeded.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.