Overview
The common container is a lightweight gadget-and-container framework.
For container clients, this is aimed to:
- simplify container and gadget integration model.
- provide near-zero barrier to entry to become a gadget container.
- directly fix problems in all containers, instead of per-container basis.
- reduce changes and differences across containers.
For the Shindig-based team, this is aimed to:
- place a localized control of gadget-and-container interaction.
- clearly separates gadget-and-container interaction from container-specific logic.
- allow security, latency, and functionality changes simultaneously in both gadget and container.
Features
Some features are, but not limited to:
- versioned JS loading.
- navigation of gadgets (pop-in and -out on page).
- latency timing broadcasting.
- hooks for gadget+container RPC functionalities.
- pre-loading of gadgets.
- security token refresh.
- user-preference.
What's new?
2010/12/08: Allow gadget render in cajole mode (in dev)
This can now be requested –
container wide, via configrenderCajole = true
per gadget request, via renderParams\cajole = true
2010/12/05: Correct gadget metadata caching (in dev)
Correct client-side caching behavior. Previously, CC cached gadgets iframes and metadatas indefinitely locally in the browser client. This is a problem for container pages that long-lived (ie: AJAX applications will not see new gadget changes unless reloaded). Now, cache is busted according to what the server says (currently, fixed toshindig.cache.xml.refreshInterval), with some adjustments to differences betweenserver/client absolute times. Cache will not be busted for navigated and preloaded gadgets. For simplicity, gadgets need to be closed (unnavigated) and/or unloaded (if preloaded) for its cache to be possibly evicted.
2010/11/01: Broadcast CSI latency times (in sandbox)
Provides latency timing and reporting back to the container, upon a gadget navigation. This is facilitated by requiring the container to register a callback function, ie: config['navigateCallback'] = function(data)
CC will synchronously call the specified callback function upon a gadget navigation. As part of the data, CC will return a JSON map of –
id : ID of the calling gadget site, ie: gadget site that performs the navigated.
url : Gadget URL (of gadget site with id) navigated to.
xrt : XHR time.
2010/10/05: Lazy-load and cache container.js
Add support for lazy-loading versioned JS. Specify &jsload= and &onload= (required upon presence of &jsload=) in /gadgets/js/google.container.js?jsload=1&onload=XXX. GGS will return a very slim JS (with default browser cache) to dynamically load a corresponding versioned &v= JS in /gadgets/js/google.container.js?&v=YYY. Either one of two things will happen –
- If first encounter, this will do another fetch to GGS for the full common container JS. This will have a long browser expiry time, 1 year.
- Otherwise, content will be retrieved from browser cache.
In both cases, each will require (at minimum) 1 HTTP fetch for the lighweight loader JS.
2010/09/30: Onload notification of container.js
Add support for callback upon JS download complete. Specify optional &onload= in /gadgets/js/google.container.js&onload=XXX, where XXX is globally-defined function window[XXX] = function()
.