fix: Remove Flow from @react-native/assets-registry - registry.js#44002
fix: Remove Flow from @react-native/assets-registry - registry.js#44002codinsonn wants to merge 3 commits into
Conversation
## React native shipping Flow types breaks universal apps See: expo/expo#21623 (comment) expo/expo#21623 (comment) expo/expo#21469 (comment)
|
Hi @codinsonn! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Add `@flow` comment to run automatic tests accurately
|
To be fair, if anyone from the Facebook team or React-Native community is willing to spearhead a move away from Flow to Typescript (for at least (In which case, feel free to close this one) |
|
Will somebody fix it? When?! |
|
@codinsonn this PR can't be merged, see tests failing because other packages depend on flow types from this one. seems like bigger refactoring needed |
|
I don't think we want to remove the flow types from the source code, but when this package is published to npm it should not have type annotations. It looks normalize-colors simply puts the flow types in an accompanying file, so the entry is valid JS https://github.com/facebook/react-native/tree/HEAD/packages/normalize-color |
|
Does somebody have patch for "react-native": "0.76.1" ? |
Ok, I did it myself:
|
That does sound like a better solution than removing flow types or doing a bigger refactor. I'm all for it. Until then, I think I'll patch it out in my own projects. (thx @karpolan) Maybe this PR should be converted into an issue instead? |
|
looks like it was merged here - #48458 |
Summary
React native shipping Flow types breaks universal apps
In essence:
Related issues and Github comments:
It might be a better idea to rewrite the entire
@react-native/assets-registryin Typescript instead of Flow. I'm willing to do this myself if you're open for that. But really, as long as Flow goes, it will no longer break universal app setups with Next.jsChangelog:
[GENERAL] [REMOVED] - Fixed @react-native/assets-registry breaking in Next.js due to Flow types
Test Plan
Reproducible by starting a new
expo+next.jsand adding + using e.g.@bacons/mdxor@expo/vector-iconson the web with Next.js 13+Fix testable by applying the following
patch-packagediff:expo/expo#21623 (comment)
@react-native+assets+1.0.0.patch