re-rxjs / react-rxjs

React bindings for RxJS
https://react-rxjs.org
MIT License
546 stars 18 forks source link

Packaging for React Native #216

Closed hoclun-rigsep closed 2 years ago

hoclun-rigsep commented 3 years ago

Got another packaging issue for you guys. Using expo and npm:

warn Package @react-rxjs/core has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/jim/proj/MDT/node_modules/@react-rxjs/core/package.json

josepot commented 3 years ago

It looks like this is in fact a problem with RN, not with react-rxjs: https://github.com/react-native-community/cli/issues/1168. Also, according to the following comment:

For a package like uuid which does not contain react-native specific configuration in package.json this is not a problem, but for modules that do contain such config in package.json they will be forced to add package.json to their exports field.

I think that we should be ok? So, if everything works and the only issue is that the user gets a misleading warning, then I would prefer to wait for the RN team to address that issue rather than trying to create a workaround ourselves.

@hoclun-rigsep could you please let us know if -despite that warning- things work correctly?

josepot commented 3 years ago

On a second thought: I guess that it doesn't hurt to include package.json on the list of exports, I can see how other libraries have done that. So, I guess that we can do the same...

hoclun-rigsep commented 3 years ago

Okay, when I filed the issue I thought this was fatal, but that was late last night with a crying baby in my arms. It does appear to work despite the warning. Though I see you've patched it already, thank you! Now I can see the patch and see for myself what this issue is about.

hoclun-rigsep commented 3 years ago

Do you wish me to close this?