Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/shared/ReactTypeOfWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export type TypeOfWork =
| 15
| 16;

export const IndeterminateComponent = 0; // Before we know whether it is functional or class
export const FunctionalComponent = 1;
export const FunctionalComponentLazy = 2;
export const ClassComponent = 3;
export const ClassComponentLazy = 4;
export const FunctionalComponent = 0;
export const FunctionalComponentLazy = 1;
export const ClassComponent = 2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should have a big bold inline comment explaining the significance of 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know why I added the word "bold" 🤡

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think it'll be hard to miss any changes because they broke so much in internal tests (e.g. enzyme). We're also already very intentional about changing these constants.

If we merge this, it'll be just a temporary concession. We still have to "get our act together" later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still think an inline comment might be helpful to avoid situations like the one that just happened (person A changing this, and person B discovering a few days later that it causes a lot of churn)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think the one that just happened seemed pretty intentional 😈 We should still fix this. If you feel strongly please feel free to send PR with a comment you'd find valuable. Maybe something like // Dependencies: *. But I'm also wary of making it seem like these are untouchable.

export const ClassComponentLazy = 3;
export const IndeterminateComponent = 4; // Before we know whether it is functional or class
export const HostRoot = 5; // Root of a host tree. Could be nested inside another node.
export const HostPortal = 6; // A subtree. Could be an entry point to a different renderer.
export const HostComponent = 7;
Expand Down