FormidableLabs / victory-native-xl

A charting library for React Native with a focus on performance and customization.
https://commerce.nearform.com/open-source/victory-native
665 stars 49 forks source link

Is it possible to migrate from v36 to v40? #283

Open andreyukD opened 4 months ago

andreyukD commented 4 months ago

Question

I noticed that your team rewrote the library (https://commerce.nearform.com/open-source/victory-native/#why-a-rewrite) I'm using v36+ and tried to upgrade it to the latest version (40+). v40 requires @shopify/react-native-skia, which can be installed, but I have questions about components like VictoryBar, VictoryArea, VicroryAxis, VictoryPie etc. Will it be possible to keep the old charts without rewriting them to the new charts?

I tried to compare legacy (36) with new (40) documentation, but I couldn't find information on how to migrate.

Background Info/Attempts

owattenmaker commented 4 months ago

The libraries and API's are completely different. I don't think it was a good idea to continue the same name (maybe because their previous name already had some traction?) and increment the package version because of exactly this confusion, but here we are.

In short, you'll need to redo everything if you'd like to upgrade.

It is possible to have multiple versions of a library installed, if you wanna try and piecemeal the updates over time https://stackoverflow.com/questions/26414587/how-to-install-multiple-versions-of-package-using-npm

andreyukD commented 4 months ago

Yes, just as I thought. And, the legacy version rather won't get new updates in the future because of a complete rewrite. So apps with legacy versions are locked in and forced to migrate (redo) if they want to work with a newer version of the library

carbonrobot commented 4 months ago

Hey folks, sorry for the confusion and rocky road to upgrading. Just want to clarify that we will still be updating the legacy version for the foreseeable future and are exploring a lot of alternatives, even a merge made possible by recent changes in RN architecture, or a way to use either API.

It's an unfortunate state of awkwardness we are in right now and we try to dedicate as much time as we can to the roadmap for both Victory and VNXL, but of course that's not always possible without a lot of community support.

TomCorvus commented 4 months ago

Like the most of packages you can use, if you upgrade to next major version, you have to change/adapt your code. Same thing when you upgrade react-native, you have to change pieces of code to make it working.

The particularity of VNXL is that, at the beginning of 40 version, a lot of components that existed in 36 didn't exist in 40. (Pie for example). You can just to compare both documentions to realize it.

You have to check if all components you need are available and take few hours to migrate and adapt your code. For my part, it took me a short day to migrate 4 charts into 40 version and tbh, performance is here.

andreyukD commented 4 months ago

Thanks for the answers. What about me, I have already upgraded to the new version (40) (except for the functionality that is not there yet), it took me a while though, so I don't have any questions.

I know how libraries are updated, that's why I asked about the lack of information about migration when the major version changes

jonnyggao commented 3 months ago

What versions of RN, VNXL, and @shopify/react-native-skia did you manage the upgrade with?

andreyukD commented 3 months ago

@jonnyggao at the time of the update, I had these versions

"expo": "^51.0.8",
"react-native": "0.74.1",
"react-native-reanimated": "~3.10.1",
"react-native-gesture-handler": "~2.16.1",
"@shopify/react-native-skia": "^1.3.0",
"victory-native": "40.2.1",
aminedf commented 2 weeks ago

Hi @carbonrobot, I'm facing the same problem here as @andreyukD. Where can we find the new updates of the legacy version? Thanks

carbonrobot commented 2 weeks ago

@aminedf The docs for Victory are here: https://commerce.nearform.com/open-source/victory/docs