Join Us for the First San Francisco SproutCore Meetup!

written by admin

You’ve all been asking for it, and it’s time to deliver! It’s been a nice long while since our last few meetups (embarrassingly long, even—don’t look it up…), so you definitely want to join us for this one, as we get things kicked off again.

We’ll be meeting on Tuesday, November 23rd, 6:30 p.m. in downtown San Francisco (SOMA, to be specific) for our first proper SF Meetup. Get to know SproutCore creator (and the evening’s MC) Charles Jolley, along with members of the SproutCore Core Team—Evin Grano, Yehuda Katz, Peter Wagenet and more—as they walk us through some of the latest and greatest developments in SproutCore. We’d also love to hear about how _you’ve _been using SproutCore, so come prepared for lightning talks!

Our friends at Strobe will be sponsoring with pizza and drinks, and Engine Yard will be hosting. The space is great, but is limited, so be sure to RSVP via Meetup. See you there!

How do you really build large impressive web applications?

written by egrano

There have been enormous leaps in browser technology and computers that have made rich internet apps and cloud applications no longer a figment of someone’s utopian dream, but a reality that can be acted on today. I want to take you on a journey how my company, Eloqua, did just that, take an utopian dream of the best web application and made it a reality, with SproutCore.

How do you decide what technology to use?

Well, the journey started about a couple of years ago, even before I came to Eloqua. Eloqua was the market leader and really the inventor of the marketing automation space. This space is where the marketing teams and the sales team work to get the right information to the right people at the right time. In order to grow your business, timing is crucial. Eloqua had built an application from the ground up over the last 10 years. It had all the successes and failures that come with inventing a space. Now that they succeeded in inventing the space, it was time to start the revolution all over again. Eloqua now needed to change the game because the space was starting to get crowded and we all know that unless you are innovating and catching the next wave, soon the market leader can become yesterday’s technology footnote in Wikipedia. This is when Mike Ball and I came onto the project and it was called Eloqua 10

We were looking for the next greatest thing in web technology and we started to see this resurgence in an age old idea: returning to fat clients with business logic and thin servers, but all with a new significant twist. These apps were done with more native code for the browser like JavaScript and plugins and made the web more like native desktop applications. So which technologies are we to use to to do this? How do you make a great user experience across the web? Well, first you need to see if people have done it before. So we started to look around the internet for web applications that do what we wanted to do. We found a couple of examples of really cool applications that are pushing the envelope of what is possible. Applications like:

So these applications represent technologies like the following: Cappuccino, Flash/Flex, SproutCore, jQuery, ExtJS and others. But, what if you want to make a more sophisticated application than these? What if you want to push the envelope further? You have to choose the right technology and make it do a little more than what you have seen before. That is how you become a thought leader and that is how you innovate and stay on top of your game as a technology company. So how do these technologies stack up?

We worked and studied every one. We made sample applications with each when available and through this trial effort and working with people we came out with a clear winner…

…SproutCore

SproutCore was a new technology, but was moving in the right direction and at the right time. We had a list of features that were required by the framework that we were to use:

  • Required! Must have a quick load time.
    • Answer: Only SproutCore has bundling to get load times down.
    • Answer: SproutCore makes is easy to do things like deferred evaluation.
  • Required! We had a legacy system so we needed a good solution for gathering data from an established system.
    • Answer: Only SproutCore had a fully unified data store architecture.
    • Answer: SproutCore was backend-agnostic so we were able to connect seamlessly with a legacy backend and develop in parallel.
  • **Required! **We had a need for fast and snappy application for getting large amounts of data.
    • Answer: Only SproutCore has things like SparseArrays to speed up data delivery
  • Required! We were going to try some new and innovative things that we haven’t seen before so we needed a platform that could easily adapt.
    • Answer: SproutCore has a great extensible architecture and since it is only JavaScript we can do what we needed to do when we needed to do it

Clearly, Only SproutCore provided the basis for innovation that we were looking for. We looked at the principles that it was based on, inspiration from Cocoa, but not limited to that framework. SproutCore used the limitations of the web in resources and used to its advantage to make an awesome desktop-like experience. And better yet it was free and open! We, as an engineering team, decided that we were going to be an open company with our technology. We needed to find a project that supported those ideals. We also needed a project that was backed by at least one respected company, was stable, and looked like it had the brightest future. Again, the only clear winner was SproutCore.

Now that we have chosen to use SproutCore we needed to see how far we could push it. So we wanted to innovate and release it to the SproutCore Community. Here is a small list of features that came directly out of our work with Eloqua that we have open sourced:

  • SCUI: One of the first official third party libraries that provides the following features:
  • LinkIt: directed and non-directed graphing library that came from our work in Campaign Canvas work flow in Eloqua 10
  • Dashboards: a OSX/Windows 7 dashboard like framework
  • Foundations: Lots of the missing UI elements that we wanted to release like Calendars, Datepickers, mixins and other views that are helpful
  • SCUDS: Local data storage with cascading data sources
  • Lebowski: Our testing framework for Sproutcore-specific applications
  • Greenhouse: the free SproutCore IDE that comes directly from our with with our work in the Email and Landing Page Editor. Only possible with the power of SproutCore’s design framework
  • Sai: The VML/SVG vector graphing library
  • Ki: Statecharts for the Faint of Heart for building really world class level applications
  • Tasks: This is the project management tool that we use internally to deliver our project on time

