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

[compiler] Support default imports for autodep config #31657

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

jbrown215
Copy link
Contributor

@jbrown215 jbrown215 commented Dec 2, 2024

Summary

Allows us to add deps for things like import useWrapperEffect from 'useWrapperEffect'

Stack created with Sapling. Best reviewed with ReviewStack.

Copy link

vercel bot commented Dec 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2024 11:57pm

@jbrown215 jbrown215 force-pushed the pr31657 branch 2 times, most recently from 793dd50 to 3ddbd8e Compare December 2, 2024 23:00
} else {
t6 = $[13];
}
useEffectWrapper(t6, [foo]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍

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.

Makes sense!

) {
const moduleTargets = autodepFnConfigs.get(value.binding.module);
if (moduleTargets != null) {
const numRequiredArgs = moduleTargets.get('default');
Copy link
Contributor

@mofeiZ mofeiZ Dec 2, 2024

Choose a reason for hiding this comment

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

Does it make sense to make default a constant in Environment.ts for grep-ability?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, sounds reasonable to me! I like grep-ability + find-refs-ability

## Summary

Drops .current field accesses in inferred dep arrays
## Summary

Allows us to add deps for things like `import useWrapperEffect from 'useWrapperEffect'`
jbrown215 added a commit that referenced this pull request Dec 3, 2024
## Summary

Drops .current field accesses in inferred dep arrays

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31652).
* #31657
* __->__ #31652
@jbrown215 jbrown215 merged commit 1b1283a into facebook:main Dec 3, 2024
19 checks passed
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.

3 participants