react-native-purchases icon indicating copy to clipboard operation
react-native-purchases copied to clipboard

Deprecation Notices

Open ahansson89 opened this issue 2 years ago • 5 comments

I just upgraded from v4 to v5. What a pain! Next time you rename a bunch of functions, maybe add deprecation notices.

ahansson89 avatar Jan 24 '23 08:01 ahansson89

👀 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!

RCGitBot avatar Jan 24 '23 08:01 RCGitBot

@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 avatar Jan 24 '23 13:01 aboedo

@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 avatar Apr 09 '23 20:04 omer921

@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

aboedo avatar Apr 11 '23 17:04 aboedo

@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.

TowhidKashem avatar Sep 01 '23 00:09 TowhidKashem