Skip to content

Conversation

@jbrown215
Copy link
Contributor

@jbrown215 jbrown215 commented Jul 16, 2025

if (
value.args.length === autodepFnLoads.get(callee.identifier.id) &&
value.args.length > 1 &&
autodepsArgIndex > 0 &&
Copy link
Contributor Author

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, [])],
Copy link
Contributor

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";
Copy link
Contributor

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);
Copy link
Contributor

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

Copy link
Contributor

@mofeiZ mofeiZ left a 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)

@jbrown215 jbrown215 merged commit dffacc7 into facebook:main Jul 17, 2025
28 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 17, 2025
---
[//]: # (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)
github-actions bot pushed a commit that referenced this pull request Jul 17, 2025
---
[//]: # (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)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Jul 20, 2025
---
[//]: # (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)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Jul 20, 2025
---
[//]: # (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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants