frostney / react-native-create-library

:notebook: Command line tool to create a React Native library with a single command
MIT License
1.45k stars 114 forks source link

Latest RN Version Support #66

Closed privateOmega closed 6 years ago

privateOmega commented 6 years ago

Hi, Is there any upcoming release, so as to support latest versions of RN and Gradle Plugins?

maicki commented 6 years ago

@privateOmega Hey! - Do you the latest master or the version on npm? I have a branch on my fork that updates RN on the library side (peerDependencies), but on master we also bootstrap an example. Which version do you think of?

privateOmega commented 6 years ago

@maicki Thanks. I will definitely look into your fork, but then again, Is there a scope for breaking? Also do you have any resource on building a library from scratch?

maicki commented 6 years ago

@privateOmega Just to clarify which version would you like to update? The version we are using as peerDependendency in a new library?

And could you please describe a bit more what you mean with "Also do you have any resource on building a library from scratch?"

wregis commented 6 years ago

I guess it might be the peerDependendency version, since it points to 0.41.2 as for 5 minutes ago (I just installed the cli and create a test lib) while the current stable is 0.55.0.

I didn't really made any search for what were the breaking changes, however I think it would be good to have the version updated.

maicki commented 6 years ago

I thought about upgrading the peerDependencies already for a while and for now I have a branch out with updating it to 0.52: https://github.com/maicki/react-native-create-library/commit/b90beb2f06773fffe3d29795e216278fd4b65dd8

The reason I'm not so sure if we should update always to the latest is that we know updating React Native is not so easy in some circumstances. So the peerDependency should really only define which version you should have at least as peer. If the library uses APIs that are only starting with 0.52+ you should manually update the peerDependency of the library. That said I think 0.52 should be a good next update step for a default library.

wregis commented 6 years ago

@maicki if the change is as simple as in your branch I guess it won't hurt to have it merged to the master. Anyway, I think it is nice to update it and do the necessary changes every once in a while.

privateOmega commented 6 years ago

@wregis I totally agree, cause the older dependency prevents developers from using updated features of RN, hence limiting them.

maicki commented 6 years ago

@privateOmega Sorry, I don't really understand what you mean with that. The peerDependency we define within the library is just the least version of React Native that the app should run, not that the app that adopts the library needs to have exactly this version. So in theory it should be the lowest version of React Native based on the APIs the library uses.

The reason I'm hesitant to bump the version is for example: if the library at least uses APIs of React Native version 0.46 why should it have a peerDependency of 0.55? If we would bump the version of the of React Native in the peerDependency to 0.55 every app that uses < 0.55 but > 0.46 would get a peerDependency warning although this is not necessary at all as it would run fine on that version.

So I don't really get your statement @privateOmega , that if we would have an older peerDependency would prevent developers from using updates features of RN at all ...

maicki commented 6 years ago

I just merged a diff that updates the RN version to 0.52: #76 - it could definitely be improved and we could provide a way to pass the version as an option in. There is some complication of that as React, besides React Native also needs to the proper version. Happy to review any diff to add this to this library. For now see this issue as resolved. Thanks!