[Question] Will react native's js be backward compatible with native?
Now react native's js is not backward compatible with native, for example, apps with 0.4.X's native code can not run js code packaged with 0.6.0's and vice versa. There is a one-to-one relationship between them.
In my and maybe many others' situations, JS code is on remote server and is downloaded to the apps. So there will be apps with various versions of react native but only one JS url(for some reason the url can not be modified), then some versions of apps fail to load the JS.
At present my solution is adding a version number to the url from native manualy, and providing various versions of JS code, which forces the web developers to provide a new version of JS when native upgrade.
Do you have a plan to make the JS backward compatible with naitve ?
Thanks.
@cxfeng1 - Inevitably new versions will sometimes have to introduce breaking changes: a module might be renamed or removed, an API could be changed, etc. I'm not sure that there is a good way to keep this indefinitely backwards compatible :(
It almost definitely won't be backwards compatible since it's a pretty big cost to have to anticipate how every new version of JS will work with every old version of the native code. You should think of the code in this repository (Obj-C + JS) as a single black box.
At present my solution is adding a version number to the url from native manualy, and providing various versions of JS code, which forces the web developers to provide a new version of JS when native upgrade.
Either do this or just bundle your JS with the native code and then there are no RN versioning issues to worry about.
You can also create your own abstraction layer on top of the native APIs - where you maintain compatibility. Then the code on top of that can still be a shared codebase.