RE: Offline transcript

I do like the idea of a “next” Prefix: 

 

    var x = new nextXMLHttpRequest();

 

As long as people do use a prefix, whatever it is, I think we are fine. A polyfill should be able to work with any prefix, it’s up to the user to decide which prefix it want, not to the developer (because the prolyfill developer can’t think about all prefix conflicts an author may face, while the final website author can).

 

 

 

However, I continue to believe that the best option is namespacing/modules. 

 

    var nxhr = { ... } // prolyfil module

    var x = new nxhr.XMLHttpRequest();

 

You can do the same with extensions to an interface (here: HTMLElement)

 

    document.body.nxhr.loadContent("/articles/"+articleID+"/html");

 

 

I believe we should develop both approaches in our WebIDL converter, and let people choose what they prefer when using the prolyfil, something like:

 

    nxhr.importNoPrefix();

    // var x = new XMLHttpRequest(); document.body.loadContent(...)

 

    nxhr.importPrefix("x") 

    // var x = new xXMLHttpRequest(); document.body.xLoadContent(...)

 

    nxhr.importNamespace("nxhr") 

    // var x = new nxhr.XMLHttpRequest(); document.body.nxhr.loadContent(...)

 

 

What do you think of this?

François

 


De : Mat Scales
Envoyé : ‎3‎ ‎janvier‎ ‎2013 ‎14‎:‎11
À : public-nextweb@w3.org
Objet : Re: Offline transcript


"prefixing is the worst form of compatibility protection, except for all the others"




Sorry for resurrecting this discussion, I was away from email for a couple of weeks.




I don't like prefixing but I am swayed by Brian's arguments and think that it is the only practical option.




However, I'm not sure I like "x-" as a prefix. "x-" in my mind says "custom", i.e. not standard at all. I would propose that nExt Web forward polyfills use a named prefix, perhaps "nextweb" or "nw". As this becomes known it will allow developers to make a distinction between user extensions and community supported proto-specifications.




On 20 December 2012 16:21, Marcos Caceres <w3c@marcosc.com> wrote:




On Thursday, December 20, 2012 at 4:16 PM, Clint Hill wrote:

> Marcos: I think actually what you wrote and what I wrote are in alignment as it relates to standards …
>
> > > Further: My dislike of prefixing is to this point. I would prefer to write against a "standard" goal. Which would imply that I write my implementation against a "standard" API. While this means in prollyfill it wouldn't be a recognized standard by any standards body immediately it does mean that my implementation code is choosing it as "standard".
> >
> > This is perverting the definition of a "standard". A standard has to be agreed upon by a set of entities (or it may be a de facto standard - if it is not ratified by any authority and has a large enough market share).
>
> I'm simply saying that as a dev I'd prefer to write against a "standard" - that being recognized by a body or being de facto. And I strongly believe that nExt Web will provide that confidence to devs. Which is to say that if it's the nExt Web prefix I can be comforted knowing it's a trusted prefix (and only 1).
>
> I've spent the last few days considering all this. I've always maintained that I understand/agree to prefixes, but have suspected/believed there could be an effort to avoid them. I'm on the side of prefixes now, but I will consistently push to make the fact of a prefix not create forward/backward compatibility (because I dislike this notion of implementation code that suits no purpose semantically or syntactically).

I strongly agree. If we can address that as a group, we should. Having said that, prefixing seems like a "safe" starting point.

>
> And I totally agree with Marcos: Code is king here and I think there should be more efforts on that.
>


I'd like to research some techniques. We should look at Modernizr and friends for this.


--
Marcos Caceres

Received on Thursday, 3 January 2013 13:37:29 UTC