Announcing SproutCore 1.9!

written by admin

The SproutCore team is pleased to announce the release of SproutCore 1.9.0.  This release includes several new features, improvements and bug fixes and is a recommended upgrade for all SproutCore developers.

To install the latest version of SproutCore, visit http://sproutcore.com/install/.  If you are upgrading from a previous version of SproutCore, simply run:

gem update sproutcore

Highlights of Version 1.9.0

The following list includes the major changes and new features in 1.9.0:

  • Introduces SC.Color, a powerful color utility class that supports many color calculations and transformations and includes the following features:

    • Provides rgba feature detection.

    • Is able to parse rgb(a), hsl(a), hex and argb values to a normalized rgb space.

    • Is able to convert from the normalized rgb space to rgb(a), hsl(a), hex and argb notations.

    • Provides hue, saturation and luminosity properties to modify a color.

    • To see a demo of SC.Color in action, visit http://showcase.sproutcore.com/#demos/Using%20SC.Color.

  • Implements support for XMLHttpRequest Level 2 event listeners.  SproutCore’s SC.Request function has long provided cross-browser support for “Ajax” requests ensuring that callbacks properly fire regardless of the browser’s implementation of the XMLHttpRequest (XHR) standard.  Now that the XHR2 standard is supported in all the latest browsers, SproutCore has been expanded to include it, which allows SC.Request:notify() to be used with either a completion status code like normal or with a new event name, such as ‘progress’, ‘abort’ or even ‘upload.progress’.

  • Updates the media framework to remove several flaws and make it more useable.  This includes the addition of SC.mediaCapabilities for media feature detection and the decoupling of SC.MediaSlider from SC.AudioView and SC.VideoView.

  • Replaces the TestControls app with the new Showcase app that appears on the website.  The source for the app is included as a submodule within SproutCore and the app can be run locally at http://localhost:4020/sproutcore/showcase or viewed live at http://showcase.sproutcore.com.  The Showcase app is the result of a lengthy effort to visit each View in the Desktop framework and create working examples for the many different configuration options to serve as a reference to new developers.

  • Adds indeterminate support to SC.ProgressView.  SC.ProgressView can now have isIndeterminate set to YES to display a continuous progress bar styled to match the SproutCore theme.  The animation for the continuous bar uses CSS if possible, falling back to a backwards compatible and highly optimized JavaScript animation otherwise.  You can see an example of it here.

  • Adds vertical layout support to SC.SegmentedView.  SC.SegmentedView can now have its layoutDirection set to SC.LAYOUT_VERTICAL to display a vertically positioned set of segments/tabs styled in the default SproutCore theme.  You can see an example of it here.

  • Adds ‘interpretKeyEvents’ support to SC.TextFieldView allowing you to implement special handling of many common keys. For example, it is now easy to submit the value of a field or fields when the ‘Return’ key is pressed by implementing the insertNewline() method on the text field view. Other interpreted keys are: escape, delete, backspace, tab, left arrow, right arrow, up arrow, down arrow,  home, end, page up and page down.

  • Adds the window.requestAnimationFrame() polyfill by Erik Möller:  http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating.  The core function requestAnimationFrame() provides reliable 60fps JavaScript animations and is used originally by the SC.ProgressView indeterminate animation.  The polyfill ensures that the function can be called anywhere in the code, as is, without a browser specific prefix.

  • Improves SC.GridView so that it updates less frequently, can have a minWidth layout in order to scroll horizontally, doesn’t overlap items when rotated on a tablet and can work with sparse content, such as provided when working with an SC.SparseArray.

  • Adds a new property to SC.Record attributes of type SC.DateTime called ‘useUnixTime’.  If ‘useUnixTime’ is YES, then the record attribute transform will expect a Unix time value instead of the regular SC.DateTime ISO8601 format.  This makes it easier to work with APIs that provide Unix timestamps as times.

  • Improves internal support for nested records (i.e. isNested: YES).  The manner in which nested records are created and accessed has been refactored to prevent memory leaks that occurred as nested records were unloaded and reloaded.  This also removes the necessity of specifying primary keys on nested records in order to use them effectively.

  • Improves internal support for keys in SC.Record attributes.  Previously, the data hash backing the SC.Record in the store would incorrectly use the attribute names instead of the attribute key names, which meant that it was often unclear to the developer what property name would exist in the record’s data hash (ex. ‘myAttribute’, the name of the attribute, or ‘my_attribute’, the key name of the attribute).  Now the data hashes consistently contain the attribute key name if it exists.

  • Adds support for assigning default values in place of missing properties given to createRecord().  Now a call to SC.Store:createRecord() will check the defaultValue property of each attribute and actually assign the value to the data hash, which is what the majority of developers expect to happen.

  • Changes the orderBy syntax on SC.ArrayController to match that of SC.Query and MySQL, which is ’key ASC’ or ‘key DESC’.

  • Automatically parses out URL encoded parameters through the SC.routes params object.  For example, the location ‘videos/5?format=h264&size=small&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DG0k3kHtyoqc%26feature%3Dg-logo%26context%3DG21d2678FOAAAAAAABAA’ now properly has  a property “url: ‘http://www.youtube.com/watch?v=G0k3kHtyoqc&feature=g-logo&context=G21d2678FOAAAAAAABAA’“ in the params object.

  • Adds support for the page up, page down, end and home keys in SC.MenuPane menus, which allows the keys to be used to jump to the next or previous page of menu items or to the start or end of the menu items.

  • Makes SC.WebView iframes scrollable on iOS.

  • Makes SC.StaticContentView clear its previous content if its value is set to null.

Along with new features and improvements, 1.9.0 includes a large number of bug fixes.  Here is a list of the most important fixes:

  • Fixes drop support for SC.ListView and implements it in SC.GridView, so that these views can act as drop targets for a drag operation and be styled appropriately.

  • Fixes many problems with SC.View:animate() which fixes issues such as the method failing to trigger callbacks or triggering multiple callbacks with grouped animations.

  • Fixes a problem with SC.ButtonView on touch devices that resulted in portions or all of the button being untouchable.  This was related to the calculation of the touch boundary, which is meant to improve the touch experience, by allowing a bit more wiggle room for a touch to slide out and still be considered inside the button.  However, the calculation could become incorrect, resulting in strange behavior which appeared as though the button was un-touchable.

  • Updates and corrects the styling of many of SproutCore’s views and controls.  While creating the Showcase app, it was discovered that there were many minor problems and inconsistencies with SproutCore’s default theme.  Each of these issues has been corrected.

  • Fixes core problems with SC.Object.reopen() and SC.Object:mixin() that resulted in any computed properties, bindings and observers included in the reopen or mixin, not have been applied to previous instances of the class.

  • Fixes problems with memory leaks and un-cleaned up observers on SC.SegmentedView items.

  • Fixes SC.Record attribute’s defaultValue property.  This property failed to work when used with a key and also failed to work if the defaultValue was a function that expected the record instance to be given to it.

This release also includes many additions and corrections to the internal documentation, which has been rebuilt and posted at http://docs.sproutcore.com, and it includes all of the bug fixes from versions 1.8.1 and 1.8.2.   For the full list of changes, view the CHANGELOG.md in the framework.

Thanks to all the many contributors that work tirelessly improving SproutCore and offering support to those in the community.

Recap of Tyler Keating’s SproutCore Meetup Talk – Intro To SproutCore, Past, Present and Future.

written by timw@appnovation.com

Link to view recorded version of the meetup on Vimeo

Speaker: Tyler Keating – was working as a contractor at Strobe, which got bought by Facebook. He inherited the framework and is currently the Administer of SproutCore. Tyler holds the keys to all the SproutCore assets. Today, Tyler has taken on a leadership role with SproutCore as its Project Lead.

Background on libraries and frameworks: Currently, there are lots of JavaScript libraries and frameworks out there right now. A library can be considered a bunch of code that can be dropped in at any point in the development process and can work with what you have already. It can work with your processes and format structure. A good example of a library would be JQuery. Frameworks, on the other hand, expect a developer to follow its guidelines, process and file structure (structure of its code). Under this definition, SproutCore is definitely defined as a framework.

