Re: Is polyfilling future web APIs a good idea?

Question all,
Is web remoting web socket built in HTML 5 and above/
Why do we need XMLHttpRequest at all?
Pls. enlighten me.

I am not sure if we should be bothering about
XMLHttpRequest.

L.Mohan Arun
@cintanotes2
I want to write/proofread from home.


On Thu, Aug 6, 2015 at 5:49 PM, Matthew Robb <matthewwrobb@gmail.com> wrote:
> 'Prolly' is a slang term for probably... At least in the US it is.
>
> On Aug 5, 2015 11:00 PM, "Glen Huang" <curvedmark@gmail.com> wrote:
>>
>> Thanks for the detailed explanation.
>>
>> The only thing I'm not sure I understand is the pattern you described:
>>
>> ```
>> HTMLElement.prototype.foo = HTMLElement.prototype._foo;
>> ```
>>
>> I had this pattern in mind when you talked about prollyfills:
>>
>> ```
>> HTMLElement.prototype._foo = function() {
>>   if (HTMLElement.prototype.foo) return this.foo();
>>   return polyfill();
>> };
>> ```
>>
>> And users are expected to use it like html._foo() My concern was that when
>> most browsers ship HTMLElement.prototype.foo, users might want to change
>> html._foo() to html.foo() so they can use the native version, and the
>> prollyfill is expect to release a new version with
>>
>> ```
>> if (!HTMLElement.prototype.foo) {
>>   HTMLElement.prototype.foo = function() {
>>     return polyfill();
>>   };
>> }
>> ```
>>
>> I was saying changing html._foo() to html.foo() aren't that different from
>> changing foo(html) to html.foo();
>>
>> Where does HTMLElement.prototype.foo = HTMLElement.prototype._foo fit in
>> the picture?
>>
>> BTW, just curious, how do you come up with the name "prollyfill" :) ? Why
>> adding a R there?
>>
>>
>>
>>
>

Received on Thursday, 6 August 2015 12:35:37 UTC