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

Metadata

Source
FLUID-4197
Type
Bug
Priority
Blocker
Status
Closed
Resolution
Fixed
Assignee
Justin Obara
Reporter
Colin Clark
Created
2011-05-02T15:31:48.237-0400
Updated
2014-03-03T13:10:09.640-0500
Versions
N/A
Fixed Versions
  1. 1.4
Component
  1. Framework

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).

Comments

  • Justin Obara commented 2011-05-11T14:38:04.882-0400

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

  • Antranig Basman commented 2011-05-11T14:46:24.341-0400

    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.

  • Harris Wong commented 2011-05-30T15:54:56.217-0400

    Related to json2 removal. https://github.com/fluid-project/infusion/commit/3e45b80f11b88b3b42982c50f23c7eafa3d1244a