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

feat(electron-updater): extensible sources #2750

Conversation

benjamincburns
Copy link
Contributor

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

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>`.
@benjamincburns
Copy link
Contributor Author

@develar I'm offering up this change as hopefully a less contentious alternative to #2743, though I'd still hope we can find a way for both PRs to be acceptable.

@develar
Copy link
Member

develar commented Mar 27, 2018

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.

@develar
Copy link
Member

develar commented Mar 28, 2018

Closed as #2743 is merged now. Feel free to reopen if need.

@develar develar closed this Mar 28, 2018
@benjamincburns
Copy link
Contributor Author

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

@develar develar reopened this Mar 28, 2018
return providerFactoryFunction(data, updater)
}

export function registerProviderType(name: string, factoryMethod: ProviderFactoryFunction) {
Copy link
Contributor Author

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.

@develar
Copy link
Member

develar commented May 3, 2018

Do you need this functionality to be merged?

@develar develar closed this May 8, 2018
@samuelmaddock
Copy link
Contributor

samuelmaddock commented May 9, 2018

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

@develar
Copy link
Member

develar commented May 9, 2018

@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 :)

@samuelmaddock
Copy link
Contributor

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

@develar
Copy link
Member

develar commented May 9, 2018

Ok, in this case it makes sense.

@develar develar reopened this May 9, 2018
@stale
Copy link

stale bot commented Jul 1, 2019

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.

@benjamincburns
Copy link
Contributor Author

benjamincburns commented Jan 25, 2021

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.

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

Successfully merging this pull request may close these issues.

3 participants