Re: Shared workers - use .source instead of .ports[0] ?

On Tue, Apr 10, 2012 at 11:11 PM, Simon Pieters <simonp@opera.com> wrote:
> On Wed, 11 Apr 2012 07:56:48 +0200, Jonas Sicking <jonas@sicking.cc> wrote:
>
>> On Tue, Apr 10, 2012 at 10:44 PM, David Levin <levin@google.com> wrote:
>>>
>>> What is the backwards compatibility story for websites already using
>>> SharedWorkers with the interface that has been in the spec for over a
>>> year
>>> now?
>>>
>>> There are sites using them. For example, Google Docs uses them and Google
>>> Web Toolkit exposes them.
>
> Either we get them updated to the new API or we keep ports[0] around for
> compat. If we can't get rid of ports[0], I see less value in making the
> change at all since some scripts will use .source and other will use
> .ports[0], which seems pretty confusing.
>
> Google Docs can hopefully be updated before implementations ship with this,
> but GWT might be more problematic since there may be legacy apps around with
> unknown update shedule...

I would prefer to expose the port through .source even if we can't get
rid of .ports[0] right now. The ports property is basically useless
right now except for this one instance and so while I agree that there
might be some confusion in the short term, it doesn't seem like it
would be a compatibility problem, and long term it seems like a win
that authors wouldn't have to worry about the property at all. It
might continue to work if we decide that it's needed for back compat,
but it seems like we eventually would be able to get rid of it given
how new the property still is.

/ Jonas

Received on Wednesday, 11 April 2012 07:30:56 UTC