MacBreak the SproutCore Edition

MacBreak weekly presented a in-depth analysis of SproutCore and what it means to the internet community.

http://thisweekintech.com/mbw94

Many of the conclusions are very insightful and right on and the rest make for a terrific story.

SproutCore TextMate Bundle

I just published the very beginnings of a new TextMate bundle for SproutCore written by our very own Joshua Dickens.  Way to go Josh!

Right now the bundle has only a few helper commands but its open source, so add more and we’ll take em.  I’d LOVE to see some inline help hookups here. :-)

Here is what you get right now:

  1. .ob [tab] => [currentText]Observer: function() { }.observes(’currentText’,’
  2. .prop [tab] =>  text: function () { }.property(’text’,'optional2′),
  3. super [tab] => arguments.callee.base.apply(this, arguments)

The last one is particularly helpful since SproutCore implements calling your superclass in the way you can in other languages.  The only catch is you have to use this long, magical incantation above  (arguments.callee.base.apply(this, arguments)).  If you don’t like to remember that, just install the tmbundle, type super[tab], and TextMate will remember for you.

How to Install

Just do the following on the command line in your terminal:

cd ~/Library/Application\ Support/TextMate/Bundles
curl http://github.com/sproutit/sproutcore-tmbundle/tarball/master -o sproutcore-tmbundle.tar
tar -x sproutcore-tmbundle.tar
mv sproutcore-tmbundle SproutCore.tmbundle
rm sproutcore-tmbundle.tar

If you are on Git, there is an even better way.  Do this from your terminal:
w
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/sproutit/sproutcore-tmbundle.git SproutCore.tmbundle

Now, when you want to update the bundle to get new features, just do:

cd ~/Library/Application\ Support/TextMate/Bundles/SproutCore.tmbundle
git pull

After you install the bundle (using either method), you will need to restart TextMate…

UPDATE:  August suggests that you can also just choose Bundles -> Bundle Editor -> Reload Bundles so you don’t need to restart TextMate.

 

SproutCore 0.9.10 - Community Release

Since SproutCore receives some attention earlier this week, the community has already really kicked in some great contributions.  I hadn’t planned to roll another release of SproutCore until 1.0, but we received some really excellent patches and I just had to push them out.  So, tonight I pushed SproutCore 0.9.10 to Ruby Gems.  The highlights of this release are:

 

  • Experimental Windows support. Thanks to some fixes posted by typo_pl, the sproutcore build tools reportedly run on Windows now!
  • Rails 2.1 Compatibility.  Rails and Rubigen had a bug in them that caused Rails script/generate to break if the sproutcore gem was installed.  This should never happen, but oh well.  Thanks to some great detective work by Erich Ocean and a number of you on the mailing list, we determined what was causing this problem and found a way to work around it.  SproutCore-0.9.10 no longer breaks your rails.
  • Relative Paths.  By default the sproutcore build tools would generate absolute URL paths for all resources.  This is less likely to break as long as you can control your entire server URL.  But sometimes you can’t do that and you need relative paths so your built applications can be installed anywhere.  Now this is possible thanks to a patch submitted by August Joki.  Just replace your c[:resources_at] config with c[:resources_relative] = true in sc-config.rb and off you go.
  • Lots lots more.  Many bug fixes and minor API improvements in the JavaScript framework itself and other typos reported by many of you over the last few days.  The complete list is below.

To install this release, just open your terminal and type:

sudo gem update sproutcore

Thanks everyone who helped to participate in this release.  If you have been blocked; unable to work with SproutCore because of the Rails or Windows issues above, please give it a try again and let us know how it goes.

-The Happy SproutCore Team

Build Tools Release Notes

* The build tools can now generate bundles with relative paths. Fixes #19

* Fixed minor typos in the generated template files closed #17

* Renamed generators to sc_generators.  This avoids a conflict with Rails 2.1.

* [FIX] Applied bug fixes suggested by typo_pl to make the build tool run on windows.

* [FIX] Changed default language mapping for Japanese from jp to ja.

SproutCore Framework Release Notes

 
- SC.Platform.Firefox now returns 2 for any gecko browser that is not Firefox.

- Fixed typo in ().  Fixes #12

- Fixed #11

- Switch from transitional to strict DTD

- Replacement of window.location to window.location.href.

- Added default src to image_view (static_url(’blank’))

- Fix  for view_helper view that was closing the element.

- sproutcore now treats space as a printable key instead of a function key.

- Added chainability to observer methods.  set(), beginPropertyChanges(), endPropertyChanges() and a whole slew of other methods now return this instead of void or the set value.  This allows method chainings jQuery style such as:    

    contact.beginPropertyChanges()
      .set('firstName', 'Charles')
      .set('lastName', 'Jolley')
    .endPropertyChanges();

- auto select content of textarea when it’s focused: this._isFocused is true for textarea while false for text input in didBecomeFirstRespo

- scrollable#scrollViewToVisible now scrolls up and left.  This corrects a bug with keyboard control that would bust when you move up or left.

- Updated documentation on form

- Use Element instead of element for IE compatability in Element.setClassName()

- Added SC.View#destroy() to remove views from internal caches. insertBefore, removeChild, etc. also now return the view instance so you can chain them.

- Popup menu was setting the width on each of the child menu items in addition to itself. This had a huge performance impact with little ac

- Disabled the current behavior for the menu item view helper which parses the shortcut before inserting it; now it simply passes the passe

- [FIX] Replaced url() calls with static_url() in CSS so that they will work properly in build mode

- Cleanup in drag.js

- Adding href property to ButtonView for bindable functionality on href attributes.

- Properly order drop targets so that nested targets appear first.