Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(StrictMode): Double-invoke render for every component#18430

Merged
gaearon merged 2 commits intofacebook:masterfrom
eps1lon:feat/strict-static-function
Mar 29, 2020
Merged

feat(StrictMode): Double-invoke render for every component#18430
gaearon merged 2 commits intofacebook:masterfrom
eps1lon:feat/strict-static-function

Conversation

@eps1lon
Copy link
Collaborator

Summary

Closes#18426.

Essentially#14639 rebased withmaster where concerns were voiced about existing tests.

Test Plan

ReactHooks-internal is responsible for this test. This also affects any test counting renders.

@codesandbox-ci
Copy link

codesandbox-cibot commentedMar 29, 2020
edited
Loading

This pull request is automatically built and testable inCodeSandbox.

To see build info of the built libraries, clickhere or the icon next to each commit SHA.

Latest deployment of this branch, based on commite508cee:

SandboxSource
autumn-surf-xpr5jConfiguration
StrictMode /w and w/o HooksIssue#18426

@sizebot
Copy link

sizebot commentedMar 29, 2020
edited
Loading

Details of bundled changes.

Comparing:1af2a10...e508cee

react-art

FileFilesize DiffGzip DiffPrev SizeCurrent SizePrev GzipCurrent GzipENV
react-art.development.js-0.1%-0.0%540.9 KB540.57 KB116.64 KB116.59 KBNODE_DEV
react-art.production.min.js0.0%-0.0%71.47 KB71.47 KB21.57 KB21.56 KBNODE_PROD
ReactART-dev.js-0.1%-0.0%607.38 KB606.88 KB127.32 KB127.28 KBFB_WWW_DEV
react-art.development.js-0.1%-0.0%636.84 KB636.49 KB134.27 KB134.24 KBUMD_DEV
react-art.production.min.js0.0%0.0%106.42 KB106.42 KB32.3 KB32.3 KBUMD_PROD

react-dom

FileFilesize DiffGzip DiffPrev SizeCurrent SizePrev GzipCurrent GzipENV
react-dom.production.min.js0.0%-0.0%118.55 KB118.55 KB37.26 KB37.26 KBNODE_PROD
react-dom-test-utils.development.js0.0%-0.0%59.23 KB59.23 KB15.64 KB15.64 KBUMD_DEV
ReactDOMTesting-profiling.js0.0%-0.0%406 KB406 KB73.77 KB73.77 KBFB_WWW_PROFILING
react-dom-server.browser.production.min.js0.0%-0.0%19.62 KB19.62 KB7.29 KB7.28 KBNODE_PROD
react-dom-unstable-fizz.browser.development.js0.0%-0.2%3.34 KB3.34 KB1.26 KB1.26 KBUMD_DEV
react-dom.profiling.min.js0.0%0.0%122.4 KB122.4 KB38.41 KB38.42 KBNODE_PROFILING
react-dom-test-utils.production.min.js0.0%0.0%12.25 KB12.25 KB4.54 KB4.54 KBUMD_PROD
react-dom-unstable-fizz.browser.production.min.js0.0%-0.3%1.17 KB1.17 KB691 B689 BUMD_PROD
react-dom-server.node.development.js0.0%-0.0%127.53 KB127.53 KB34.09 KB34.09 KBNODE_DEV
react-dom-server.node.production.min.js0.0%-0.0%20.03 KB20.03 KB7.44 KB7.44 KBNODE_PROD
ReactDOMForked-dev.js-0.0%-0.0%1008.64 KB1008.15 KB224.19 KB224.14 KBFB_WWW_DEV
react-dom-unstable-fizz.node.development.js0.0%-0.1%3.68 KB3.68 KB1.33 KB1.33 KBNODE_DEV
react-dom.development.js-0.0%-0.0%908.87 KB908.53 KB199.94 KB199.91 KBUMD_DEV
react-dom-server.browser.development.js0.0%-0.0%133.15 KB133.15 KB34.27 KB34.27 KBUMD_DEV
react-dom-unstable-fizz.node.production.min.js0.0%-0.2%1.15 KB1.15 KB653 B652 BNODE_PROD
react-dom-server.browser.production.min.js0.0%-0.0%19.71 KB19.71 KB7.34 KB7.34 KBUMD_PROD
ReactDOMTesting-dev.js0.0%-0.0%946.27 KB946.27 KB211.29 KB211.29 KBFB_WWW_DEV
react-dom.development.js-0.0%-0.0%865.15 KB864.82 KB197.49 KB197.47 KBNODE_DEV
ReactDOMTesting-prod.js0.0%-0.0%406 KB406 KB73.77 KB73.77 KBFB_WWW_PROD
ReactDOM-dev.js-0.0%-0.0%1008.64 KB1008.15 KB224.19 KB224.14 KBFB_WWW_DEV
ReactDOMServer-dev.js0.0%-0.0%136.32 KB136.32 KB34.74 KB34.74 KBFB_WWW_DEV
react-dom-test-utils.development.js0.0%-0.0%54.69 KB54.69 KB15.03 KB15.03 KBNODE_DEV
ReactDOMServer-prod.js0.0%-0.0%46.62 KB46.62 KB10.86 KB10.86 KBFB_WWW_PROD
react-dom-unstable-fizz.browser.development.js0.0%-0.2%2.94 KB2.94 KB1.17 KB1.17 KBNODE_DEV
react-dom-test-utils.production.min.js0.0%-0.0%12.1 KB12.1 KB4.47 KB4.47 KBNODE_PROD
react-dom-unstable-native-dependencies.development.js0.0%-0.0%57.7 KB57.7 KB14.36 KB14.36 KBUMD_DEV
react-dom-unstable-fizz.browser.production.min.js0.0%-0.3%1013 B1013 B603 B601 BNODE_PROD
react-dom-unstable-native-dependencies.production.min.js0.0%-0.0%10.31 KB10.31 KB3.49 KB3.49 KBUMD_PROD
react-dom-unstable-native-dependencies.development.js0.0%-0.0%54.71 KB54.71 KB14.14 KB14.13 KBNODE_DEV
react-dom-unstable-native-dependencies.production.min.js0.0%-0.0%10.04 KB10.04 KB3.37 KB3.37 KBNODE_PROD

react-reconciler

FileFilesize DiffGzip DiffPrev SizeCurrent SizePrev GzipCurrent GzipENV
react-reconciler.development.js-0.1%-0.0%578.94 KB578.61 KB122.44 KB122.42 KBNODE_DEV
react-reconciler-reflection.development.js0.0%-0.0%15.55 KB15.55 KB4.73 KB4.73 KBNODE_DEV
react-reconciler.production.min.js0.0%-0.0%76.31 KB76.31 KB22.64 KB22.64 KBNODE_PROD
react-reconciler-reflection.production.min.js0.0%-0.1%2.57 KB2.57 KB1.08 KB1.08 KBNODE_PROD

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫dangerJS againste508cee

@sizebot
Copy link

sizebot commentedMar 29, 2020
edited
Loading

Details of bundled changes.

Comparing:1af2a10...e508cee

react-dom

FileFilesize DiffGzip DiffPrev SizeCurrent SizePrev GzipCurrent GzipENV
react-dom-server.browser.production.min.js0.0%-0.0%20.17 KB20.17 KB7.4 KB7.4 KBUMD_PROD
react-dom-unstable-fizz.browser.development.js0.0%-0.2%3.35 KB3.35 KB1.27 KB1.27 KBUMD_DEV
ReactDOM-dev.js-0.1%-0.0%962.79 KB962.29 KB214.16 KB214.08 KBFB_WWW_DEV
react-dom-unstable-fizz.browser.production.min.js0.0%-0.3%1.19 KB1.19 KB699 B697 BUMD_PROD
ReactDOM-profiling.js0.0%-0.0%416.74 KB416.74 KB75.49 KB75.48 KBFB_WWW_PROFILING
react-dom-unstable-fizz.browser.development.js0.0%-0.2%2.95 KB2.95 KB1.18 KB1.18 KBNODE_DEV
react-dom-unstable-fizz.browser.production.min.js0.0%-0.3%1 KB1 KB611 B609 BNODE_PROD
react-dom-test-utils.development.js0.0%-0.0%59.24 KB59.24 KB15.65 KB15.65 KBUMD_DEV
ReactDOMTesting-dev.js0.0%-0.0%919.51 KB919.51 KB205.39 KB205.38 KBFB_WWW_DEV
react-dom-test-utils.development.js0.0%-0.0%54.7 KB54.7 KB15.03 KB15.03 KBNODE_DEV
react-dom-server.node.development.js0.0%-0.0%129.05 KB129.05 KB34.3 KB34.3 KBNODE_DEV
react-dom-test-utils.production.min.js0.0%-0.0%12.12 KB12.12 KB4.48 KB4.48 KBNODE_PROD
react-dom-server.browser.development.js0.0%-0.0%127.83 KB127.83 KB34.05 KB34.05 KBNODE_DEV
react-dom.development.js-0.0%-0.0%939.02 KB938.56 KB205.19 KB205.16 KBUMD_DEV
react-dom-unstable-native-dependencies.development.js0.0%-0.0%57.71 KB57.71 KB14.36 KB14.36 KBUMD_DEV
ReactDOMForked-dev.js-0.1%-0.0%962.79 KB962.29 KB214.16 KB214.08 KBFB_WWW_DEV
react-dom-unstable-native-dependencies.production.min.js0.0%-0.0%10.32 KB10.32 KB3.49 KB3.49 KBUMD_PROD
ReactDOMServer-dev.js0.0%-0.0%135.47 KB135.47 KB34.6 KB34.6 KBFB_WWW_DEV
ReactDOMServer-prod.js0.0%-0.0%45.91 KB45.91 KB10.67 KB10.67 KBFB_WWW_PROD
react-dom.development.js-0.0%-0.0%894.04 KB893.6 KB202.7 KB202.67 KBNODE_DEV
ReactDOMForked-profiling.js0.0%-0.0%416.74 KB416.74 KB75.49 KB75.48 KBFB_WWW_PROFILING
react-dom-unstable-native-dependencies.development.js0.0%-0.0%54.72 KB54.72 KB14.14 KB14.14 KBNODE_DEV
react-dom-unstable-fizz.node.development.js0.0%-0.1%3.69 KB3.69 KB1.34 KB1.34 KBNODE_DEV
react-dom-unstable-native-dependencies.production.min.js0.0%-0.0%10.05 KB10.05 KB3.38 KB3.38 KBNODE_PROD
react-dom-unstable-fizz.node.production.min.js0.0%-0.2%1.16 KB1.16 KB662 B661 BNODE_PROD