With a framework like SproutCore, a developer would want to be starting from scratch building a brand new application. SproutCore comes with directories and file structures and expects those who use it for development to put things in certain places, use its bindings, use its build tools, etc.

SproutCore on the “Spectrum” of JavaScript libraries and frameworks, on the far left, you would have a library like JQuery and on the far right, a framework like SproutCore. Very few JavaScript frameworks can be found on the far right, most them fall somewhere in the middle between being a library and a framework. Usually, these middle of the road type frameworks want to provide the M or C of MVC. Many of these frameworks found in the middle and most libraries out there do not have the tight integrations found in frameworks like SproutCore. They also just provide a bit and not a “full picture” so to speak. What you see are that libraries start to group together to more tightly integrate and slowly become more of a full picture.  This happens all the time, but with SproutCore that was the end goal from the start, so the integration is more advanced.

On another spectrum, a spectrum of web applications, on the far left you would have an application like Wikipedia which is basically a page of documents and links while on the far right you would have an application like iCloud, that has animations, very ambitious user experience, loads of data, multiple browsers, etc.  When developers want to design an application, provide localization in multiple languages, SproutCore has this directly built in as well as things like infinite scrolling lists. One could try coupling a bunch of libraries together, but this would become a very laborious effort from the standpoint that you would have to write a bunch of code to do it.

SproutCore: When thinking of using SproutCore to build an app you would want to be starting from scratch. The goal of the app that you are building with Sproutcore should be native-like performance and native-like feel. You want to be able to take advantage of the multiple pieces and build tools that SproutCore offers developers. With SproutCore you can:

  • Combine all your JavaScript

  • Compress your files in a single file

  • Use auto-spriting for images

  • Properly cache so the app can be installed one time and live for a really long time

  • Take advantage of localization that has been built directly in the framework

SproutCore provides:

  • build tools

  • auto spriting

  • file structure

  • localization strategy

  • highly integrated collection views

  • MVC components

  • statecharts

  • client-side data store that can be queried

SproutCore gives you a lot more pieces than other frameworks or libraries while at the same time tons more  in terms of performance.

Where SproutCore is going? Today the framework is a very full suite with lots of features, components and tools to use. There is no plan to “dumb down” the framework and try to compete with some of the newer frameworks on the market. SproutCore has been around longer with many engineering hours already spent building it out to be better and beyond what is coming out today. The Core Team of SproutCore wants to leverage what they have and continue to build on it. The Core Team wants developers to use SproutCore for building apps that are large scale, long lived and will continue to grow.  Another advantage that SproutCore has is that it has been thoroughly tested and carries lots of support across browsers.

Apple and others involvement:  Apple created SproutCore 1.0 and has been the largest contributor thus far. You can tell Apple spends many many hours on the code making it cross browser compatible, localizable.  I think iCloud is available in over 100 different languages. Apple helps make the framework very professional and has been a really great resource from a testing standpoint. Facebook, as far as anyone can tell, does not have any interest in SproutCore. Eloqua is also one of the major contributors to SproutCore, in particular the excellent client side data store components.

What has happened to SproutCore since the end of Strobe? SproutCore was completely worked on by Apple and its creator, Charles Jolley. Charles was very adamant that it be open source and have a community of support behind it. When SproutCore was under Apple, very few people who were contributing back to the framework. Charles then left Apple and created Strobe which spent a lot of energy building and marketing SproutCore. Strobe was unable to keep going and was eventually purchased by Facebook. As far as anyone can tell, Facebook is just interested in the people behind the framework, not SproutCore itself. So SproutCore was left untended for a couple months. I, who had been working as a contractor at Strobe, then spent the time to keep SproutCore going by collecting the assets, passwords, etc.  Appnovation also stepped in to provide community support. Today, engineering work continues and the framework continues to be built out. Currently in 1.8, with 1.9 out very soon and 2.0 already having some work done on it. With Strobe gone, the marketing and promotion side of things sputtered at which point companies like Appnovation have stepped up and filled that gap.

SproutCore 1.9:  1.9 is essentially just about done. In the past, SproutCore has had versioning problems, so it was hard to know when to upgrade an application built with it. SproutCore 1.9 is backwards compatible with new features releases with a number of bug fixes. It is not meant to introduce any new problems in existing apps. SproutCore 1.9 has a number of styling fixes to the ACE theme so that is works in a lot more scenarios properly, it also provides the introduction of SC.Color which is object for the manipulation of colors and adds XHR2 events.

