Hi Fabian, Today Fabian Jakobs wrote:
> Hi, > > Yesterday I've landed a commit, which adds native JSON support to > qooxdoo. There is a new class qx.lang.Json, which has exactly the same > interface as the JSON object defined in the EcmaScript 5 specification > <https://developer.mozilla.org/En/Using_native_JSON>. All new browsers > like Firefox 3.5, Internet Explorer 8, Opera 10.5 or Safari 4 support it > natively. In browsers without native JSON support a modified version of > Douglas Crockford's json2 is used. This is great news because parsing > and serializing JSON is a lot faster on those browsers. > > BUT > > we cannot deprecate the old implementation yet. The qooxdoo JSON > implementation has historically maintained an incompatible JSON > extension to support dates. The idea was let "eval" create the date > instances: > > qx.util.Json.stringify({ date: new Date(123)}) --> {"date":new > Date(Date.UTC(1970,0,1,0,0,0,0))} > > While it probably was a good idea back then, it is a problem now because > we cannot make the browser's JSON object emit or parse this: > > JSON.stringify{ date: new Date(123)} --> {"date":"1970-01-01T00:00:00.000Z"} > > For the server side we have the same problem. If we support this e.g. in > PHP we cannot use PHP's buildin JSON support, which means a severe > performance hit. > > > Since the RPC code is the only code depending on this feature I would > like to know from the RPC authors: > > 1. Wouldn't dates represented as ISO strings be sufficient? Do you think > we need a special date extension? since perl does not have a 'native' date type anyway, this should do fine ... on the other something already 'split' into an array or a map might be quicker and less problematic than parsing an ISO date. > 2. If we find a standard compliant way to serialize dates, would you > update your backend code? sure > 3. Do you think everything is fine and we should just keep both JSON > implementations? nope ... :-) cheers tobi > > I'm really interested in your feedback, > > Best Fabian > > -- Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland http://it.oetiker.ch [email protected] ++41 62 775 9902 / sb: -9900 ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
