W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

Re: [widgets] localStorage vs preferences

From: Scott Wilson <scott.bradley.wilson@gmail.com>
Date: Mon, 20 Jul 2009 18:10:28 +0100
Cc: public-webapps <public-webapps@w3.org>
Message-Id: <121BB525-85D2-420D-B301-3A1C08A8391D@gmail.com>
To: Marcos Caceres <marcosc@opera.com>
On 20 Jul 2009, at 16:29, Marcos Caceres wrote:

> On 7/20/09 4:32 PM, Scott Wilson wrote:
>> -1
>>
>> No, we should keep widget.preferences.
>> If a UA wants to, it can simply implement it using:
>>
>> widget.preferences = window.localStorage;
>
> "If the UA wants to" seems kinda bad... I think the spec should say  
> something concrete about this. Either they are the same, or they are  
> not.
>
> We can't have on some platforms authors expecting values being  
> simultaneously saved to widget.preferences and window.localStorage,  
> and on others not.

A Widget author should be able to trust the implementation of the  
Widgets API, regardless of the UA. For conformance, having the UA  
implement widget.preferences reliably seems better for Widget authors.

Whether they can expect window.localStorage to work is a separate  
issue, and depends on what the UA is; the Widget author shouldn't need  
to worry about this as they should be able to develop widgets to run  
in any compliant UA, which could eventually be all kinds of devices  
and services, including ones like ours where window.localStorage  
doesn't really make sense.

>> If it doesn't, the UA can do its own implementation, which we do for
>> example, as for our UA localStorage is not an appropriate
>> implementation, as our users are more likely to interact with the  
>> same
>> widget using multiple browsers on multiple machines.
>
> Ok, I guess this means that your implementation of  
> widget.preferences is synchronizing multiple clients through some  
> kind of server-sent events or polling.

Yes.

>
> However, can't you have a some kind of "synchronizer" that listens  
> for Storage event and the sends those to the server to propagate to  
> dependent clients?

Far, far less easily and reliably than the reverse case of re-routing  
localStorage to preferences (above).

>> We can also
>> implement widget.preferences. We can't reimplement the user's
>> browser's WebStorage impl (if it has one).
>
> Ok, understood. That makes sense from a "Wookie" perspective.
>
>> For more detailed arguments for keeping preferences, just search back
>> through the list ;-)
>>
>> (We've already argued this one loads of times, Marcos! Why has it  
>> come
>> up again?)
>
> I guess it helps me understand the problem and articulate use  
> cases... need a "Wookie" reminder to keep me in check :)

Any time :-D

>
> Kind regards,
> Marcos



Received on Monday, 20 July 2009 17:11:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:32 GMT