GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support inner component _debugOwner in memo by hanq08 · Pull Request #18659 · react/react

Conversation

@hanq08

@hanq08 hanq08 commented Apr 17, 2020

Copy link
Copy Markdown
Contributor

Summary

Add _debugOwner to inner component of memo.
#18571

Test Plan

one test added. Not familiar with the react test tool. let me know if it's good thanks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@facebook-github-bot

facebook-github-bot commented Apr 17, 2020

Copy link
Copy Markdown
Contributor

Hi @hanq08!

Thank you for your pull request and welcome to our community.We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codesandbox-ci

codesandbox-ci Bot commented Apr 17, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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 51a00f0:

Sandbox Source
happy-silence-1eef1 Configuration
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sizebot

sizebot commented Apr 17, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against 51a00f0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sizebot

sizebot commented Apr 17, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against 51a00f0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hanq08
Support inner component _debugOwner in memo
803bdce
@hanq08
hanq08 force-pushed the master branch from eef0fcd to 803bdce Compare April 17, 2020 20:38
@facebook-github-bot facebook-github-bot added the CLA Signed label Apr 17, 2020
@facebook-github-bot

facebook-github-bot commented Apr 17, 2020

Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gaearon
gaearon reviewed Apr 17, 2020
View reviewed changes
Comment thread packages/react-reconciler/src/__tests__/ReactMemo-test.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

aweary
aweary reviewed Apr 17, 2020
View reviewed changes
Comment thread packages/react-reconciler/src/ReactFiberBeginWork.new.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/react-reconciler/src/__tests__/ReactMemo-test.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

hanq08 added 2 commits April 17, 2020 19:17
@hanq08
test with devtool context
68408a4
@hanq08
remove memo test
51a00f0
@hanq08
hanq08 requested review from aweary and gaearon April 18, 2020 04:18
@hanq08

hanq08 commented Apr 22, 2020

Copy link
Copy Markdown
Contributor Author

@aweary @gaearon could you have a look at this when available thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bvaughn bvaughn self-assigned this Jul 18, 2020
bvaughn
bvaughn reviewed Aug 7, 2020
View reviewed changes
Comment thread packages/react-devtools-shared/src/__tests__/__snapshots__/ownersListContext-test.js.snap
},
]
`;

@bvaughn bvaughn Aug 7, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This snapshot is out of date now. (Not your fault.) Rebasing on master would result in a snapshot delta of:

diff --git a/packages/react-devtools-shared/src/__tests__/__snapshots__/ownersListContext-test.js.snap b/packages/react-devtools-shared/src/__tests__/__snapshots__/ownersListContext-test.js.snap
index 7ef006fda..9b7609788 100644
--- a/packages/react-devtools-shared/src/__tests__/__snapshots__/ownersListContext-test.js.snap
+++ b/packages/react-devtools-shared/src/__tests__/__snapshots__/ownersListContext-test.js.snap
@@ -88,13 +88,17 @@ Array [
   },
   Object {
     "displayName": "Anonymous",
-    "hocDisplayNames": null,
+    "hocDisplayNames": Array [
+      "Memo",
+    ],
     "id": 3,
     "type": 8,
   },
   Object {
     "displayName": "Anonymous",
-    "hocDisplayNames": null,
+    "hocDisplayNames": Array [
+      "ForwardRef",
+    ],
     "id": 4,
     "type": 6,
   },

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/react-devtools-shared/src/__tests__/ownersListContext-test.js
done();
});

it('should include all owners for a component wrapped in react memo ', async done => {

@bvaughn bvaughn Aug 7, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit:

Suggested change
it('should include all owners for a component wrapped in react memo ', async done => {
it('should include all owners for a component wrapped in react memo', async done => {

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/react-reconciler/src/ReactFiberBeginWork.new.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/react-devtools-shared/src/__tests__/ownersListContext-test.js
Comment on lines +211 to +216
const InnerComponent = React.forwardRef((props, ref) => <div ref={ref} />);
const Memo = React.memo(InnerComponent);
const Grandparent = () => {
const ref = React.createRef();
return <Memo ref={ref} />;
};

@bvaughn bvaughn Aug 7, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

nit Let's use a named function so we don't see "Anonymous" in the tests?

Suggested change
const InnerComponent = React.forwardRef((props, ref) => <div ref={ref} />);
const Memo = React.memo(InnerComponent);
const Grandparent = () => {
const ref = React.createRef();
return <Memo ref={ref} />;
};
const InnerComponent = (props, ref) => <div ref={ref} />;
const ForwardRef = React.forwardRef(InnerComponent);
const Memo = React.memo(ForwardRef);
const Grandparent = () => {
const ref = React.createRef();
return <Memo ref={ref} />;
};

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bvaughn bvaughn assigned hanq08 Aug 7, 2020
@bvaughn

bvaughn commented Aug 7, 2020

Copy link
Copy Markdown
Contributor

I removed my previous comment because it seems to have been in error. Digging in more.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bvaughn bvaughn mentioned this pull request Aug 7, 2020
Support inner component _debugOwner in memo #19556
Merged
@bvaughn

bvaughn commented Aug 7, 2020

Copy link
Copy Markdown
Contributor

Moving things over to #19556 since I can't push to the branch this is based off of. Will land there.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bvaughn bvaughn closed this Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aweary aweary Awaiting requested review from aweary
@gaearon gaearon Awaiting requested review from gaearon
1 more reviewer
@bvaughn bvaughn bvaughn left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@bvaughn bvaughn

@hanq08 hanq08

Labels

CLA Signed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@hanq08 @facebook-github-bot @sizebot @bvaughn @gaearon @aweary
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.