<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mozilla Web Development &#187; javascript</title>
	<atom:link href="http://blog.mozilla.com/webdev/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mozilla.com/webdev</link>
	<description>Everybody Likes Ninjas</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:41:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What is Shipyard?</title>
		<link>http://blog.mozilla.com/webdev/2011/10/11/what-is-shipyard/</link>
		<comments>http://blog.mozilla.com/webdev/2011/10/11/what-is-shipyard/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 18:09:34 +0000</pubDate>
		<dc:creator>Sean McArthur</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[flightdeck]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[shipyard]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=2035</guid>
		<description><![CDATA[At our recent Mozilla All Hands, I shared some slides about Shipyard, a JavaScript MVC framework that is making it’s way into Add-on Builder. It’s not finished, but since I shared it there, it felt appropriate to share what there currently is here. Summary Shipyard is an application framework that covers all the common things [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>At our recent Mozilla All Hands, I shared <a href="https://docs.google.com/present/edit?id=0AbkIbW9hDUKXZGRwMnpuaHNfNmNyenNyNmhx&amp;hl=en_US">some slides about Shipyard</a>, a JavaScript MVC framework that is making it’s way into <a href="https://builder.addons.mozilla.org/">Add-on Builder</a>. It’s not finished, but since I shared it there, it felt appropriate to share what there currently is here.</p>
<h3>Summary</h3>
<p>Shipyard is an application framework that covers all the common things any JavaScript application would need to deal with: interacting with a server, storing data, rendering said data in the browser, and responding to user actions. An application built on Shipyard should only have to write the parts to pull all those things together.</p>
<p>If you’re application is going to have 1000 lines of JavaScript, would you rather write all those yourself, or have 900 of them be in a framework that is tested and used by others?</p>
<p>When starting a web application, you would reach for Django, or CakePHP, or Rails; never would you decide to use just the language itself. Why shouldn’t you do the same when the target language is JavaScript?</p>
<h3>Framework-wide Goals</h3>
<ol>
<li>Be able to declare dependencies inside the code, and not be bothered with managing them during development or deployment.</li>
<li>Be easily testable, using a node test runner.</li>
<li>Not reliant on any other language. Build scripts will use JavaScript. The End.</li>
</ol>
<h3>More</h3>
<p>It’s heavily influenced by <a href="http://mootools.net">MooTools</a>, since they have an excellent modular design, but turned into CommonJS modules while Moo 2.0 figures itself out. There’s <a href="https://docs.google.com/present/edit?id=0AbkIbW9hDUKXZGRwMnpuaHNfNmNyenNyNmhx&amp;hl=en_US">slides</a>, and the <a href="https://github.com/seanmonstar/Shipyard">repository</a>, again. You could even discuss what true <a href="https://github.com/seanmonstar/Shipyard/issues/1">Controllers should do</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2011/10/11/what-is-shipyard/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Node.js On Windows</title>
		<link>http://blog.mozilla.com/webdev/2011/10/10/installing-node-js-on-windows/</link>
		<comments>http://blog.mozilla.com/webdev/2011/10/10/installing-node-js-on-windows/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 12:19:31 +0000</pubDate>
		<dc:creator>Schalk Neethling</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nodejs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[set-up]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=2119</guid>
		<description><![CDATA[Node.js is an evented system, that allows JavaScript developers to write fast, non-blocking, applications that run independent of the client and have access to aspects of the underlying operating system such as the file system. Installing Node.js on systems such as Linux or Mac OSX is straight forward and simple but, installing it under Windows [...]]]></description>
			<content:encoded><![CDATA[<p>Node.js is an <a href="http://en.wikipedia.org/wiki/Event-driven_programming">evented</a> system, that allows JavaScript developers to write fast, non-blocking, applications that run independent of the client and have access to aspects of the underlying operating system such as the file system.</p>
<p>Installing Node.js on systems such as Linux or Mac OSX is straight forward and simple but, installing it under Windows is a little more tricky, that is until the <a href="http://blog.nodejs.org/2011/06/23/porting-node-to-windows-with-microsoft%E2%80%99s-help/">port of Node.js to Windows</a> is complete, allowing Node.js to run natively on Windows.</p>
<p>Your first step is to <a href="http://www.cygwin.com/">download and install Cygwin</a>. For Nodejs you can <a href="http://nodejs.org/#download">grab the zip archive</a> (remember, even numbers = stable releases, uneven numbers != stable) or you can <a href="https://github.com/joyent/node">clone the repository directly from Github</a>. I am using the clone route for this article.</p>
<h2>Getting Cygwin Ready</h2>
<p>Whether you are going to work from a clone using Git or not, we need to step back for a little bit and add a couple of additions to Cygwin before we can continue. To install extra features run the setup.exe file you downloaded when initially installing Cygwin. Once you get to the select packages window, type git into the search input.</p>
<p>From the result, open up the develop tree and select git and git-completion(optional):</p>
<p><img class="alignnone size-full wp-image-2121" title="Adding Git support" src="http://blog.mozilla.com/webdev/files/2011/10/Screenshot-2011-10-09_17.28.26.png" alt="Adding Git support" width="700" height="135" /></p>
<p>Next type in python, open up the interpreters tree and select the Python interpreter:</p>
<p><img class="alignnone size-full wp-image-2122" title="Adding Python Support" src="http://blog.mozilla.com/webdev/files/2011/10/Screenshot-2011-10-09_22.32.52.png" alt="Adding Python Support" width="700" height="232" /></p>
<p>Next we need to add a C++ compiler, type g++ into the search input, open up the develop tree and select gcc-g++</p>
<p><img class="alignnone size-full wp-image-2123" title="Adding the C++ Compiler" src="http://blog.mozilla.com/webdev/files/2011/10/Screenshot-2011-10-09_22.37.18.png" alt="Adding the C++ Compiler" width="700" height="126" /></p>
<p>We also need to add the openssl-develop package. Type in openssl, expand the Develop tree and select openssl-develop</p>
<p><img class="alignnone size-full wp-image-2124" title="Adding OpenSSL Support" src="http://blog.mozilla.com/webdev/files/2011/10/Screenshot-2011-10-09_22.54.42.png" alt="Adding OpenSSL Support" width="700" height="125" /></p>
<p>Lastly, we need the all important make utility. Type make into search, expand the Develop tree and select make from the list:</p>
<p><img class="alignnone size-full wp-image-2125" title="Adding the make utility" src="http://blog.mozilla.com/webdev/files/2011/10/Screenshot-2011-10-09_22.57.59.png" alt="Adding the make utility" width="562" height="80" /></p>
<p>Accept the required packages and click next again. Once the installation is complete, we can continue.</p>
<h2>Getting The Nodejs Source</h2>
<p>Open up Cygwin again and navigate to the directory you want to clone Nodejs to:</p>
<pre>cd /cygdrive/c/github/</pre>
<p>Now run the following command to clone the repo:</p>
<pre>git clone https://github.com/joyent/node.git nodejs</pre>
<p>After this is complete, move into the nodejs directory. We now need to checkout the version we want to build so, instead of just a plain checkout, we will specify the version we want:</p>
<pre>git checkout v0.4.12</pre>
<blockquote><p>NOTE: If you have AVG AntiVirus installed it is going to mark the above process as a possible virus and prevent the checkout from happening successfully. Head into the AVG preferences and under ‘Resident Shield’ add an exception that points to the path where you Nodejs source will be located.</p></blockquote>
<h2>Building Node</h2>
<p>Once the checkout is complete, run:</p>
<pre>./configure</pre>
<p>NOTE: If when running the above command you get an error stating “unable to remap&#8230;&#8230;.”, you will need to rebase. To do this, close your current Cygwin window and open the Windows command prompt.</p>
<p>From here navigate to the bin directory inside Cygwin, for example</p>
<pre>c:/cygwin/bin</pre>
<p>From here run ash.exe. At the resulting bash, type /bin/rebaseall</p>
<p>Now, open up your Cygwin shell again and rerun configure. Once completed, run make and lastly run make install. Once this is DONE, you have a Nodejs environment on Windows.</p>
<h2>Testing Our Installation</h2>
<p>To test that our environment does indeed work, let’s use the staple Hello World example from the Nodejs site. In a folder anywhere on your computer, create a new file and call it hello.js, inside this, add the following:</p>
<pre>var http = require('http');
  http.createServer(function (req, res) {
      res.writeHead(200, {'Content-Type': 'text/plain'});
      res.end('Hello World\n');
  }).listen(1337, "127.0.0.1");

console.log('Server running at http://127.0.0.1:1337/');</pre>
<p>Now, navigate to this file location using Cygwin and run the following command:</p>
<pre>node hello.js</pre>
<p>If you get a response such as &#8220;Server running at http://127.0.0.1:1337/&#8221;, Nodejs is working. For more proof, open up that URL and stare in amazement. And that is it, a working Nodejs installation on your Windows machine, enjoy!</p>
<p>I will be following this article up with a short one on setting up NPM, the Nodejs package manager, on Windows. On a side note, there is currently a native node.exe installer for Windows but, this is in the unstable 0.5.8 branch so, although I have been told it should be fine for testing and local development, if you wanna live on the edge, <a href="http://nodejs.org/dist/v0.5.8/node.exe">give it a go</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2011/10/10/installing-node-js-on-windows/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Behind the Scenes of the Plugin Check Page</title>
		<link>http://blog.mozilla.com/webdev/2010/05/14/behind-the-scenes-of-the-plugin-check-page/</link>
		<comments>http://blog.mozilla.com/webdev/2010/05/14/behind-the-scenes-of-the-plugin-check-page/#comments</comments>
		<pubDate>Fri, 14 May 2010 20:30:38 +0000</pubDate>
		<dc:creator>Austin King</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=981</guid>
		<description><![CDATA[As noted on our security blog, we’ve just pushed out a major update to the plugin check page and service. The two core ideas are: Groundwork for a plugin directory Cross browser plugin checking The Backend Les Orchard has created a backend to the plugin finder service. We’ve added another input to the call named [...]]]></description>
			<content:encoded><![CDATA[<p>As noted on our <a href="http://blog.mozilla.com/security/2010/05/11/plugin-check-for-everyone/">security blog</a>, we’ve just pushed out a major update to the plugin check page and service.<br />
<a href="http://blog.mozilla.com/webdev/files/2010/05/CrossBrowserScreenshot.jpg"><img src="http://blog.mozilla.com/webdev/files/2010/05/CrossBrowserScreenshot-300x158.jpg" alt="" title="Cross Browser Support" width="300" height="158" class="alignright size-medium wp-image-1002" style="margin-right: 15px;" /></a><br />
The two core ideas are:</p>
<ul>
<li>Groundwork for a plugin directory</li>
<li>Cross browser plugin checking</li>
</ul>
<h3 style="clear:right">The Backend</h3>
<p>Les Orchard has <a href="http://blog.mozilla.com/webdev/2010/01/08/rebuilding-the-plugin-directory/"> created a backend</a> to the plugin finder service. We’ve added another input to the call named ‘detection’ which will allow us more flexibility in how we match known releases to OS / Product / Version / Plugin / Plugin Version combos. More news at 11, but he’s built the core pieces for a self-service plugin release application.</p>
<h3>The Frontend</h3>
<p>We updated the JavaScript client to support ‘<strong>modern browsers</strong>’ as well as IE. </p>
<h4>But IE 8 is a modern browser!</h4>
<p>Hmm, well it doesn’t have a <code>navigator.plugins object</code>. Other popular and recently released desktop browsers *do* have this feature. Heck, even some phone&#8217;s browsers have it.</p>
<p><em>Breaking News:</em> The platform preview of IE 9 has a working <code>navigator.plugins</code> object! So IE 9 fits the modern browser category&#8230; <strong>Congrats to the IE 9 team</strong>! We&#8217;ll make sure the page works by the time IE 9 ships, filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=566003">Bug#566003</a>.</p>
<h3>Cross Browser Flavors</h3>
<p>Our plugin detection uses one of three strategies:</p>
<ol>
<li>Strategy 1) <strong>Iterate</strong> the plugins objects and parse a version string out of the description or name</li>
<li>Strategy 2) <strong>Iterate</strong> the plugins objects and use the ‘version’ property</li>
<li>Strategy 3) Instantiate <strong>well-known</strong> plugins and test their version via the <a href="http://www.pinlady.net/PluginDetect/">pinlady.net</a> version detection library.</li>
</ol>
<p>If your goal is to protect as many users from as many known plugin vulnerabilities as possible&#8230; Strategy 3 doesn’t scale. Strategies 1 and 2 are dynamic and (in the best case) plugin agnostic. As new plugins come onto the market, the plugin finder service has to be updated, but no new code has to be written and shipped.</p>
<p>This is why IE plugin detection <a href="http://www.mozilla.com/en-US/plugincheck/more_info.html">is limited</a>.</p>
<p>Strategy 2 is the cleanest&#8230; and only supported by Firefox 3.6+. We would be pleased as punch if other browser vendors would create a version property. The Plugin Check page and other pieces of code that do plugin detection, will become more accurate.</p>
<p>We’re really excited about supporting all browsers and that is what Strategy 1 buys us. When a vendor has put a useful version number in the description or name, then it&#8217;s possible for our page to help Safari, Opera, or Chrome users understand their plugin versions better.</p>
<h4>Geeky Aside:</h4>
<p>Fly in the ointment, even for Firefox 3.6+ we currently will use methods #1 and #2 depending on what’s best for detecting the most accurate version for the most popular plugins. Why is nothing every simple?</p>
<h3>What can browser vendors do?</h3>
<p>Please implement the <code>navigator.plugins[x].version</code> property. This exposes an explicit plugin version number from the vendor.</p>
<h4>Why?</h4>
<p>It will keep your users safer. This and other security tools can detect vulnerable versions easier and more accurately.</p>
<h3>What can plugin vendors do?</h3>
<p>At a minimum, please put your full version number in the plugin description field.  Also make this as exact as possible, include the build number etc. 1.1.2.9282 is better than 1.1.2. Bonus points, expose your version numbers in the version property, even on Linux builds of your plugin.</p>
<h4>Why?</h4>
<ul>
<li>Keep your users safe</li>
<li>Improve your lastest version uptake</li>
<li>Keep users coming back to your distribution channel</li>
<li>Reduce your support costs</li>
</ul>
<h4>What&#8217;s next?</h4>
<p>We&#8217;ve built the plumbing and populated it with some popular plugins versions. Our next major release will be focused on building a self-service plugin release management app, so that vendors can populate the data for the backend API.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2010/05/14/behind-the-scenes-of-the-plugin-check-page/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Plugin Checker Launched</title>
		<link>http://blog.mozilla.com/webdev/2009/10/13/plugin-checker-launched/</link>
		<comments>http://blog.mozilla.com/webdev/2009/10/13/plugin-checker-launched/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 22:28:05 +0000</pubDate>
		<dc:creator>Mike Morgan</dc:creator>
				<category><![CDATA[Mozilla.com]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=731</guid>
		<description><![CDATA[Today we launched a Plugin Checker to help people find and update their plugins. Why is this important to you? Crashes are the number one concern for Firefox users, and we are listening. At least 30% of all Firefox crashes are caused by third-party plugins. Many major security vulnerabilities exploit out of date plugins. Why [...]]]></description>
			<content:encoded><![CDATA[<p>Today we launched a <a href="http://www.mozilla.com/en-US/plugincheck/">Plugin Checker</a> to help people find and update their plugins.</p>
<p><a href="http://blog.mozilla.com/webdev/files/2009/10/nurse.png"><img src="http://blog.mozilla.com/webdev/files/2009/10/nurse.png" alt="smiling nurse" width="226" height="215" class="alignright size-full wp-image-754" /></a></p>
<h2>Why is this important to you?</h2>
<ul>
<li>Crashes are the number one concern for Firefox users, and we are listening.</li>
<li>At least 30% of all Firefox crashes are caused by third-party plugins.</li>
<li>Many major security vulnerabilities exploit out of date plugins.</li>
</ul>
<h2>Why is this important to Mozilla?</h2>
<p>Increasing awareness about plugins makes the web better, and that&#8217;s <a href="http://www.mozilla.org/about/manifesto">our mission</a>.</p>
<ul>
<li>We want the web to be safer.</li>
<li>We want the web to be less crashy.</li>
<li>We want to help everyone &#8212; not just Firefox users &#8212; to address the plugin problem. (though admittedly it doesn&#8217;t fully work with all browsers yet, it will)</li>
</ul>
<h2>What did we do?</h2>
<p>The plugin checker has three components:</p>
<ul>
<li>The Server: <a href="https://wiki.mozilla.org/PFS2">Plugin Finder Service (PFS2)</a></li>
<li>The Javascript: <a href="http://github.com/ozten/Perfidies-of-the-Web/tree">Perfides</a></li>
<li>The Web Page: <a href="http://www.mozilla.com/en-US/plugincheck/">mozilla.com</a></li>
</ul>
<p> The end result is actually pretty simple &#8212; and that&#8217;s how it needs to be.  Here&#8217;s your plugins, and here&#8217;s their statuses:</p>
<p><a href="http://blog.mozilla.com/webdev/files/2009/10/flash_quicktime.png"><img src="http://blog.mozilla.com/webdev/files/2009/10/flash_quicktime.png" alt="flash_quicktime" title="Example showing Flash and Quicktime plugin statuses"  width="660" height="159" class="aligncenter size-full wp-image-732" /></a></p>
<p>Putting it all together, we reach a workflow similar to the graph below.  Our goal is to query a central database that contains plugin information and inform users about the status of their plugins.  This was built so it could be used to support Firefox directly in the future.</p>
<p><a href="http://blog.mozilla.com/webdev/files/2009/10/pfs-workflow.png"><img src="http://blog.mozilla.com/webdev/files/2009/10/pfs-workflow.png" alt="pfs-workflow" title="this shows that the web service can power both a web front-end or an integrated client service" width="537" height="574" class="aligncenter size-full wp-image-740" /></a></p>
<h2>What will happen next?</h2>
<p>The three components above are a good start, but together we can do more.</p>
<ul>
<li><a href="http://theunfocused.net/2009/10/06/firefox-3-6-knows-when-your-plugins-are-out-of-date/">Integrate this experience with the Firefox client</a>.  Firefox will identify vulnerable plugins and help you update them.</li>
<li>Create a self-service panel for vendors to update their plugin info as new releases come out.</li>
<li>Create an open directory for all plugin information (sort of like <a href="http://plugindoc.mozdev.org/">Plugindoc</a> but dynamic)</li>
<li>Evangelize plugin detection via an embeddable widget &#8212; get it out on WordPress, etc.</li>
<li>Integrate with our <a href="http://crash-stats.mozilla.com/">crash reporting system</a> so we have a report card/dashboard for which plugins are most crashy</li>
</ul>
<h2>How can you help?</h2>
<p>This entire project is open source.  You can work on any of these components to help contribute to the effort:</p>
<ul>
<li><a href="http://svn.mozilla.org/projects/pfs2/trunk/">View the server code for PFS2</a></li>
<li><a href="http://github.com/ozten/Perfidies-of-the-Web">View the client code for Perfides</a></li>
<li><a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Websites&#038;component=www.mozilla.com">File a bug if you find one</a></li>
<li><a href="http://spreadsheets.google.com/viewform?formkey=dGpKQkNuNkNQNjF4RW1FT08yRHRqMWc6MA..">Tell us about plugins we don&#8217;t know about</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/10/13/plugin-checker-launched/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Graph Server Re-Write</title>
		<link>http://blog.mozilla.com/webdev/2009/02/06/graph-server-rewrite/</link>
		<comments>http://blog.mozilla.com/webdev/2009/02/06/graph-server-rewrite/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 18:12:24 +0000</pubDate>
		<dc:creator>Ryan Doherty</dc:creator>
				<category><![CDATA[Graph Server]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=204</guid>
		<description><![CDATA[Over the past few months the Graph Server team and I have been hard at work re-writing the back end for the Graph Server and it&#8217;s finally come to fruition. For those that don&#8217;t know, the Graph Server is used to display performance test data of Firefox builds reported by Talos. Our work initially started [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few months the <a href="https://wiki.mozilla.org/Perfomatic#People">Graph Server team</a> and I have been hard at work re-writing the back end for the <a href="http://graphs.mozilla.org">Graph Server</a> and it&#8217;s finally come to fruition. </p>
<p>For those that don&#8217;t know, the Graph Server is used to display performance test data of Firefox builds reported by <a href="https://wiki.mozilla.org/Buildbot/Talos">Talos</a>.</p>
<p><img src="http://people.mozilla.org/~rdoherty/graph-server.jpg" width="450" height="317" alt="Graph Server screenshot" /></p>
<p>Our work initially started as performance improvements and some new features, but the more we worked with the old architecture, it became quite apparent it would not scale (performance and feature-wise). </p>
<p>The old database schema duplicated test data in multiple tables and stored similar, but different data in the same tables. Tables had ballooned to millions (and billions) of rows that were queried for basic information such as all unique test names, resulting in queries that ran forever. And the queries that did finish were looped over in JavaScript to pull out test information, resulting in the browser locking up because it was looping over hundreds of thousands of rows.</p>
<p>If it&#8217;s not clear already, one of main issues was with the database schema; it needed to be normalized.</p>
<p>Here&#8217;s the old, non-normalized schema:</p>
<p><a href="http://people.mozilla.org/~rdoherty/old-schema.png"><img src="http://people.mozilla.org/~rdoherty/old-schema-small.gif" width="450" height="199" alt="Old Graph Server schema" /></a></p>
<p>And here&#8217;s the new, normalized schema after the team was locked in a room for an afternoon:</p>
<p><a href="https://wiki.mozilla.org/images/d/d2/Graph_server_new_db_schema2.png"><img src="http://people.mozilla.org/~rdoherty/graph-server-new.jpg" width="450" height="294" alt="New Graph Server schema" /></a></p>
<p><strong>Much</strong> cleaner, no duplicated data, easy to understand the various machines, branches and tests that are used for displaying test data. No need look at entire tables to find basic information such as test names.</p>
<p>With this new schema in place, it also required a re-write of our server-side scripts we use to fetch test information for the front end graphing component. Since Mozilla is as open as possible, instead of just changing what was needed, I decided to implement a <a href="https://wiki.mozilla.org/Perfomatic:API">JSON API</a> that would allow anyone to easily retrieve test data.</p>
<p>Lastly, our Talos <--> Graph Server communication needed to be re-written. Lars rewrote the collector script that accepts values from Talos and Alice rewrote the pieces of Talos that send data to the Graph Server.</p>
<p>After all that work, we now have a <a href="http://graphs-stage2.mozilla.org/graph.html">working stage server</a> (Firefox 3.1 or higher required due to native JSON requirement) with our new code. We have a bit more testing and some performance benchmarking to do before it goes live, but we&#8217;re happy that all the pieces are working. </p>
<p>Want to know more? We have a wiki page with more information at <a href="https://wiki.mozilla.org/Perfomatic#Rearchitecture">https://wiki.mozilla.org/Perfomatic#Rearchitecture</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/02/06/graph-server-rewrite/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The Curious Case of the Giant Scrollbar</title>
		<link>http://blog.mozilla.com/webdev/2009/02/03/the-curious-case-of-the-giant-scrollbar/</link>
		<comments>http://blog.mozilla.com/webdev/2009/02/03/the-curious-case-of-the-giant-scrollbar/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 20:50:38 +0000</pubDate>
		<dc:creator>Ryan Doherty</dc:creator>
				<category><![CDATA[AMO]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[rtl]]></category>

		<guid isPermaLink="false">http://blog.mozilla.com/webdev/?p=164</guid>
		<description><![CDATA[Recently I fixed bug 439269 (&#8220;AMO theme has unnecessary scrollbar at the bottom&#8221;) and thought it was an interesting bug for a few reasons. To summarize the issue, for no apparent reason in right-to-left languages a really long scrollbar would appear at the bottom of the window. Even though there was a scrollbar, when you [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I fixed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=439269">bug 439269</a> (&#8220;AMO theme has unnecessary scrollbar at the bottom&#8221;) and thought it was an interesting bug for a few reasons.</p>
<p>To summarize the issue, for no apparent reason in right-to-left languages a really long scrollbar would appear at the bottom of the window.</p>
<p><img src="http://people.mozilla.org/~rdoherty/scrollbar.jpg" alt="Screenshot of scrollbar" width="450" height="312" /></p>
<p>Even though there was a scrollbar, when you scrolled all the way to the left, nothing was there. Another reason this was odd was the scrollbar only appeared in right-to-left (RTL) languages. Inspecting the page via Firebug didn&#8217;t give any clues as to what was causing the issue as there was no element hidden somewhere onscreen. Finally, to make things even weirder, the scrollbar only appeared when JavaScript was turned on.</p>
<p>After some thought, I had a feeling that we might be using absolute positioning to position an element to the left and above the page offscreen, which is quite common. In a RTL page, however, left is does not move an element outside a page&#8217;s boundaries. So the result is you get a scrollbar.</p>
<p>So what&#8217;s a web developer to do? Firebug to the rescue! I popped it open and started typing some JavaScript into the console to find an element that seemed really far offscreen:</p>
<pre>var nodes = document.getElementsByTagName("*");

for(var i=0; i &lt; nodes.length;i++) {
    var node = nodes[i];
    if(node.offsetLeft &lt; -500) {
        console.log(node);
    }
}</pre>
<p>And Firebug&#8217;s console spit out:</p>
<pre>&lt;ul id="cat-list"&gt;</pre>
<p>Ah-ha! Now I was getting somewhere. A quick search through our CSS files for &#8216;#cat-list&#8217; found an interesting line of code:</p>
<pre>#categories.collapsed #cat-list {
    position: absolute;
    left: -999em;
    top: -999em;
}</pre>
<p>And when JavaScript is turned on, the class &#8216;collapsed&#8217; is added to the parent node #categories. In RTL mode this creates a huge scrollbar because -999em to the left of the page is a valid location that a user can scroll to. The solution?</p>
<pre>.html-rtl #categories.collapsed #cat-list {
    position: absolute;
    left: 999em;
    top: -999em;
}</pre>
<p>On any pages that are RTL, we add the class &#8216;html-rtl&#8217; to the body tag in order to change the layout for RTL languages. This fixes the issue by moving the category list offscreen to the <em>right</em>, which is outside the page in RTL mode.</p>
<p>Things to remember:</p>
<ul>
<li>Firebug is your friend</li>
<li>The DOM is a live document you can inspect, utilize this feature</li>
<li>Be careful with positioning with sites that are LTR and RTL</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.mozilla.com/webdev/2009/02/03/the-curious-case-of-the-giant-scrollbar/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

