-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(electron-updater): extensible sources #2750
feat(electron-updater): extensible sources #2750
Conversation
With this change, users can register their own provider factory functions. This allows users to write their own auto update providers, or to extend the ones provided by this library. To do this, a user calls `providerFactory.registerProviderType` passing a name for the provider type as a string, and a function which accepts a `data` argument of type `PublishConfiguration | AllPublishOptions` and an instance of `AppUpdater`, and returns an instance of `Provider<any>`.
That PR is not closed, so, let's continue discussion. So, I will not review this PR in this case until that PR is not resolved. |
Closed as #2743 is merged now. Feel free to reopen if need. |
@develar I suggest reopening this (I have no button available to me to do so myself). This is a separate feature which lets others implement their own update providers. |
return providerFactoryFunction(data, updater) | ||
} | ||
|
||
export function registerProviderType(name: string, factoryMethod: ProviderFactoryFunction) { |
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.
The extension point is here. See type ProviderFactoryFunction
for the required function signature.
Do you need this functionality to be merged? |
@develar I was considering looking into auto-update support using Dat protocol. Would you consider merging this functionality in? It would be helpful for my use case. |
@samuelmaddock For support Dat protocol you don't need this PR — you can change electron-updater directly and so, your code will be maintained as part of this project. Simply implement your provider as any other existing providers and send PR :) |
@develar One thing I'd be concerned about is adding a lot of extra npm dependencies. Dat protocol isn't http so it would require a few extra modules. |
Ok, in this case it makes sense. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This PR has been open for quite some time (over 2.5 years) and the maintainer hasn't accepted it. I have little motivation to update this given that it's been so long, and I've moved on to other projects, so I'm closing it. |
With this change, users can register their own provider factory
functions. This allows users to write their own auto update providers,
or to extend the ones provided by this library. To do this, a user calls
providerFactory.registerProviderType
passing a name for the providertype as a string, and a function which accepts a
data
argument of typePublishConfiguration | AllPublishOptions
and an instance ofAppUpdater
, and returns an instance ofProvider<any>
.