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

Don't use nested objects to "namespace" namespace constants #21073

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

sebmarkbage
Copy link
Collaborator

Not sure if closure is smart enough but as a pattern we don't gamble.

@sebmarkbage sebmarkbage requested a review from gaearon March 24, 2021 15:59
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 24, 2021
@gaearon
Copy link
Collaborator

gaearon commented Mar 24, 2021

looks like you missed some.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@sizebot
Copy link

sizebot commented Mar 24, 2021

Comparing: 7b84dbd...d510162

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 = 122.80 kB 122.75 kB = 39.50 kB 39.50 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 129.21 kB 129.16 kB +0.02% 41.50 kB 41.51 kB
facebook-www/ReactDOM-prod.classic.js = 408.57 kB 408.48 kB = 75.62 kB 75.61 kB
facebook-www/ReactDOM-prod.modern.js = 396.83 kB 396.74 kB = 73.70 kB 73.69 kB
facebook-www/ReactDOMForked-prod.classic.js = 408.57 kB 408.48 kB = 75.62 kB 75.62 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-www/ReactDOMServer-prod.classic.js = 48.44 kB 48.32 kB = 11.29 kB 11.26 kB
facebook-www/ReactDOMServer-prod.modern.js = 47.57 kB 47.46 kB = 11.08 kB 11.05 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js = 21.16 kB 21.09 kB = 7.85 kB 7.81 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js = 20.61 kB 20.53 kB = 7.73 kB 7.70 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js = 20.73 kB 20.66 kB = 7.69 kB 7.65 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js = 20.17 kB 20.10 kB = 7.57 kB 7.55 kB

Generated by 🚫 dangerJS against d510162

namespace = getIntrinsicNamespace(tag);
}

if (__DEV__) {
if (namespace === Namespaces.html) {
if (namespace === HTML_NAMESPACE) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So this is really weird. We track the namespace in prod and the only thing we use it for is this warning.

We don't need the namespace on the server since it's implied by the HTML.

Copy link
Collaborator Author

@sebmarkbage sebmarkbage Mar 24, 2021

Choose a reason for hiding this comment

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

Looks like it was intentional. #10452

But I'm just going to remove this because it's not worth the overhead/complexity when we don't bother with this on the client anyway.

@sebmarkbage sebmarkbage merged commit fb8c191 into facebook:master Mar 24, 2021
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.

None yet

4 participants