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: convert babel plugin to typescript #570

Merged
merged 33 commits into from
Feb 14, 2025

Conversation

jeremybarbet
Copy link
Contributor

@jeremybarbet jeremybarbet commented Feb 7, 2025

Summary

The main reason of my previous PRs regarding formatting was for me to contribute to this one.

  • Convert babel plugin source files to typescript
  • Inspired by react-native-reanimated, use esbuild to bundle the javascript plugin file
  • Enabled biome for lint/check on plugin/src files
  • Finish adding types definition for a lot of stuff still
  • Some tests are failing
  • Need to bundle the plugin when creating a new release/nightly build and/or doing automatically without yarn precommit or something
  • Add tsc to plugin bundle command

Note: To make review easier, first commit is only converting .js to .ts and moving them to a /src folder

Copy link

vercel bot commented Feb 7, 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 13, 2025 6:29pm
react-native-unistyles-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 6:29pm

@jpudysz
Copy link
Owner

jpudysz commented Feb 7, 2025

Great addition! I will happily accept it 🙏

Small note: keep strings single quoted

@jeremybarbet jeremybarbet force-pushed the feat/convert-plugin-to-typescript branch from 99ceb62 to c84b94e Compare February 11, 2025 11:38
@jeremybarbet
Copy link
Contributor Author

I'm working on converting the tests files to ts.

@jpudysz Quick question, how to you trigger this file?

@jpudysz
Copy link
Owner

jpudysz commented Feb 13, 2025

I have my own AST debugger online but it's limited to single file.
If I want to test some babel configs that affects node_modules then I can run this file via node.js:

node plugin/__tests__/playground.js

So it can be a .js file

@jeremybarbet
Copy link
Contributor Author

@jpudysz Alright, tests are now in typescript. I had to update those values after converting to typescript.

@jpudysz
Copy link
Owner

jpudysz commented Feb 13, 2025

That's ok. They are computed based on file name and extension.

Thanks for the help! PR looks solid 🚀

@jpudysz jpudysz merged commit 18e6cd0 into jpudysz:main Feb 14, 2025
4 checks passed
@jpudysz
Copy link
Owner

jpudysz commented Feb 14, 2025

Tested it locally, looks awesome. Thanks @jeremybarbet for cool contribution 🙏
I will try to release it as todays nightly.

@jeremybarbet
Copy link
Contributor Author

You're very welcome, pleasure to make a small contribution to this great project!

@jpudysz
Copy link
Owner

jpudysz commented Feb 14, 2025

Released as 3.0.0-nightly-20250214

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.

2 participants