-
Notifications
You must be signed in to change notification settings - Fork 50k
InferEffectDeps takes a React.AUTODEPS sigil #33799
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
Conversation
| if ( | ||
| value.args.length === autodepFnLoads.get(callee.identifier.id) && | ||
| value.args.length > 1 && | ||
| autodepsArgIndex > 0 && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the next diff I change the config to specify the index for autodeps instead of number of required args
| BuiltInUseEffectEventId, | ||
| ), | ||
| ], | ||
| ['AUTODEPS', addObject(DEFAULT_SHAPES, BuiltInAutodepsId, [])], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supernit -- should this be prefixed with experimental_ / unstable_?
| ```javascript | ||
| // @inferEffectDependencies @panicThreshold:"none" | ||
| import { useEffect } from "react"; | ||
| import { useEffect, AUTODEPS } from "react"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense that we don't rewrite the import (yet)
| function ReactiveVariable({ propVal }) { | ||
| const arr = [propVal]; | ||
| useEffectWrapper(() => print(arr)); | ||
| useEffectWrapper(() => print(arr), AUTODEPS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense since we're in no-emit
mofeiZ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!! I read through the fixtures to confirm that (1) we're currently detecting + deleting AUTODEPS references and (2) logger diagnostics stay unchanged (except for line numbers)
--- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33799). * #33800 * __->__ #33799 DiffTrain build for [dffacc7](dffacc7)
--- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33799). * #33800 * __->__ #33799 DiffTrain build for [dffacc7](dffacc7)
--- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33799). * facebook#33800 * __->__ facebook#33799 DiffTrain build for [dffacc7](facebook@dffacc7)
--- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33799). * facebook#33800 * __->__ facebook#33799 DiffTrain build for [dffacc7](facebook@dffacc7)
Stack created with Sapling. Best reviewed with ReviewStack.