-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add typings for the getConfiguration method #2143
Conversation
`getConfiguration` is useful for displaying which deploymentKey / Deployment Channel is currently configured for the running app. This is one of many methods exposed here: https://github.com/microsoft/react-native-code-push/blob/master/CodePush.js#L609 in the JS but that didn't have JS Typings Provided. Please let me know if the remaining methods should be added.
Related PR: #2093 |
Can you please describe your use case? Why would you want to get current deploymentKey as it would already be known? This API is not meant for use by developers, but if there's legitimate use case we can consider. |
@velimir-jankovic if it's set natively, with an environment variable and we just want to ensure its truthy before running sync? |
serverUrl: string; | ||
/** A GUID identifying this device -- identifierForVendor on iOS */ | ||
clientUniqueId: string; | ||
/** Your app binary's marketing version eg. 1.2.3 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test
/** This is only present in release builds / if you're not running against the packager */ | ||
packageHash?: string; | ||
publicKey?: string; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
teste2
@velimir-jankovic getting the current deployment key would help with distinguishing debug builds. Since the information is available at runtime, setting the typings just provides the same value for typescript coders, that JavaScript users can see. I understand if your position is that this should be private API, but then I’d hide the API entirely. I’m going to close this PR, as it’s completely stale, and I have moved on. Despite me appreciating the code in this repository, I don’t recommend code-push-style technology for any companies I consult for, as it brings a boatload of native-dependency, operational, deployment, and customer support complexity. Unless your company is at Microsoft-scale, with freestanding build-infrastructure-services team to build and manage all the pipelines and deployments, I would stay away. [As an example: it encourages teams to never update their dependencies, because it’s a challenge to figure out if those dep-updates change something that requires native-compilation. The only code-pushable dep-updates are ones that are JS-only updates. Additionally, using code-push combinatorically increases the possible states of a given device unless you’re brutally restrictive in your pipeline configuration (which then defeats the purpose of code-push)] Two cases where code-push may be great:
|
getConfiguration
is useful for displaying which deploymentKey / Deployment Channel is currently configured for the running app.This is one of many methods exposed here: https://github.com/microsoft/react-native-code-push/blob/master/CodePush.js#L609 in the JS but that didn't have JS Typings Provided.
Please let me know:
constantsToExport
API instead. (the keys onnativeConfiguration
are the direct raw keys vended from the API). This would be much less ergonomic in the normal case because it would force devs to use a dictionary-lookup strategy, and it would be clunkier to write typings for, but it has the added benefit of being more resilient if these API keys change over time.