react-art

FileFilesize DiffGzip DiffPrev SizeCurrent SizePrev GzipCurrent GzipENV
ReactART-dev.js-0.1%-0.0%579.3 KB578.81 KB121.65 KB121.6 KBFB_WWW_DEV
react-art.development.js-0.1%-0.0%657.47 KB657 KB137.97 KB137.95 KBUMD_DEV
react-art.production.min.js0.0%-0.0%109 KB109 KB33.06 KB33.06 KBUMD_PROD
react-art.development.js-0.1%-0.0%560.72 KB560.28 KB120.36 KB120.32 KBNODE_DEV

react-native-renderer

FileFilesize DiffGzip DiffPrev SizeCurrent SizePrev GzipCurrent GzipENV
ReactNativeRenderer-dev.js-0.1%-0.0%657.7 KB657.33 KB142.08 KB142.04 KBRN_FB_DEV
ReactFabric-dev.js0.0%-0.0%636.85 KB636.85 KB137.34 KB137.34 KBRN_OSS_DEV
ReactFabric-prod.js0.0%0.0%260.81 KB260.81 KB45.16 KB45.16 KBRN_OSS_PROD
ReactFabric-profiling.js0.0%0.0%272.65 KB272.65 KB47.39 KB47.4 KBRN_OSS_PROFILING
ReactFabric-dev.js-0.1%-0.0%639.57 KB639.2 KB137.67 KB137.62 KBRN_FB_DEV
ReactNativeRenderer-prod.js0.0%-0.0%268.82 KB268.82 KB46.64 KB46.64 KBRN_OSS_PROD
ReactNativeRenderer-profiling.js0.0%-0.0%280.67 KB280.67 KB48.89 KB48.89 KBRN_OSS_PROFILING

react-reconciler

FileFilesize DiffGzip DiffPrev SizeCurrent SizePrev GzipCurrent GzipENV
react-reconciler-reflection.development.js0.0%-0.0%15.56 KB15.56 KB4.73 KB4.73 KBNODE_DEV
react-reconciler-reflection.production.min.js0.0%-0.1%2.58 KB2.58 KB1.09 KB1.09 KBNODE_PROD
react-reconciler.development.js-0.1%-0.0%601.08 KB600.65 KB126.67 KB126.63 KBNODE_DEV

ReactDOM: size: 0.0%, gzip: -0.0%

Size changes (experimental)

Generated by 🚫dangerJS againste508cee

@gaearon
Copy link
Collaborator

Seems like bundle tests fail.

@eps1lon
Copy link
CollaboratorAuthor

Seems like bundle tests fail.

It seems like react-test-renderer is not usingbeginWork from the react-reconciler package intest-build (but is intest).

Apparentlytest-build rewrites somereact-reconciler/ imports but I'm a bit confused whyreact-reconciler sometimes imports via relative specifier (e.g../ReactFiberRoot) and sometimes via deep specifier (e.g.react-reconciler/src/ReactRootTags). Maybe I'm looking in the wrong spot.

@eps1lon
Copy link
CollaboratorAuthor

Followinghttps://github.com/facebook/react/pull/14639/files#diff-0b241de0dfec2d07bb2b2fef76b254d2R11-R24 though I don't think I understand the distinction between source and build tests.

@gaearon
Copy link
Collaborator

It seems like react-test-renderer is not using beginWork from the react-reconciler package in test-build (but is in test).

Not sure what you mean by this. In the bundle tests,react-reconciler is bundledinside ofreact-test-renderer bundle. Just like it's bundled inside ofreact-dom.

The difference is that you can't set feature flags for bundle tests. Because nothing will read them. They're already compiled away.

@gaearongaearon merged commitba31ad4 intofacebook:masterMar 29, 2020
@gaearon
Copy link
Collaborator

Looks good. Thanks.

@eps1loneps1lon deleted the feat/strict-static-function branchMarch 29, 2020 22:22
This was referencedMar 6, 2021
This was referencedMar 15, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Call all functions twice in StrictMode

4 participants

@eps1lon@sizebot@gaearon@facebook-github-bot

[8]ページ先頭

©2009-2026 Movatter.jp