Skip to content

Conversation

@acdlite
Copy link
Collaborator

@acdlite acdlite commented Mar 10, 2023

I updated some of the Float tests that intentionally trigger an error to assert on the specific error message, rather than swallow any errors that may or may not happen.

@acdlite acdlite requested a review from gnoff March 10, 2023 22:22
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 10, 2023
I updated some of the Float tests that intentionally trigger an error
to assert on the specific error message, rather than swallow any errors
that may or may not happen.
@acdlite acdlite force-pushed the float-tests-check-error-message branch from 7c79b97 to 7e5fa1b Compare March 10, 2023 22:22
Copy link
Member

@kassens kassens left a comment

Choose a reason for hiding this comment

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

Nice

@react-sizebot
Copy link

Comparing: 93c10df...7e5fa1b

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 156.85 kB 156.85 kB = 49.61 kB 49.61 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 158.86 kB 158.86 kB = 50.29 kB 50.29 kB
facebook-www/ReactDOM-prod.classic.js = 539.31 kB 539.31 kB = 95.93 kB 95.93 kB
facebook-www/ReactDOM-prod.modern.js = 523.17 kB 523.17 kB = 93.62 kB 93.62 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 7e5fa1b

Comment on lines +376 to +382
expect(aggregateError.errors.length).toBe(2);
expect(aggregateError.errors[0].message).toContain(
'Invalid insertion of NOSCRIPT',
);
expect(aggregateError.errors[1].message).toContain(
'The node to be removed is not a child of this node',
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can remove the !DEV gate too now

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Huh I was wondering why the negative flag check wouldn't have caught that and it's because enableFloat is true in all our builds, so the combined gate condition is always true. Can we just clean up the flag now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Given that this already rolled out at Meta I vote for landing the enableFloat flag and removing the associated gates from all our tests. Can do in a follow up.

@gnoff
Copy link
Collaborator

gnoff commented Mar 10, 2023

I wonder if it is worth asserting those DOMException errors. The tests are really concerned with the warnings, not the specific error pathways. But I suppose it doesn't hurt and it might surface if some really strange new error starts to show up. Up to your intuition I think but I would maybe remove

@acdlite
Copy link
Collaborator Author

acdlite commented Mar 10, 2023

I wonder if it is worth asserting those DOMException errors. The tests are really concerned with the warnings, not the specific error pathways. But I suppose it doesn't hurt and it might surface if some really strange new error starts to show up. Up to your intuition I think but I would maybe remove

I usually assert on the message anyway in case an error that we don't expect to happen starts happening. While the test is primarily about the warning, it also implicitly tests the absence of some unknown worse behavior, like "does React fall into an infinite update loop if you pass a <noscript> in the wrong position"? Since it's pretty easy to update later, I think of them as lightweight snapshot tests.

@acdlite acdlite merged commit 69fd78f into facebook:main Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants