Idea: add JSON as an alternative update file format #427

Closed
kainjow opened this Issue Sep 25, 2014 · 9 comments

Comments

Projects
None yet
5 participants
@kainjow
Contributor

kainjow commented Sep 25, 2014

I've never been a fan of using RSS/XML for the update file, it always seemed way too verbose to me. I can never remember the exact XML layout either. I guess the one use is people can subscribe to them in their RSS feeders, but does anyone do that?

I'm not sure which parts of the RSS feed Sparkle actually uses, but it seems the basics would be minimum. Here's an example:

[
  {
    "releasenotes": "http://...",
    "url": "http://...",
    "version": "102",
    "shortVersion": "1.0.2",
    "dsaSignature": "MC0F..."
  },
  {
    "releasenotes": "http://...",
    "url": "http://...",
    "version": "101",
    "shortVersion": "1.0.1",
    "dsaSignature": "MC0F..."
  }
]

NSJSONSerialization is part of 10.7 so no third-party code would be required.

@fernandomorgan

This comment has been minimized.

Show comment
Hide comment
@fernandomorgan

fernandomorgan Sep 25, 2014

I am using that in the yahoo/sparkle, as an option - its only a basic file, but it can be expanded to more types of fields (release notes, etc). And yes, it's 10.7 only - but you can use this for older OSes, for example:
stig/json-framework

|   |
|   | |   |   |   |   |   |
| stig/json-frameworkjson-framework - JSON (JavaScript Object Notation) is a light-weight data interchange format that's easy to read and write for humans and computers alike. This fram... |
| |
| View on github.com | Preview by Yahoo |
| |
|   |

  --------------------------------------------------------
Fernando 
YMail

 On Thursday, September 25, 2014 5:33 AM, Kevin Wojniak <notifications@github.com> wrote:

I've never been a fan of using RSS/XML for the update file, it always seemed way too verbose to me. I can never remember the exact XML layout either. I guess the one use is people can subscribe to them in their RSS feeders, but does anyone do that?I'm not sure which parts of the RSS feed Sparkle actually uses, but it seems the basics would be minimum. Here's an example:[
{
"releasenotes": "http://...",
"url": "http://...",
"version": "102",
"shortVersion": "1.0.2",
"dsaSignature": "MC0F..."
},
{
"releasenotes": "http://...",
"url": "http://...",
"version": "101",
"shortVersion": "1.0.1",
"dsaSignature": "MC0F..."
}
]
NSJSONSerialization is part of 10.7 so no third-party code would be required.—
Reply to this email directly or view it on GitHub.

I am using that in the yahoo/sparkle, as an option - its only a basic file, but it can be expanded to more types of fields (release notes, etc). And yes, it's 10.7 only - but you can use this for older OSes, for example:
stig/json-framework

|   |
|   | |   |   |   |   |   |
| stig/json-frameworkjson-framework - JSON (JavaScript Object Notation) is a light-weight data interchange format that's easy to read and write for humans and computers alike. This fram... |
| |
| View on github.com | Preview by Yahoo |
| |
|   |

  --------------------------------------------------------
Fernando 
YMail

 On Thursday, September 25, 2014 5:33 AM, Kevin Wojniak <notifications@github.com> wrote:

I've never been a fan of using RSS/XML for the update file, it always seemed way too verbose to me. I can never remember the exact XML layout either. I guess the one use is people can subscribe to them in their RSS feeders, but does anyone do that?I'm not sure which parts of the RSS feed Sparkle actually uses, but it seems the basics would be minimum. Here's an example:[
{
"releasenotes": "http://...",
"url": "http://...",
"version": "102",
"shortVersion": "1.0.2",
"dsaSignature": "MC0F..."
},
{
"releasenotes": "http://...",
"url": "http://...",
"version": "101",
"shortVersion": "1.0.1",
"dsaSignature": "MC0F..."
}
]
NSJSONSerialization is part of 10.7 so no third-party code would be required.—
Reply to this email directly or view it on GitHub.

@grahammiln

This comment has been minimized.

Show comment
Hide comment
@grahammiln

grahammiln Sep 25, 2014

Contributor

I subscribe to Sparkle RSS feeds with a feed reader. It is a useful way to track updates to third party software.

Some web sites, such as MacUpdate, use Sparkle RSS feeds to help automate their listings. Changing to JSON would require these sites to re-implement or extend their code.

Have you considered writing a script to analyse your application and output the Sparkle/RSS feed entry snippet or entire XML file? The script could encode all the fiddly details that you wish to avoid.

Contributor

grahammiln commented Sep 25, 2014

I subscribe to Sparkle RSS feeds with a feed reader. It is a useful way to track updates to third party software.

Some web sites, such as MacUpdate, use Sparkle RSS feeds to help automate their listings. Changing to JSON would require these sites to re-implement or extend their code.

Have you considered writing a script to analyse your application and output the Sparkle/RSS feed entry snippet or entire XML file? The script could encode all the fiddly details that you wish to avoid.

@kainjow

This comment has been minimized.

Show comment
Hide comment
@kainjow

kainjow Sep 25, 2014

Contributor

@fernandomorgan Sparkle is already 10.7+ so no need for 10.6 compatible libraries. The problem it appears with the Yahoo Sparkle repo is the code changes aren't in a separate diff, just in the initial commit, so that makes it a pain to integrate with this project.

