Weekly developer tools update, Jan 19

kdangoor

4

Here are the highlights from this week’s meeting:

  • If you’re running Firefox Nightly, you should get Firebug 1.10a1
  • the GCLI command line  is being turned back off in the Web Console, but it will come back in the Developer Toolbar feature that is coming later
  • Web Console is undergoing restyling
  • Sonny has picked up the e10s patch for the Web Console, which we’re hoping will ultimately help the Web Console become remotable
  • Style Editor transitions have landed
  • Script Debugger is partway through superreview, and Panos has posted a document about the architecture

Those are the highlights for this week. Check out the full outline on the wiki, and join us next Thursday and say hi!

Weekly Developer Tools Update, Jan 12

kdangoor

Here are the highlights from the latest weekly meeting:

  • Firebug 1.9 has been released!
  • Read about Honza’s plans for Firebug 1.10 (note also that if you’re running Firefox Nightly, you should use Firebug 1.10)
  • The Command Line has been turned on in Nightly! Try it out, and let us know what you think (and what kinds of commands you want!)
  • This quarter (code named Pegasus):
    • Respond to input on the tools shipping in Firefox 10 and 11
    • Get debugger ready to be turned on in 14
    • pseudo-class lock
    • Specification for the timeline view
  • Paul, Rob and Stephen met in Toronto this week to discuss how the tools will glue together and scale to handle more tools. Feedback can go on an etherpad.

 

Weekly Developer Tools Update, Dec 15

kdangoor

1

The developer tools weekly meeting notes are in the usual place on the wiki. Here are some highlights:

Note that there will a meeting next week, but there will be no meeting on December 29th.

Weekly Developer Tools update, Dec 8

kdangoor

This week’s meeting was well-attended and interesting. We actually ran over our hour-long slot, which is unusual, but the meeting didn’t seem that long! A few notes from the meeting:

  • Firebug 1.9 beta 4 next week. Honza has been working tirelessly to track down some memory leaks.
  • Cedric has created a new prototype HTML panel
  • I’ve posted a draft 2012 roadmap and will post more about that here once it’s a bit less drafty.
  • We’ve had more new contributors and more developer tools people that now have level 3 commit access. Congrats to everyone landing new patches!

Join us at 10am Pacific on Thursdays each week to talk about developer tools.

Weekly Developer Tools Update, Dec 1

kdangoor

There was no update last week, due to the Thanksgiving holiday in the US. There was a meeting, but I wasn’t there… I was there for today’s meeting though, and the full minutes are up.

  • I didn’t see it in the last update, so I’ll mention it here. The Style Editor has landed in Nightly! Great work that Cedric Vivier has been doing over the past few months.
  • Robert Nyman wrote up a giant collection of Firefox tools for web developers.
  • I posted a screencast of the new tools in Firefox Aurora.
  • Firebug 1.9 beta 3 is coming tomorrow. Firebug 1.9 final is looking good for a year-end release.
  • We’ve fixed some issues in the Firefox Aurora tools, so keep an eye on your updates there.
  • Cedric Vivier will be working on adding features to the HTML panel. File bugs if you have requests for the HTML panel!
  • Heather Arthur is going to begin working on pseudo-class locking (making “:hover” stick to look at its styles, for example). Speak up if you’ve got opinions on how this should work.

Weekly Developer Tools Update, Nov 17

kdangoor

4

Both by popular demand, and by the fact that we now have a lot more to talk about, the weekly updates are back on this blog. As before, the full meeting notes are available on the wiki.

The highlights from this week:

We have a nice pipeline of features being worked on, and work is progressing on all of those fronts. Stay tuned!

Do you write right-to-left? Help us test the code editor!

kdangoor

1

In the current Firefox Aurora, we have a better text editor for writing code (JavaScript and CSS are two good examples). We have adapted the Eclipse Orion editor for use in Firefox. Unfortunately, in the process of bringing Orion in, we discovered what appears to be some deficiencies in how it handles non-English text.

There are always tradeoffs when it comes to software, right? This new code editor is much more pleasant to use for writing JavaScript in the Scratchpad. It also performs much better on files with many lines. Add to these the fact that code is not the same as natural languages and Scratchpad is specifically for editing code and that leaves us with a choice:

  • Do we turn on the editor now to get the benefits for writing JavaScript and just put up with the internationalization problems for the time being? Or,
  • Do we wait until we fix the editor before we turn it on for everyone by default?

Internationalization and accessibility are two things that are actually quite difficult to get right. A great deal of effort has already gone into the editors in the major browsers to get the behavior correct. Unfortunately, the features you want from a rich text editor are not the same as the ones you want from a code editor. The ideal case, and the one we’re ultimately shooting for, is better APIs from the browser that will help JavaScript programmers make whatever custom editor behavior they wish while still maintaining support for people using any of the world’s natural languages and people with accessibility needs.

How you can help

We’re looking for input specifically from people who use non-English words in their JavaScript or CSS files. The testing we’re doing right now is with the Scratchpad feature, which focuses on JavaScript.

If you have Firefox Nightly, just open up the Scratchpad from the “Web Developer” menu and you’ll see the new editor.

If you have Firefox Aurora, you’ll need to change a setting before you’ll see the new editor. Here’s how you do it:

  1. Go to about:config in the location bar (you may get a warning about this… it’s okay, we’re professionals ;)
  2. Filter on devtools.editor
  3. Right-click on devtools.editor.component and select “Modify” from the menu
  4. Set the value to orion
  5. Restart your browser

