Firefox/Projects/TabCandy/Work: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎Development: Fix typo in non-debug script. What about the debug script?)
No edit summary
Line 14: Line 14:
* [http://hg.mozilla.org/labs/tabcandy/ TabCandy Repo]
* [http://hg.mozilla.org/labs/tabcandy/ TabCandy Repo]
* [http://www.azarask.in/projects/bugzilla/ TabCandy Bugs]
* [http://www.azarask.in/projects/bugzilla/ TabCandy Bugs]
* [[Firefox/Projects/Tabcandy/CodeGuide|Reviewers Guide]]


= Design =
= Design =

Revision as of 02:36, 23 July 2010

This is the top-level work page for the TabCandy team.

Who

Important Pages

Design

Development

These instructions assume you're on a Mac; please update with info for other platforms as needed.

TabCandy is part of Firefox, so to build it you need to build Firefox. Use the basic instructions, with a few exceptions:

Once you've done a full build, for future builds you can just package up the various pieces TabCandy needs. One approach is to make a shell script like so:

make -s -j8 -C obj-ff-dbg/browser/locales && make -s -j8 -C obj-ff-dbg/browser/themes && make -s -j8 -C obj-ff-dbg/browser/base && make -s -j8 -C obj-ff-dbg/browser/app
obj-ff-dbg/dist/MinefieldDebug.app/Contents/MacOS/firefox-bin -no-remote -P tcc

This builds just the pieces needed (assuming your build directy is "obj-ff-dbg") and then launches the app (with a profile named "tcc").

Or, for those who didn't make a debug build the script would look like:

make -s -j8 -C objdir-ff-release/browser/locales && make -s -j8 -C objdir-ff-release/browser/themes && make -s -j8 -C objdir-ff-release/browser/base && make -s -j8 -C objdir-ff-release/browser/app
objdir-ff-release/dist/Minefield.app/Contents/MacOS/firefox-bin -no-remote -P tcc

The html and javascript files are in browser/base/content/tabcandy. The images and CSS file are in browser/themes/pinstripe/browser/tabcandy (for Mac; other platforms coming soon).

Debugging

All of our JavaScript files get concatenated into a single tabcandy.js, so error line numbers don't line up with the original source files. To easily access built tabcandy.js, add ac_add_options --enable-chrome-format=flat to your .mozconfig file; it won't zip up the JavaScript into .jar files. You can then find it at:

<objdir>/dist/bin/chrome/browser/content/browser/tabcandy.js

Restart-less Development

If you set your .mozconfig to have ac_add_options --enable-chrome-format=symlink, you can just hit the reset link in tabcandy to get the updated edits without needing to restart the browser assuming you've run the build command (e.g., make -C browser)

Code Documentation

You can find the documentation here.

We're using Natural Docs. There's a shell script (only tested on Mac) that runs Natural Docs on our code and converts the comments in the JavaScript to HTML docs. It'll generate a folder, naturaldocs-data, that'll be ignored by hg; you should ignore it too... it's just cache for the script.

Even though the TabCandy code is now in the tabcandy-central branch, we're still keeping the documentation in the old tabcandy branch. The docs script, tcc-docs.sh, assumes your tabcandy-central folder is next to your tabcandy folder.

Style Guide

Use spaces, not tabs, with two spaces per "tab stop".

80 character line length limit.

Prefer native methods over libraries where appropriate. For instance, use Array.forEach() rather than iQ.each() (note that for each(...in...) has issues and should generally be avoided).