@grahammiln Those that want to retain RSS can keep using it, but JSON could be made a new alternative format.

I wouldn't worry about what third-parties such as MacUpdate. Our updates = ad revenue = money to update their code to use JSON :)

I do have a script that automates this, at least for my work projects. My personal projects I do by hand. JSON seems to make more sense if one doesn't care about users subscribing to their update file.

Contributor

kainjow commented Sep 25, 2014

@fernandomorgan Sparkle is already 10.7+ so no need for 10.6 compatible libraries. The problem it appears with the Yahoo Sparkle repo is the code changes aren't in a separate diff, just in the initial commit, so that makes it a pain to integrate with this project.

@grahammiln Those that want to retain RSS can keep using it, but JSON could be made a new alternative format.

I wouldn't worry about what third-parties such as MacUpdate. Our updates = ad revenue = money to update their code to use JSON :)

I do have a script that automates this, at least for my work projects. My personal projects I do by hand. JSON seems to make more sense if one doesn't care about users subscribing to their update file.

@kainjow kainjow changed the title from Idea: switch to JSON for update file to Idea: add JSON as an alternative update file format Sep 25, 2014

@kornelski

This comment has been minimized.

Show comment
Hide comment
@kornelski

kornelski Sep 25, 2014

Member

It doesn't do anything that XML can't, except following a fashion of the day.

There's a cost of fragmenting Sparkle ecosystem, and it increases maintenance and testing cost.

And it'll be another liability when fashion moves to a better format that supports comments and trailing commas.

Member

kornelski commented Sep 25, 2014

It doesn't do anything that XML can't, except following a fashion of the day.

There's a cost of fragmenting Sparkle ecosystem, and it increases maintenance and testing cost.

And it'll be another liability when fashion moves to a better format that supports comments and trailing commas.

@kornelski kornelski closed this Sep 25, 2014

@kainjow

This comment has been minimized.

Show comment
Hide comment
@kainjow

kainjow Sep 25, 2014

Contributor

RSS was originally used because it was the fashion at the time and everyone was making podcasts. The fact that Sparkle had to add on to RSS means RSS wasn't a good choice to use from the start. If anything it should have used its own XML format instead of hacking RSS.

JSON solves that by using less bytes, simpler format, and not being a hack.

I don't think anyone is wanting comments in their update file...

If the code was structured so the update file was abstract, you would have virtually no extra maintenance especially since that part of the code isn't changing often. Say you want to add a new field for an update item. Add an XML representation and a JSON representation, add a test, and call it a day.

IMO, this was closed prematurely.

Contributor

kainjow commented Sep 25, 2014

RSS was originally used because it was the fashion at the time and everyone was making podcasts. The fact that Sparkle had to add on to RSS means RSS wasn't a good choice to use from the start. If anything it should have used its own XML format instead of hacking RSS.

JSON solves that by using less bytes, simpler format, and not being a hack.

I don't think anyone is wanting comments in their update file...

If the code was structured so the update file was abstract, you would have virtually no extra maintenance especially since that part of the code isn't changing often. Say you want to add a new field for an update item. Add an XML representation and a JSON representation, add a test, and call it a day.

IMO, this was closed prematurely.

@kornelski

This comment has been minimized.

Show comment
Hide comment
@kornelski

kornelski Sep 25, 2014

Member

@kainjow "hacking" RSS argument doesn't make sense: 1) XML is supposed to be eXtensible like that, 2) There isn't any existing JSON-based feed format that Sparkle could reuse, so it's not even apples to apples comparison.

The difference in markup overhead is minimal, and it's better to spend effort on reducing bandwidth waste by using HTTP cache validation.

Sorry, but there is a real cost to adding JSON, and it doesn't solve any real problem. "Nice to have" and "XML is uncool" are not real problems.

Member

kornelski commented Sep 25, 2014

@kainjow "hacking" RSS argument doesn't make sense: 1) XML is supposed to be eXtensible like that, 2) There isn't any existing JSON-based feed format that Sparkle could reuse, so it's not even apples to apples comparison.

The difference in markup overhead is minimal, and it's better to spend effort on reducing bandwidth waste by using HTTP cache validation.

Sorry, but there is a real cost to adding JSON, and it doesn't solve any real problem. "Nice to have" and "XML is uncool" are not real problems.

@jakepetroules

This comment has been minimized.

Show comment
Hide comment
@jakepetroules

jakepetroules Sep 25, 2014

Contributor

Yes, agreed with @pornel; there is no good reason to add JSON format support.

Besides with XML you get schema validation. ;)

Contributor

jakepetroules commented Sep 25, 2014

Yes, agreed with @pornel; there is no good reason to add JSON format support.

Besides with XML you get schema validation. ;)

@kornelski

This comment has been minimized.

Show comment
Hide comment
@kornelski

kornelski Jan 25, 2017

Member

Sparkle 1.16 comes with a tool to generate appcast automatically from files on disk. Hopefully with it there are fewer reasons to touch XML at all, so it won't bother you that much :)

Member

kornelski commented Jan 25, 2017

Sparkle 1.16 comes with a tool to generate appcast automatically from files on disk. Hopefully with it there are fewer reasons to touch XML at all, so it won't bother you that much :)

@kainjow

This comment has been minimized.

Show comment
Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment