Skip to content

Run ReactElementJSX-test against bundles#18301

Merged
gaearon merged 2 commits into
react:masterfrom
gaearon:pub-test
Mar 13, 2020
Merged

Run ReactElementJSX-test against bundles#18301
gaearon merged 2 commits into
react:masterfrom
gaearon:pub-test

Conversation

@gaearon

@gaearon gaearon commented Mar 13, 2020

Copy link
Copy Markdown
Collaborator

This is an important test. We should run it on bundles, not just source. See #18299 (comment) for the kind of issue it could catch.

I'm removing the internal suffix and moving the only test that actually depends on feature flags by now into its own file. That one stays internal.

@codesandbox-ci

codesandbox-ci Bot commented Mar 13, 2020

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 ea3cccd:

Sandbox Source
busy-mahavira-ifszk Configuration

global.Symbol = undefined;

ReactFeatureFlags = require('shared/ReactFeatureFlags');
ReactFeatureFlags.warnAboutSpreadingKeyToJSX = true;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is already true in the test-www-variant run, so instead of moving this to a new file, you can wrap the test in a condition:

if (require('shared/ReactFeatureFlags').warnAboutSpreadingKeyToJSX) {
  // test goes here
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

ohh smart

@sizebot

sizebot commented Mar 13, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against ea3cccd

@sizebot

sizebot commented Mar 13, 2020

Copy link
Copy Markdown

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against ea3cccd

@acdlite acdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍Assuming tests pass

@gaearon

gaearon commented Mar 13, 2020

Copy link
Copy Markdown
Collaborator Author

It would be nice to have some way to ensure that a test isn’t completely ignored by all runs because we forgot about giving it a variant.

@acdlite

acdlite commented Mar 13, 2020

Copy link
Copy Markdown
Collaborator

Yeah that would be nice. Though this is probably only an issue for existing tests, since it'd be weird to write a test that you never run yourself.

Also, if we remove all the hardcoded overrides here: https://github.com/facebook/react/blob/885ed469096d4da7ca038564b323e9b706f5a6d0/packages/shared/forks/ReactFeatureFlags.www-dynamic.js#L25-L32

...and here: https://github.com/facebook/react/blob/885ed469096d4da7ca038564b323e9b706f5a6d0/scripts/jest/setupTests.www.js#L13-L22

then if a flag is shipped to any of our open source or www channels, it will definitely be tested. So I'm not too worried about this.

@acdlite

acdlite commented Mar 13, 2020

Copy link
Copy Markdown
Collaborator

Put another way, it's not that big a deal if we neglect to test a configuration that doesn't actually exist in one of our release channels. It's not ideal, because there could be hidden bugs that don't get discovered until we turn the flag on somewhere. But it's more important to test against every possible configuration that actually gets shipped.

@gaearon gaearon merged commit 73ff8b9 into react:master Mar 13, 2020
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.

4 participants