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

feat: babel rewrite dependency detection with scopes #561

Merged
merged 4 commits into from
Feb 6, 2025
Merged

Conversation

jpudysz
Copy link
Owner

@jpudysz jpudysz commented Feb 5, 2025

Summary

This is a big rewrite of Babel dependency detection, this time it's based on Scopes instead of node traversing.
It should work for all patterns, but won't support three cases:

  • function keyword, you need to either use arrow function or object (style or dynamic function)
  • variable reassignments: plugin won't track if you eg. reassigned rt to other variable (or any nested destructured object)
  • using external const as style keys: eg:
const container = () => ...

StyleSheet.create(() => ({
      container: container(theme)
}))

To merge it I need to:

Copy link

vercel bot commented Feb 5, 2025

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

Name Status Preview Comments Updated (UTC)
react-native-unistyles-2.0 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:03pm
react-native-unistyles-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:03pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant