SummerOfCode/2013/newMemoryPage/week3

From MozillaWiki
Jump to: navigation, search

End of Week 3: Report

It has been a long time since we started trying to get D3 to work inside the SDK. It is rather odd that the library itself was showing errors when compiled with the SDK. It is obviously not a good approach to touch-up the library for this purpose -- because that is not elegant, although mostly because there are some 800-odd errors. On a deeper look, I found that the problem lay with the Jetpack SDK itself -- the code embedded within an HTML file was being subjected to the 'strict' mode name-spacing of JavaScript.

This report was duly filed, and the other developers seem to agree -- this behavior is not by design. The SDK should not impose the strict mode on any and all embedded content in the target HTML file.

Although this behavior got me to explore the amazing power of the contentScript and contectScriptFile functionality of the SDK, so thumbs up for that! It turned out to be really useful, and resulted in the add-on structure being very well sorted, and readable. The main script has been reduced to the essential chrome calls, and the rest has been transferred to a module that solely interacts with D3.