Fluid.js and FluidIoC.js both require JSON, but the framework's dependency declaration doesn't specify json2.js.

Description

Both Fluid.js and FluidIoC.js use the JSON.stringify() method, which causes the JSON object to be a framework-wide dependency. This is fine for modern browsers, which all includes native implementations of JSON. However, for compatibility with IE and older browsers, this means that json2.js is now a requirement of every component and user of Infusion. Do we want this?

If we do, we should update the framework's dependency declaration to include json2.js (although sending this down to modern browsers is a bit of a waste of bytes).

Environment

None

Activity

Show:

Harris Wong May 30, 2011 at 7:54 PM

Antranig Basman May 11, 2011 at 6:46 PM

We have a few options on how to deal with this. Right now, JSON is only used to provide better formatted error messages in a few log statements. We could go ahead with the dependency as it is, since converting things to JSON is a pretty fundamental activity and the dependency could possibly arise through other means. Another option would be to upgrade the signature of the fluid.log statement to conform to that of console.log

http://getfirebug.com/wiki/index.php/Console_API

It appears there is extra support (At least on Firefox, and possibly Chrome and others) for "rich dumping" of objects, DOM nodes etc - in this way we might be able to avoid the JSON dependence as well as getting better logging. We would need to see what do to on other platforms. Of course ironically the platforms which remove the need for the JSON file are the ones which have support for console.log anyway.

Justin Obara May 11, 2011 at 6:38 PM

we should also make sure to update all of the necessary html files to pull it in too.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created May 2, 2011 at 7:31 PM
Updated March 3, 2014 at 6:10 PM
Resolved May 16, 2011 at 7:57 AM

Flag notifications