SproutCore 2.0: The next major release will be SproutCore 2.0 which means its not going to be completely backwards compatible. Strobe’s 2.0 that was in the works is not related to SproutCore. The project got spun off and became EmberJS.  SproutCore 2.0 is going to move to node based build tools because right now the build tools are written in Ruby. This makes it harder for the Core Team to work on the build tools because they have to know Ruby. Additionally, anyone using SproutCore has to have Ruby installed to use the framework when building an application. Thus the move to Node is happening for several reasons most notably because the Node installers are better maintained and Node makes it easier for people to contribute back to the code since they are based in JavaScript as well. The release of SproutCore 2.0 is going to bring about the clean up of the numerous of sub-frameworks (libraries), because several were not maintained well. SproutCore 2.0 is also going to place a major focus on expanding the desktop framework because right now there are number of tablet and phone specific views to be added and we want to add more layout helpers. We are expecting to re-label the desktop framework a UI framework and raise it to higher level standard.  The Core team wants to make it easier and faster and with 2.0, people will be made more aware of all the features and tools that are out there on the 2.0 release through an emphasis on better documentation, guides and tutorials that will be made available online.

To summarize: SproutCore will continue to grow and get easier to use. We also expect it to have a lot less of a learning curve for developers wanting to create really fast and robust applications.

Link to view recorded version of the meetup on Vimeo

SproutCore Online Meet Up - August 14th

written by timw@appnovation.com

Hey SproutCore enthusiasts!

We’re moving our SproutCore meet ups online! It’s been a bit since the last Vancouver meet up and, in an effort to make these sessions more accessible to people, we’ve decided to host our next event strictly online. Our next meet up is scheduled for Tuesday, August 14th at 4pm PST. Our scheduled panelists for this session are Dave Porter and are Tyler Keating.

Dave will be presenting on “Tips and Tricks for Blazing-Fast List Views”, best practices for optimizing your collection views to create the smoothest possible experience in a variety of circumstances, and Tyler will be leading a discussion on SproutCore 1.9 and 2.0.

Register for the online event here

We’ve also repurposed the Vancouver SproutCore Meet Up page for these events, so to keep in the loop with upcoming online meet ups join the group page on Meetup.com.

There have also been new projects developed and launched using SproutCore like Kobo’s new Instant Reader app and the Wheelz mobile Admin Console. Check out all the latest projects using SproutCore here.

Hope you can make it to our session on August 14th!

Welcome to Dave Porter, SproutCore Committer

written by admin

It’s our pleasure to announce that Dave Porter will be the newest SproutCore Committer.  He has shown a strong interest in supporting SproutCore and its community and we look forward to working more closely with him in the future.

As a SproutCore Committer, Dave will have his own branches in the repo and have better access to SproutCore’s Reviewers and Project Owners to help drive SproutCore forward.

As has been mentioned in previous announcements, contributing to the project can be a thankless and demanding task, so please take a moment to catch Dave (dcporter) on #sproutcore and sproutcore@googlegroups.com and pass on your support.

As well, if you yourself are interested in the evolution of SproutCore, there’s really only one requirement;  contribute!

Introducing the SproutCore Showcase

written by admin

As you may have noticed above, there is a new section to the sproutcore.com website, Showcase.  This page is meant to act as your one-stop reference for all of SproutCore’s Views and Controls.

Previously, you would have had to install SproutCore and run it locally to view the Test Controls app and would have had to search the source code of that app to figure out how the Controls were configured.  Now you can visit http://showcase.sproutcore.com at any time and copy code snippets directly from within the page.  Even better, we’ve expanded the examples significantly to include all of the available Views and Controls with many more configuration examples.

On a technical note, the Showcase page is actually a SproutCore app itself deployed on Github pages.  The app is open-source and you can browse its source and contribute to it on Github.

In the coming weeks, we will work to consolidate the various SproutCore demos and deploy them on this page as well, ensuring easy access to up-to-date demos.