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

[fail] Only warn on unacted effects for strict / non sync modes #16041

Conversation

@threepointone
Copy link
Contributor

commented Jul 2, 2019

(basically, when fiber.mode !== 0b0000)

Warnings on unacted effects may be too noisy, especially for legacy apps. This PR fires the warning only when in a non sync mode (concurrent/batched), or when in strict mode. This should make gradually updating codebases easier too.

I also added batched mode tests to the act() suite.

only warn on unacted effects for strict / non sync modes
(basically, when `fiber.mode !== 0b0000`)

Warnings on unacted effects may be too noisy, especially for legacy apps. This PR fires the warning only when in a non sync mode (concurrent/batched), or when in strict mode. This should make updating easier.

I also added batched mode tests to the act() suite.
@sizebot

This comment has been minimized.

Copy link

commented Jul 2, 2019

No significant bundle size changes to report.

Generated by 🚫 dangerJS

@threepointone threepointone requested a review from gaearon Jul 2, 2019

@acdlite

acdlite approved these changes Jul 2, 2019

@threepointone threepointone force-pushed the threepointone:unacted-effects-warning-strict-mode-only branch from 5d2fb1e to 394ce77 Jul 3, 2019

@threepointone threepointone merged commit bd84645 into facebook:master Jul 3, 2019

13 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: flow Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: lint_build Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_build Your tests passed on CircleCI!
Details
ci/circleci: test_build_prod Your tests passed on CircleCI!
Details
ci/circleci: test_dom_fixtures Your tests passed on CircleCI!
Details
ci/circleci: test_source Your tests passed on CircleCI!
Details
ci/circleci: test_source_fire Your tests passed on CircleCI!
Details
ci/circleci: test_source_persistent Your tests passed on CircleCI!
Details
ci/circleci: test_source_prod Your tests passed on CircleCI!
Details

@threepointone threepointone deleted the threepointone:unacted-effects-warning-strict-mode-only branch Jul 3, 2019

trueadm added a commit to trueadm/react that referenced this pull request Jul 3, 2019

[fail] Only warn on unacted effects for strict / non sync modes (face…
…book#16041)

* only warn on unacted effects for strict / non sync modes

(basically, when `fiber.mode !== 0b0000`)

Warnings on unacted effects may be too noisy, especially for legacy apps. This PR fires the warning only when in a non sync mode (concurrent/batched), or when in strict mode. This should make updating easier.

I also added batched mode tests to the act() suite.

* explicitly check for modes before warning, explicit tests for all modes
@gaearon gaearon referenced this pull request Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.