Now, open the Scratchpad from the “Web Developer” menu. You’ll know that you’ve got the new editor when you see line numbers in the gutter on the left side of the window.

Here are some hints to help us test:

  1. Type in JavaScript code as you normally would (comments and all)
  2. Use the normal cursor navigation controls that you generally do
  3. Try selecting blocks of text
  4. Copy and paste code into or out of the editor

If you haven’t tried Scratchpad before, you might want to check out the Introducing Scratchpad blog post to learn more about the feature.

Let us know what you think!

After you’ve given Scratchpad a try using the instructions above, please fill out a really quick, painless survey to let us know how it went.

Your answers to that survey will help us gauge the real world impact of this new feature.

How to reset your editor

If you found that the new editor was problematic for you, you can change the editor back to a textarea, even on Nightly. Here’s how:

  1. Go to about:config in the location bar (you may get a warning about this… it’s okay, we’re professionals ;)
  2. Filter on devtools.editor
  3. Right-click on devtools.editor.component and select “Modify” from the menu
  4. Set the value to textarea
  5. Restart your browser

Thanks!

Early testing and feedback from people like you makes Firefox better for everyone.

Introducing Scratchpad

kdangoor

38

The latest Firefox release includes a new tool for web developers: Scratchpad. The idea behind Scratchpad is simple: the browser is a fantastic place to experiment with JavaScript. Most JavaScript developers already know this and they use tools like the Web Console or Firebug’s command line to take advantage of the one environment that knows everything about their web page.

Tools like the Web Console are optimized for entering a single line of code. (ProTip: you can use shift-enter to put multiple lines of code into the Web Console.) Firebug has a button you can click to get into a multi-line input mode. Even with that multi-line input, the workflow is still centered around performing operations step-by-step and linearly.

Interaction with Scratchpad is quite different. It throws away the “one line of input gives you a line of output” interaction in favor of a text editor that knows how to run JavaScript.

Rob Campbell's Scratchpad+Canvas Demo

Using Scratchpad

To use Scratchpad, go to the “Web Developer” menu (hint for Mac users: look for the “Web Developer” menu under “Tools”). Select “Scratchpad” from that menu, and you’ll get a text editor window. The window starts out with a helpful hint about using Scratchpad.

The basic flow with Scratchpad could hardly be simpler:

  1. Enter some code
  2. Select a portion of the code
  3. Choose one of the three commands from the Execute or right-click context menu

The three ways to run code with Scratchpad are:

  • Run
  • Inspect
  • Display

They all have keyboard shortcuts, because you don’t want to have to reach for your mouse when you’re writing code.

Run just executes the selected code. This is what you’d use if you’re defining a function or running some code that manipulates your page.

Code in Scratchpad that creates an alert

JavaScript being run in the Scratchpad

Inspect executes the code as Run does, but it also opens up an object inspector on the value returned. For example, if you select window and choose Inspect, you will have an object inspector that lets you drill into the window object.

Finally, Display executes the selected code and puts the result right into your editor. This could be handy for using Scratchpad as a calculator. Or, more likely, it’s handy for keeping track of results while you’re testing something your page is supposed to do for you.

Interesting historical aside: Scratchpad was heavily inspired by the Workspaces feature of Smalltalk environments. Thirty years in, we’re still reinventing Smalltalk ;)

To really get a feel for Scratchpad, you need to see it in action. Fire it up yourself, or watch Rob Campbell’s video which steps through experimentation with Scratchpad.

Trying New Code with Scratchpad

Scratchpad is a great way to try out code in a live browser environment. For example, imagine you have a function called calculatePosition, and it’s just not working quite right. Load up your page, copy the function into Scratchpad and type out a couple lines of code that make use of calculatePosition. You very quickly get into a flow of tweaking the function and re-running the code.

Once you have the result you want, just copy the code back into your main file. This whole time, you didn’t have to reload the page even once.

Using Common Snippets

Scratchpad also has a way to save its contents or load a JavaScript file. Using this feature, you could save Scratchpads with collections of commonly used functions. For example, maybe you have a site that you work on that has various bits of data that get loaded via Ajax requests. Save a file with a handful of those calls and you can always get the data you want when you’re working on that app.

A Word about Scopes

When you run code in Scratchpad, it runs in a sandbox that has access to everything on your page, but keeps you from accidentally leaking variables onto your page. This is very similar to how the Web Console works. If you want to put a variable onto your page, just set it on window. window.foo=1 will give your page a variable foo that is accessible to scripts on the page.

Scratchpad, unlike Web Console, follows you around as you switch tabs. When you execute code, it runs against the current tab in your browser. This makes it easy to try the same code against your development and staging servers, for example.

Finally, if you’re doing development work on Firefox itself or on Firefox add-ons, you can set Scratchpad up so that it has access to all of the browser’s internals. Go to about:config and set the preference devtools.chrome.enabled to true. This will allow you to change the “Environment” from “Content” to “Browser”. Just don’t blame me if you enter some code that forces your browser to send cat pictures to Google+.

More to Come

Scratchpad is a simple tool, and we want it to stay that way. We’re planning a handful of improvements to Scratchpad that will show up in Firefox over the coming months, but the simple “text editor that runs JavaScript” core will remain.

We’d love your feedback on Scratchpad! Tell us on the dev-apps-firefox mailing list what you think. You can also get involved and make Scratchpad and other developer tools even better.

Kevin Dangoor, Developer Tools Product Manager