So we have accomplished something remarkable in Eloqua10. If you would like to see and here more about this application you can check it out at:

So the question still is: How do you really build large impressive web applications? You choose SproutCore. The market has just taken notice. In fact, tech analyst commented that this could be one of the greatest reinventions of a SaaS company in history. We could have only done this with SproutCore and the great community behind it. I am proud to call myself a Core Team member and I am really proud of all the work that my team at Eloqua has done.

They always say, “Fortune favors the bold” and when choosing technology for a large project like ours you have to find a technology that is shooting for a spot in the future. We are looking to keep pushing Eloqua and SproutCore to new and greater heights.

SproutCore 1.4.3

written by admin

SproutCore 1.4.3, a bug fix release, is out now! Just gem install sproutcore to get the update. For more information see the Changelog.

Giving Back to jQuery

written by ykatz

For the first several years of SproutCore’s life, we shipped a fast, minimal jQuery clone that powered our view layer. As of SproutCore 1.4, we integrated jQuery proper into SproutCore’s view layer. I thought it might be worth taking a few minutes to explain why we made this change and what it means for our project.

Why?

In the past, we tried to stay relatively DOM library agnostic.  You could use Prototype, jQuery, MooTools, or whatever else you wanted.  SproutCore would do its best not to depend on any of these so you didn’t have to pay the cost of loading a library you didn’t own.

Since we made that decision, things have changed somewhat on the web.  jQuery adoption, in particular, has skyrocketed.  Not that these other libraries aren’t used, but today it’s common to find most sites using jQuery alongside them for one or two things.

In short, we believe jQuery has become a nearly standard library of the web. In many ways, it is no longer just about one project but really belongs to the web as a whole.

Because of its degree of use on the web, it is by far the best way to work with the APIs exposed by the web browser. And while it was once somewhat sluggish compared with hand-rolled code, jQuery is now usually faster than the code you wrote yourself. The jQuery team has spent years building features with and an expert-level understanding of the browser environment and API.

Here’s one example: did you know that when you use $("<div id='test'></div>"), jQuery caches a document fragment that it reuses every time you use the same String value? (Did you know there was such a thing as a document fragment?). To avoid memory bloat, jQuery applies heuristics to the String based on real-world usage. The widespread use of jQuery and the team’s focus on real use cases has afforded the library a careful balance between all of the factors that go into using the browser efficiently.

Having spent almost half a decade pushing the limits of the browser, we’re familiar with a lot of these tradeoffs. In many cases, jQuery 1.4.3 will be faster and more efficient than our code. In some cases, because of the ways that SproutCore has been used, our techniques are more efficient. Starting with SproutCore 1.4, we’re going to be contributing time and resources to jQuery, which is crucial to our own success.

SproutCore for the Rest of Us

While we are integrating jQuery further into SproutCore, we thought we might take this opportunity to make SproutCore more accessible to regular jQuery developers as well.

SproutCore has always been built as a modular framework. We’ve always wanted people to be able to use SproutCore’s runtime library and data store as standalone JavaScript libraries. Unfortunately, we didn’t put in the effort to ship them as separate libraries. 

In the weeks ahead, I’ll put in the bit of work necessary to make them releasable as standalone libraries. While I’m at it, I’ll reduce duplication with jQuery’s own utilities, which should make the SproutCore Runtime and SproutCore DataStore libraries fit in nicely in the jQuery ecosystem.

The goal is to make it easy to use the parts of the SproutCore libraries that you want without having to jump head-first into the full SproutCore experience. SproutCore’s binding system, batched DOM changes, and data store are battle-tested libraries that can significantly improve the structure of your applications.

I also plan to create jQuery plugins for these components so that you can use the SproutCore binding system as a normal jQuery method. The SproutCore team has spent some time on extending jQuery to allow DOM manipulations to be batched up and persisted all at once, and I’m working with John to make it easier for us to release a well-behaved jQuery plugin that won’t break as new versions of jQuery are released.

If you’re interested, it will probably work something like:

  var $ = batchedjQuery;
  $("#item")
    .addClass("active")
    .addClass("selected")
    .css("color", "blue")
    .flush();

This becomes increasingly useful when paired with the SproutCore run loop, which allows you to make these changes in various functions, and trigger the batch manipulation at an appropriate time. This technique is baked into the way SproutCore works, and it’s partially responsible for the performance of large SproutCore applications like MobileMe. Why shouldn’t you be able to get the same benefits in traditional jQuery applications?

And when you’re ready to jump in and do a fast, native-style application, the full SproutCore framework will be ready for you.

This won’t change the direction of the SproutCore framework itself or its API. It will simply make SproutCore’s tools more accessible to a wider audience of jQuery developers who are not yet ready to jump on the SproutCore train.

Closing

Like I said, jQuery belongs to the web. Contributing to the health and success of the jQuery library helps all web developers by giving us a shared place to work on innovative ways to use the tools that the web browsers give us. As browsers continue to improve those tools, the web community increasingly needs a place to share the work to make new features accessible, and there’s no better place than jQuery.

Post by Yehuda Katz