Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check against major versions of Parse-SDK-JS (esp. for Cloud Code) #171

Closed
fatuhoku opened this issue Jan 18, 2016 · 3 comments
Closed

Comments

@fatuhoku
Copy link

Just as major iOS versions deprecate, or introduce functionality, Parse JS SDK is also seeing backward breaking changes as well as new functionality. For instance, the Parse.Promise.when behaviour introduced in 1.7 will break code targeting 1.6.14 (e.g. #95).

Users have no say in when Cloud Code gets upgraded, so while developers like me build code against 1.7.0-rc, we must expect to deploy to 1.6.14. How can I write an if statement to help my code transition gracefully from one version to the next?

@andrewimm
Copy link
Contributor

@fatuhoku when we release new versions of the SDK, they aren't automatically used for your cloud code apps. When you first create a cloud code app, it will use the latest JS SDK version available, and it will remain at that version unless you explicitly change it. You're in full control, using the parse CLI.

When you call parse jssdk, it shows you the SDK version your app is using.
parse jssdk --all shows all available versions.
parse jssdk X.Y.Z will set your cloud code app to use version X.Y.Z

You can read more in the docs: https://parse.com/docs/cloudcode/guide#command-line-setting-the-javascript-sdk-version

@andrewimm
Copy link
Contributor

If you really need to access the version string, it's available at Parse.CoreManager.get('VERSION'). We don't make it easily accessible, to avoid users gating behavior on the version number, which is a risky pattern.

@fatuhoku
Copy link
Author

@andrewimm Ah — I literally had no idea the developer is in control of the JS SDK used. That does make a lot of sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants