Deprecation Notices
I just upgraded from v4 to v5. What a pain! Next time you rename a bunch of functions, maybe add deprecation notices.
👀 SDKONCALL-212 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
@ahansson89 I apologize, this should never be the experience for anyone migrating.
We're going to work on a proper migration guide for our hybrid SDKs (React-Native, Cordova, Flutter, Unity) and introducing deprecation notices. We couldn't find a way to provide obsoletion notices for typescript, but we can still find ways to do this better, and we will.
@aboedo does a v4 -> v5 migration guide exist?
We migrated the following functions:
const {purchaserInfo, productIdentifier} = await Purchases.purchasePackage(...) -> const purchaseMade = await Purchases.purchasePackage(packageObj);
const purchaserInfo = await Purchases.getPurchaserInfo(); -> const purchaserInfo = await Purchases.getCustomerInfo();
const restore = await Purchases.restoreTransactions(); -> const restore = await Purchases.restorePurchases();
Purchases.setDebugLogsEnabled(DEV); -> Purchases.setLogLevel(LOG_LEVEL.VERBOSE);
Purchases.setup(REVENUE_CAT_SDK_KEY) -> Purchases.configure({apiKey: REVENUE_CAT_SDK_KEY});
Is there any behavior change that we should be aware of?
@omer921 I added a migration guide in https://github.com/RevenueCat/react-native-purchases/pull/601
The changes you outlined are correct, and there shouldn't be any behavior changes to be on the lookout for.
There are quite a few new features in v5, you can see them in the migration guide I added to the PR
@ahansson89 I apologize, this should never be the experience for anyone migrating.
We're going to work on a proper migration guide for our hybrid SDKs (React-Native, Cordova, Flutter, Unity) and introducing deprecation notices. We couldn't find a way to provide obsoletion notices for typescript, but we can still find ways to do this better, and we will.
Typically what I've seen other library maintainers do is use JS doc's deprecated syntax:
https://jsdoc.app/tags-deprecated.html
this makes apis that are deprecated appear as crossed out in VScode and other editors that support jsdoc syntax. And the messaging tells users to use some other api going forward because this one will be removed soon. Then you remove the old one and keep the new after several versions of this giving everyone a fair notice.