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
consider not using _ to prefix extensions #19
Comments
For convenience, here's the main point:
|
For example, a hypothetical alternate version of the ‘Extensions’ section might have said:
|
This could also be solved by introducing a new top-level object: {
"extra": {
"my_vendor": {
"some_key": "value"
}
}
} This |
Thanks @kr and @svenluijten. Good to know about RFC 6648. I lean toward keeping |
A popular extension will become a de-facto standard. This has happened many times on the web (apple-touch-icon, meta viewport, tons of The HTML standard ended up using a central registry for this (https://wiki.whatwg.org/wiki/MetaExtensions) with a very low bar for registration of new names, and it seems to work fine. So I'd suggest just asking people to coordinate. Decentralized zero-contact extensibility sounds nice, but in reality we can talk to each other, especially that extensions will require cooperation between feed creators and consumers anyway. |
Given the history of RSS extensions coordination seems too hard. Following RFC 6648 gives you something like this: "https://blueshed-podcasts.com/json-feed-extension": {
"explicit": false,
"copyright": "1948 by George Orwell",
"owner": "Big Brother and the Holding Company",
"subtitle": "All shouting, all the time. Double. Plus. Good."
} Possible spec text:
Of course the developer behind the extension spec can and will go out of business and will delete the docs like so much of RSS extension documents did. But if one or more extensions in the same subject space get's popular and is useful for the whole ecosystem like the podcasting extensions to RSS, I'd argue that it is the job of the spec to document those extension instead of leaving the subject open to different extensions by different sources which all can go under. |
AFAIK RSS did not event attempt to have any sort of central coordination. There was no registry. 2.0 spec didn't even have a clear way to provide feedback. They've just said to use XML namespaces, and XML namespaces were generally misunderstood and incorrectly implemented (e.g. Sparkle required a specific prefix name instead of using NS URLs). URL keys are longer, much harder to remember and easier to get wrong (was it http or https? trailing slash?). And they're solving problem of decentralized extensibility with zero contact, instead of the problem of "we're all going to have to use this weird key if this extension becomes de-facto standard". |
Let's say message stickers become the new rage and somehow every podcast will have to have a sticker pack. We could have:
|
I think @pornel's examples highlight why we went with |
Going with just
Yes! The interesting part is what happens then? There's a popular extension called |
It's similar to what happens with CSS extensions, e.g. |
Yeah, so with CSS, basically only web browsers can add extensions. (Because they're the only software that interprets CSS that people have to interact with over the network.) And they basically only do this when they're trying to get their extension into the standard. And even then it only works because almost all browsers have aggressive auto-update systems. Everyone who's writing CSS files knows this from the start, so they plan for it and it's less of a headache. (But still a big headache that takes years to resolve for each extension.) The current situation strikes me as more similar to HTTP header fields. The classic example is X-Forwarded-For. There's a Forwarded field in the HTTP RFC, but nobody uses it. Everybody still uses X-Forwarded-For because that's the one that works. With X-Frame-Options (https://tools.ietf.org/html/rfc7034), they realized it would be futile to try to rename it and didn't even bother, they just standardized the X name. The difference is, with CSS there are basically only five programs in the world you need to worry about, and they auto-update like nobody's business. With HTTP there are hundreds, and many of them are pretty conservative (i.e. slow or never) with updates. I think JSON feed (especially if it is successful — and I really hope it will be! I love this spec, should've said so to start with) will be more on the HTTP end of the spectrum. As a machine-readable and machine-writable format, it'll have various network services that generate, transform, and interpret it. A feed aggregator is one example. If there is a widely used extension, say, You can specify the new name, but everyone will just keep using the name that is generated by the feed server on their random free multi-tenant web host and still works even on their cousin's five-year-old PC. In short: I predict the
I don't totally follow here. Do you have an example of a conflict that would happen with no prefix on extensions, and that would be prevented by putting an underscore in front? Note that new nonstandard HTTP header fields (these days) don't use any prefix (e.g. DNT), and conflicts are not a problem in practice. |
Good points. You're right that CSS is not the best comparison, although it's still similar in that I think the most popular extensions will be proposed by feed readers. As for conflicts, let's imagine that In this scenario it actually becomes difficult to even check whether a feed is valid. As soon as we promoted an extension with a conflicting name like that into the spec, we'd actually invalidate other feeds that used to be perfectly fine (the |
As @sonicdoe pointed out in another issue, extensions have to be objects, so my |
The situation with one key having two different bodies in two different implementations may happen indeed, but I think it's not too bad for two reasons: a) it can be made less likely, b) even if it happens, it can be resolved. It can be made less likely by tracking what extensions are used in the wild, and asking people to propose/register extensions they use. It is in implementors' interest to have their extensions widely known, conflict-free, and compatible with other clients. And even when a conflict happens, it can be fixed:
|
Aha, I see. Yeah, of course I can't say that such a conflict wouldn't happen. (But as @pornel mentioned it's in everyone's interest to avoid conflicts, so they seem unlikely. This matches what's happened so far with HTTP.) In that unfortunate scenario, I agree the spec wouldn't want pick just one of the two But I appreciate that all that might end up still being a confusing situation. Thanks for hearing me out. |
Reading, it says the prefix applies to new objects, not necessarily extra and established properties inside an existing object. For example, I just added a syndication property to items based on alternate copies of it. This isn't an object. |
From RFC 6648 ‘Deprecating the "X-" Prefix and Similar Constructs in Application Protocols’:
This spec's
_
prefix seems to qualify as a "similar construct".Maybe it's too late to do anything about this, and even if not, maybe the arguments in that RFC are not persuasive enough. But I wanted to raise the issue anyway, just in case.
The text was updated successfully, but these errors were encountered: