-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Ability to copy all files and not only JS files when stripping types using flow-remove-types
#9148
Comments
Note that we probably won't do it ourselves, since we don't really recommend using it. The implementation of flow-remove-types is quite hacky, and you will be better off using babel directly. We do accept community contribution. |
I would like to work on this. Please assign @SamChou19815 🙏 |
OK understood about recommendation. But won't babel approach use the same whatever algorithm to remove types ? Do you mean using |
No, babel will remove the types from the AST, and then print the result API back to code. That approach is much less fragile then the string manipulation approach based on ranges that's currently in The only thing preventing us from deleting it from the repo is that we have not find an easy way to use the babel infra so that The energy would be better spent on making the babel-based approach work by connecting it to the source map. That being said, we will still accept bug fixes and improvements to flow-remove-types before we work out the babel stuff. |
Hi @SamChou19815 I still can work on this like you said, but it might take time for me to put my hands on code.. |
Proposal
I think it is useful to have all files copied by default when using
flow-remove-types
. I for instance use .proto files inside code, you can imagine other useful extensions that generally go hand in hand with JS (like JSON, HTML..)Use case
My build step is like
"build": "flow-remove-types src/ -d dist/",
, source folder contains files other than.js
so the./dist
is not self contained anymore.The text was updated successfully, but these errors were encountered: