CHANGE LOG

Edge

NEW FEATURES

CHANGES & IMPROVEMENTS

DEPRECATIONS & REMOVALS

BUG FIXES

1.11.0

NEW FEATURES

General

CHANGES & IMPROVEMENTS

SC.Gesturable & SC.Gesture (SC.TapGesture, SC.PinchGesture, SC.SwipeGesture)

After some investigation, it was found that there were a number of issues with the built-in gesture support. For example, two touch taps would throw an exception, pinches would fail to register and in particular, supporting multiple gestures failed in a number of scenarios. In order to fix these problems, the gesture code has been rewritten from the top-down.

It is now possible to mixin SC.Gesturable to a view and use events to react to multiple gestures concurrently. Examples of the advanced type of behavior that the gesture code allows include:

How does this affect your code?

For the most part, this should have no effect on existing implementors of SC.Gesturable. The three built-in gestures: SC.TapGesture, SC.PinchGesture, and SC.SwipeGesture are still defined and they work much better than before. However if you have defined a custom SC.Gesture subclass, it will unfortunately not work correctly with this update. Because we felt the previous version of SC.Gesture's API was too complex and incompatible with the behavior we needed to achieve, we decided it was better to rewrite it in a simpler form. We're very sorry for this backwards incompatibility, but because of the previous issues with gestures, we believe no one was able to use them anyway.

Legacy Framework

There is now a sub-framework within SproutCore, :'sproutcore/legacy', which is meant to contain all code providing support for older browsers. This includes the existing polyfill for window.requestAnimationFrame and a brand new polyfill for Object.keys. The legacy framework is included by default by requiring :sproutcore in a project's or an app's Buildfile. The legacy framework itself requires the :sproutcore/desktop framework, which allows for any legacy code in the SproutCore controls to be separated out.

Therefore, to build an app that will only work with the newest browsers (probably not a great idea —), you may change your Buildfile requirements to include only the specific SproutCore sub-frameworks you need. For example,

config :my_app, :required => [:"sproutcore/desktop", :"sproutcore/datastore"]

DEPRECATIONS & REMOVALS

Note: This deprecation will show a console warning in debug (i.e. non-production) mode.

BUG FIXES

1.11.0.rc3

NEW FEATURES

SC.NestedStore

SC.NestedStore has a new property, conflictedStoreKeys, which is an array of all store keys that currently have conflicts with the nested store's parent. A conflict in a nested store can occur when the data in the parent store changes after the nested store has accessed and modified it.

For instance, in a multi-user system where records can be edited by multiple people at the same time, the client may use polling or websockets to update the records in the main store asynchronously in the background. With such a scenario it would be possible for the current user to be editing a record that someone else has changed in the meantime. If the client attempted to commit the changes from the nested store it would get an exception because of the conflict. Instead, the developer can now check the value of conflictedStoreKeys and if it is null, then commit the changes and if it is an array of store keys, then they know which records have conflicts and can deal with them directly.

SC.Binding

There are two new binding transforms, string and integer, that ensure the value is always a String or an integer Number. Examples include returning an empty String for null or undefined values when using the string transform and returning a 0 for these same values when using the integer transform. Furthermore, if the integer transform is given a String, it will be parsed to an integer Number according to the extra argument radix (which is 10 by default).

There is also a new binding transform, mix, that allows for the aggregation of multiple bound properties into a single property through a given function. It is often the case that a single property depends on two or more bound properties in a complex manner that isn't handled by the current and and or transforms. To handle this situation previously, the developer would need to write the code to bind in the external property values and then make a local computed property dependent on each of these. The mix transform does exactly the same thing, but with less typing on the developer's part.

For example, to create a mix binding that concatenates two external properties in a non-trivial way, we can now do the following,

currentGroupUserLabel: SC.LabelView.extend({

  // Ex. Returns one of "", "Selected Group", or "Selected Group: Selected User"
  valueBinding: SC.Binding.mix(
    'MyApp.groupController.name', // The group name (may be null).
    'MyApp.userController.fullName', // The user full name (may be null).

    // Aggregate function. The arguments match the bound property values above.
    function (groupName, userFullName) {
      if (SC.none(userFullName)) {
        if (SC.none(groupName)) {
          return ''; // No group and no user. Ex. ""
        } else {
          return groupName; // Just a group. Ex. "Selected Group"
        }
      } else {
        return '%@: %@'.fmt(groupName, userFullName); // Group and user. Ex. "Selected Group: Selected User"
      }
    })

})

General

CHANGES & IMPROVEMENTS

Documentation

SC.PickerPane

This view has been given special behavior when used with SC.View's transitionIn plugin support. If the plugin defines layoutProperties of either scale or rotate, then the picker will adjust its transform origin X & Y position to appear to scale or rotate out of the anchor. The result is a very nice effect that picker panes appear to pop out of their anchors.
To see it in effect, simply set the transitionIn property of the pane to one of SC.View.SCALE_IN or SC.View.POP_IN.

SC.SegmentedView

This view was refactored slightly to remove the special overflow view if shouldHandleOverflow is false (default). Previously the overflow view was always created and appended even if it was not to be used.

General

Test Results:

With min-height (i.e. can't accelerate):       With height (and accelerated):

  JS Function:       ~5.9ms                      JS Function:       ~5.9ms
  Recalc. Style:     ~0.3ms                      Recalc. Style:     ~0.3ms
  Layout:            ~0.3ms                      Update Layer Tree: ~0.2ms
  Update Layer Tree: ~0.2ms                      Composite Layers:  ~0.3ms
  Paint:             ~2.4ms
  Composite Layers:  ~0.3ms
  Update Layer Tree: ~0.1ms
  Paint x 8:         ~6.0ms

How does this affect your code?

Because lists and grids have an implied layout of { top: 0, bottom: 0, left: 0, right: 0 }, they used to always stretch to fill their parent containing view. This is no longer the case and so a collection with too few items to fill the containing view will only be as tall or as wide as its items warrant. This will affect any background styles that were applied to the collection (such as the Ace theme did), which previously would have covered the whole containing view's background. Unfortunately, those background styles need to be moved to the style of the containing view in order to prevent any styling regressions after updating to this new version.

Therefore, to go along with this change the background: white style in the Ace theme that was applied to $theme.collection has been moved to $theme.sc-scroll-view. It has also been changed to background-color: white, which is less likely to conflict with other background styles.

How do I check for style regressions?
To ensure that any background styles applied to your collections still look correct, you should do a search through your stylesheets for .collection and move any custom background styles over to an .sc-scroll-view class.

For example,

isEnabledBinding: SC.Binding.and('.hasValue', '.valueIsValid', '.userIsAllowed')

DEPRECATIONS & REMOVALS

Note: This deprecation will show a console warning in debug (i.e. non-production) mode.

BUG FIXES

1.11.0.rc2

CHANGES & IMPROVEMENTS

Along with this change, the actionContext property has also now been deprecated and will be removed in a future version of SproutCore.

Note: this is a backwards-compatible change. If a String is passed to fireAction and no action property exists, the argument will be used as the action (i.e. no context will be sent). When this occurs, a Developer Warning will appear in the console. Likewise, a Developer Warning will appear if actionContext is set prior to a view being initialized. * SC.ButtonView and SC.CollectionView have both been altered slightly to use SC.ActionSupport. This has no affect on the use of action & target in these views. * Moved tracing code of SC.ResponderContext and SC.Module to debug-only. This prevents the debugging code from being included in production builds, thus reducing the overall deployed file size slightly. * Optimized use of the arguments object in several locations in order to avoid its instantiation. There were several occurrences of code copying the arguments object into an Array using slice; this is very costly for performance as it causes the browser to instantiate the arguments object in order to do the slice. Instead, these occurrences were converted to either access the arguments by index without a copy or to do a fast copy without instantiation. See jsperf.com/closure-with-arguments for an example of the performance difference this can make. Using slice is anywhere from ~50% to ~90% slower depending on the browser.

Affected: SC.Request, SC.WebSocket, SC.DelegateSupport, SC.Color, SC.Event, SC.Store, SC.Module, SC.Object, SC.Function, SC.State, SC.Statechart * Named two anonymous functions: send_event & handle_event in order to aid in debugging and profiling of the core framework.

BUG FIXES

1.11.0.rc1

NEW FEATURES

CHANGES & IMPROVEMENTS

As well, these three areas all accessed the arguments object to copy it, which requires the browser to instantiate it, which is costly. Instead, we now do a fast copy (similar to this: jsperf.com/closure-with-arguments) without instantiating the arguments object.

Finally, by doing a fast copy of arguments these functions are now optimizable by V8, whereas they weren't previously.

Benchmark: SC.mixin & SC.supplement ~ 58% faster * Calls adjustLayout on initialization of SC.CollectionView.

Certain containing views, transitions and specialized layout engines need to know what type of layout their child views will have in order to make the proper adjustments. SC.CollectionView subclasses typically set a width or a height themselves, but when this happens late, the actual layout style of the collection is misunderstood at initialization to be something different. * Improved the management of the content view for SC.ContainerView. * Improved the default styling of overlay scroller views. Making them look more like natural overlay scrollers in OS X/iOS and making them visible on dark backgrounds. * Prevents mousewheel events from jumping the slider while the mouse is pressed (i.e. for dragging). Certain mice have a very jittery wheel event (i.e. the Apple Magic Mouse) that results in wheel events firing while the user is trying to drag a slider. * Un-deprecated rotate as a layout property (which is equal to rotateZ). * Improved SC.State performance by removing expensive observers.

SC.State had two observes helper functions used to be notified when its enteredSubstates and currentSubstates arrays change. Since these arrays are modified by the owner statechart, the observers needed to be chained enumerable observers. However, this resulted in slower object initialization for each state object and excess observer firing as the entered and current substates change. Instead, we simply notify the target state directly each time that the statechart makes a change to its enteredSubstates and currentSubstates. * Improved SC.ScrollView performance a tiny bit by removing the unnecessary chained binding back from the scrollers to their owner. Scrollers are created automatically by the SC.ScrollView and are not moved between different owners. * Added documentation and constants will make SC.PickerPane positioning and customization much easier. * Significantly improved performance of SC.PickerPanes attached to element's within an SC.ScrollView.

There were a couple of issues hampering performance for SC.PickerPanes within SC.ScrollViews. The first was that the scroll view observers were too greedy observing (the unfortunately noisy) horizontalScrollOffset and verticalScrollOffset of the scroll view for changes and repositioning on each change. What this meant was that an SC.PickerPane could reposition itself up to 6 times in a single run loop as the content of the scroll view changed even thought the scroll offsets may not have changed at all. Instead, the proper pattern for observing multiple properties (or noisy properties) is to filter the input through an invokeX (i.e. so even though 6 calls to the observer function occur, we only call positionPane once, via invokeOnce). Additionally, we no longer observe the offsets if the scroll view can't even scroll (in either direction). And finally, to ensure that the anchor element is in its new position before we re-position, we actually use invokeNext as our input filter. * Fixed several inconsistencies in property referencing within SC.PickerPane. There were multiple places where '.' notation was used instead of get/set. Also tidies up some unclear code. * Removed the enabling of run loop logging when SC.LOG_BINDINGS is set. The run loop logs are very noisy and make it harder to follow the binding changes. Also forced some of the logging code into debug builds only. * Cancels active transitions of SC.ContainerView when transitionSwap is altered mid-transition. This includes a developer warning. * Renamed all rowHeight properties to rowSize for SC.CollectionRowDelegate. * Added retina version images for SC.SliderView in Ace. * Removed several lines of debugging code from production builds of SC.Observable using @if(debug). * Updates to jQuery 1.11.1. Notably, there was a serious memory leak in jQuery 1.8 where the tokenCache grew continuously (because keys in the cache have a “ ” appended to them and the code tried to delete keys without taking the “ ” into account). * Updates SC.SceneView to support the new SC.ContainerView hardware-accelerable transitions. * SC.Color#cssText is now read/write, allowing you to bind it to a user-enterable text field. SC.Color now implements SC.Error and enters an error state when given bad input. * Fixed memory leaks in SC.ListView and SC.CollectionView. Since these views add observers to their related objects, they need to also properly remove those observers again when the views themselves are destroyed. Otherwise, when collection views are removed, the observers on the related objects become stranded. * SC.Query's internal token tree is now a proper SC.Error when in an error state. * Removed all uses of enhance within the SC.View reopens in core_foundation. The _enhance function is inordinately slow in Firefox (version 31 on OS X). Benchmarks of creating 100 views in a loop takes ~1800ms with the enhance's and only ~38ms without any in Firefox on OS X. In Chrome and Safari on OS X, the difference is negligible. * Removed an excess display property (i.e. an observer) in all instances using SC.ContentDisplay, since content is already observed for changes and displayDidChange is called within that function. * Updated SC.RenderContext to use the value property of the DOM Attribute, as nodeValue is deprecated. * Refactored commandCodes function of SC.Event to be easier to read and with more descriptive inline documentation. * Use 24-hour clock notation for French times. * Now allows duplicate items to appear in a collection and still be selected independently. Previously, all collection view selection was done per object, which would mean the first instance of the object in the content was always selected. Instead, selection is done by index only so that the same object can appear many times and each be selected separately. * Replaced a couple of latent style.webkitTransform calls with experimentalStyleNameFor, which is forward compatible and cross-platform compatible. * Reimplemented itemValueKey support in SC.MenuPane. * Improved the performance and code structure of SC.TreeItemObserver and SC.TreeController by optimizing overactive observers and object creation. Improved delegate and item handling, and documentation. * Added ie10 class to body element when detected (legacy). * Added standard touch support to SC.PopupButtonView. * Added a visual cue to menu items with submenus. * Added a Developer Error when attempting to add records without IDs to relationships. * Zero-duration calls to animate will now adjust-and-callback on the next run loop, like any other animation. * Improves SC.TextFieldView key handling. * Controls will now use isEnabledInPane (which calculates based on a number of things) instead of isEnabled to determine whether they're enabled. * Padding and margin will no longer be added to stacked child views when none are visible. * Improves support and handling for canceling view transitions. * View states now include an ATTACHED_SHOWN_ANIMATING to allow first-class animation handling. * Dragging a file into a SproutCore application window will no longer cause the browser to leave the application and open the file. * View transitions can now specify what layout properties they impact, allowing for better behavior when adjusting a non-transitioning property during the transition. * Nested records should now behave much better in many situations. * DateTime localizations are now available in French. * Fixes up some bad overrides of interpretKeyEvents. Make sure to use, rather than override, this method in your own code. * SC.TextFieldView now supports selection direction when the browser allows. * Many webkit-specific properties under the hood – for example, transform CSS – have been replaced with correctly browser-detected versions. * SC.View.VERTICAL_STACK and SC.View.HORIZONTAL_STACK child layout plugins now support the use of minHeight and minWidth. * CoreTest, our QUnit like testing suite, now includes a “warn” method to explicitly create a warning. * SC.MenuPane will ignore the first item if it is a separator. * A number of improvements and backwards-compatibility fixes have been made to the SC.SelectView replacement class found in the experimental frameworks. * You can now customize your SC.AlertPane's buttons' isDefault, isCancel, tooltips, layerId and localize properties. * Adds developer warning when calling SC.PickerPane.prototype.append. A developer should always use SC.PickerPane.prototype.popup to display a picker pane. * Adds a layout orientation class to SC.SplitDividerView. * Adds SC.String#escapeCssIdForSelector method to handle '.' and ':' characters, which are valid in CSS IDs but which must be escaped for use in jQuery selectors. * In development mode, SC.ChildArray (nested toMany attribute) now has a helpfully verbose toString method. * runtime framework no longer requires jQuery. jQuery requirement moved to core_foundation. * SC.ImageView#value bindings now default to oneWay. * SC.TabView can now display local views analogously to SC.ContainerView. * Subclasses can now override bindings without issue. * SC.AutoResize can now be reliably used to resize height only. * SC.IndexSet is now a bigger stickler about valid arguments, especially checking for NaN. * SC.SelectView now allows a null itemTitleKey. itemTitleKey and itemValueKey are now null by default. * arrayContentDidChange now calls enumerableContentDidChange. You no longer need to call both. * Right-clicking on controls will no longer trigger them. * Fixes a bug where SC setters weren't being used on child view parentView, owner and page properties, causing some calculated properties to not be correctly invalidated. * Fixes a layout bug when adding new child views to a view with SC.FlowedLayout. * Transforms were being hard-coded to include their experimental browser prefixes. These now use SC.browser.experimentalFooNameFor to correctly detect when browser prefixes aren't needed (or supported). * A great deal of dev-mode-only validation of layout properties has been added. * Separates SC.View#isFixedSize property into isFixedWidth and isFixedHeight, allowing for an even finer-grained optimization of child view resize notifications. * Adds a Developer Error when setting up a nested record attribute with an inverse property (via toOne or toMany). * SC.TextFieldView's maxLength property can now be updated live. * SC.ContainerView can now take local property paths (e.g. '.localPage.view') as nowShowing. * Binding helper methods SC.Binding.and and SC.Binding.or are now fully operational, including supporting local properties. * In the test runner app, adds links to individual test URLs for easier access.

DEPRECATIONS & REMOVALS

BUG FIXES

The previous polymorphic record support took care to ensure that the same store key was returned for all polymorphic classes by duplicating the store key to id mapping on each related polymorphic class. But where it failed was in situations where the store manipulated the store keys hashes directly (ex. replaceIdFor()), which would result in different store key to id mappings between polymorphic classes. Also, duplicating the mapping on each class was very wasteful and slow due to recursion. Instead, now the mapping is stored only once on the root polymorphic record and all subclasses simply reference it directly. This removes the duplicate memory use and removes the need to recurse each time that a new polymorphic record is added to the store. * Fixed SC.ObserverSet to pass the given context to the observer method. SC.ObserverSet.prototype.add() accepts a third argument, context, but it did not actually pass it along to the observer method. * Fixed a noisy reposition of SC.PickerPane.

The pane listened to changes to its borderFrame in order to know whether to reposition itself or not. This means that changes to its size (width/height) allowed it to reposition to best fit, but because repositioning ends up changing the same borderFrame, it meant one (potentially dangerous) extra call through positionPane for no reason. Instead, we use viewDidResize, which only gets called on size (width/height) changes. * Fixed a problem with excessive layout updates for certain types of views. If a view used viewDidResize to check for size changes and then make further adjustments to its position, because of a late cache update, the adjustments to its position would appear as further changes to its size. In particular, SC.PickerPane suffered from this, since it re-positions itself whenever its size changes. * Fixed issues with unregistering nested records. There were a few issues with unregistering nested records:

1) SC.ChildArray did not unregister nested records at all, so toMany relations with nested records did not work properly. 2) When a child was unregistered from its parent, that did not propagate to children of the child, leading to problems when nesting was several levels deep. 3) There were two additional caches that were not being cleared when the nested record was unregistered.

1.10.2

INTERNAL CHANGES

BUG FIXES

1.10.1

BUG FIXES

1.10.0

CHANGES & FEATURES

This code was essentially unreadable and did not even really work. There were lots of odd constants that affected the positioning and placement in strange ways. With this refactor, the picker pane properly positions itself on the most appropriate side and will slide itself up/down or left/right if it can in order to fit.

This cascading can be blocked by any child view by setting shouldInheritEnabled to false, which allows you to set isEnabled on the top pane, but keep a section of child views separately enabled. * [internal] Fixed from the Office for Prevention of Redundancy Office: the 'focus' and 'disabled' classes are set accordingly on all SC.View subclasses. This removes yet one more display observer from SC.CollectionView. * Adds SC.View.POP transition, refactors the transition states of SC.View to handle changes in state in order to flip a transition animation smoothly and adds support for cancelling rotation or scale animations in place. * Removes two display observers from SC.ImageView and drops undocumented support for setting the value of an image as an array (which was parsed out into a single value for some reason. * [internal] Adds support for sprite images based on canvas. This fixes a bug when changing between a sprite and a URL type with the same image that created duplicate elements in the DOM. * Removes some ugly unused images from the foundation framework and adds updated sproutcore assets which are more useful. * Renames SC.FILL_PROPORTIONALLY to SC.BEST_FILL. SC.FILL_PROPORTIONALLY is still supported but no longer documented. * Adds isEditable, isDeletable and isReorderable support for item views. The previous docs indicated that if isEditable of the collection was true, it would set the property on the item views. This was not the case, so there wasn't any way to have a list of items switch between a display mode to an editable mode. This change uses canEditContent, canDeleteContent and canReorderContent to indicate whether to add the respective properties to the item views. For example, this allows you to toggle canReorderContent to hide or show a drag handle on item views that have isReorderable as a display property.

Note: Setting isEditable to false on the collection view overrides the three other properties. * [internal] Also escapes the tool tip for SC.LabelView, which could also be a potential avenue of attack for XSS. * [internal] Removes excess display property observers from SC.ButtonView (escapeHTML, needsEllipsis, tooltip) and SC.LabelView (escapeHTML, textAlign, fontWeight, needsEllipsis). In the case of escapeHTML and needsEllipsis, these are used in the update rendering, but it seems highly unlikely that the value will need to change on the fly. The docs have been updated to indicate how to support updating these values on the fly if necessary though. In the case of the other properties, they no longer exist on the views. * [internal] Removes several lines of statechart debugging code from non-debug builds. * [internal] Removes three extra observers from SC.ButtonView instances by using existing observers to also call displayDidChange. * [internal] Removes isEnabled displayProperty from SC.Control and instead makes it an effective display property of all SC.Views by calling displayDidChange in the existing isEnabled observer on all SC.Views. * Removes the restriction that render delegate data sources can only retrieve displayProperties properties. This restriction is not especially helpful, but worse than that, it forces us to have excess display properties, which means excess observers being set up and running although not every property that effects the display necessarily needs to be observed. For example, SC.ButtonView has several internal observers on properties that are also display properties. It's more efficient to use those same observers to call displayDidChange and not have the properties also be display properties. * Prevents exception when clicking on a collection without any content. * Removes backgroundColor observer from all SC.Views. If anyone actually uses this property AND needs it to update, they'll have to add the displayProperty themselves. There's no reason every other view in every other app needs this. * Adds 'sc-item' class to non-group collection items. Otherwise, you can apply styles to groups, to items and groups, but not items individually without adding class names to the exampleView. * Optimizes destroy of SC.View. This is a slow part of the view lifecycle, due to recursively running through every descendant and notifying willRemoveFromParent, didRemoveFromParent, willRemoveChild, didRemoveChild as well as searching through and clearing all of the childViews arrays. Instead, we destroy the topmost parent, including detaching and destroying the layer and clearing all references to the views from SC.View.views, but then we defer orphaning the childViews for the newly destroyed parent until the next run loop. This cuts the destroy time almost in half for the average view tree. * Improves item view pooling by shifting from the pool so that there is a good chance that the same item view will be returned for the current index that was pushed on due to a full reload. * Removes layer observer from SC.ImageView and use didCreateLayer callback instead. * Adds createdByParent property that is set to true when the view was instantiated by its parent through createChildView. Prevents memory leaks and simplifies the code of several views by using createdByParent to identify when the child view being removed was automatically created and should now be destroyed. * Adds willShowInDocument, willHideInDocument, didShowInDocument and didHideInDocument nofication callbacks. This allows you to do updates to the UI without needing to observe isVisible or currentState. * Changes SC.SheetPane to use transition plugins: 17 lines added, 56 lines removed! * Adds BOUNCE_IN/OUT and SCALE_IN/OUT transitions for SC.View * Removes a lot of redundancy in view rendering and updating. Previously, the update code would run applyAttributesToContext every time which would update several one shot properties: classNames, isTextSelectable, role and also update some properties that were doubly updated elsewhere: layerId, isVisible. Now the one-shot portions are done in renderToContext, which is strictly a first time render method. * Optimizes the observers on isVisible and isFirstResponder to be added when the view is attached and subsequently removed when the view is detached. Also deprecates ariaHidden and sets it properly according to isVisible + current view state. Adds _executeQueuedUpdates method to execute the content, layout and visibility updates when a view is about to be shown. * Adds more explicit documentation of what happens when calling removeChild and removeAllChildren. Adds method removeChildAndDestroy that will remove the child and discard it entirely. Adds optimization to removeAllChildren that will clear the parent's layer in one sweep rather than per child. Adds optimization to replaceAllChildren that will clear the parent's layer in one sweep, add the new children and create the new layer in one sweep rather than per child! * Removes many additional display observers. * Adds the transitions properties to SC.CoreView along with docs. * Adds view statechart code and tests * Adds debug mode only warnings if invokeOnce or invokeLast are called outside of a run loop.

I encountered a weird bug while working in the console due to the fact that invokeOnce was running after invokeNext, which will never happen in the context of the run loop. A warning should help save developers from making similar mistakes. * Added retina stylesheet support to module loading, style sheets were being generated but not loading. * Removes extra array creation. Rather than create an array for no purpose other than for testing respondsTo when the statechart is destroyed, this change adds a gate check to the respondsTo method itself similar to what was already done with sendEvent and gotoState. [5763a62] * Some actions need to be always handle by a TextFieldView when it has the focus

If a parentView of a TextFieldView handle deleteForward deleteBackward, moveLeft, moveRight, selectAll, moveUp or moveDown, the event will not be mapped to the TextFieldView. * Fixes some totally wrong documentation on SC.Query and deprecates the argument overloading in 'local' and 'remote' in favour of only passing the options hash. This makes for:

• more memorizable methods right now

and in the future when we are able to remove the normalization code,

• less code • easier debugging • less chance for edge case bugs * Added documentation for a hidden feature where MenuPane can specify a global target/action for use with all of its items, as given passing mention in #945. * Improved perforamnce of scroll view on iOS significantly by using request animation frame. * All errors are actual Error objects, which provide more debuggable stack traces. * Removes SC.ListItemView as the default exampleView of SC.CollectionView. For one, SC.CollectionView should not be used un-extended so there's no reason to predefine this value and for two, this means that you can't blacklist out SC.ListItemView and keep SC.CollectionView. * Refactors SC.CollectionView to implement reusable item views and view layers. This support was built into the view already via an undocumented property, but didn't work correctly anyway. The same support could be found in the SC.CollectionFastPath mixin, but it was also poorly documented and difficult to use. Instead, the performance improvement has been re-implemented to be simpler than the version in SC.CFP and to actually work unlike the version in SC.CV and so that it will be seen by developers, it has been turned on by default.

on reload all: previous version ~14.5ms, new version ~ 6.5ms on reload partial: previous version ~ 6.39ms, new version ~1.27ms * Requesting an index beyond the length of a sparse array should not trigger an index or range request on the delegate and just returned undefined. If you need to prime a sparse array to start loading without setting a length, it's best to use sparseArray.requestIndex(0). * Adds the concept of Infinity to SC.IndexSet. Although, the number of indexes will always be constrained to Number.MAX_SIZE, attempting to create a range even in the several hundreds of thousands would freeze the client, because it will attempt to generate hints every 256 items. Instead we can use the concept of infinity and don't try to hint the infinite range. For one, this allows for infinite arrays and infinite lists to be possible without using really large numbers that are very slow to hint. * Fixes SC.ScrollView's always updating scroller visibility and maximum scroll offsets. The code was supposed to only go through the process of determining scroller visibility and dimensions when forced (due to the scroll view's frame changing or when the content's cached width and height matches the current width and height of the content). The code assumed that the first argument would normally be undefined, but because the function is an observer method, the first argument is always the target of the observer. Therefore, the fast path conditional would always be false.

This changes the code to instead clear out the cached content width and height before calling contentViewFrameDidChange, which will allow the code to run completely. Subsequent calls from the observed changes will be able to exit early based on the cached values. * Fixes SC.GridView's calculation of max height when its width changes. Previously, as the grid view was compressed or expanded, the layout of the grid view (maxHeight) would not update, which meant that scroll views would not adjust their scroll heights appropriately.

This removes the computeLayout() call from the reloadIfNeeded method in SC.CollectionView. Since only certain events should require the layout to change (i.e. itemsPerRow changes in SC.GridView, row heights change in SC.ListView or the content length changes), we don't need to repeatedly run the computeLayout code every time we scroll a little bit.

Adds adjustLayout method to SC.CollectionView which can be used with invokeOnce to adjust the view's layout when one of the previously mentioned events occurs. * Changes missing child view error to a warning, since we don't actually throw an exception. Also pulls the warning out of production code. * Removes z-index from SC.SelectView label for Ace. SproutCore styles should not use z-index and it's not needed in this case either. * New Sheet pane implemented with slick animations. * Sets SC.WebView src to '' instead of 'null' or 'undefined' when the value is null or undefined. Removes the “No matching entry in target” message when value of SC.WebView is cleared. [d1289cd] * Adds the inline text field to the view's parent rather than its pane. If any view in the chain from pane to the view's parent has a zIndex, the text field won't be visible. By adding it to the parent instead, there's a greater chance that nothing special will need to be done with the text field. * Add a difference method to SC.DateTime. SC.DateTime.prototype.difference(a, b, format).

This method allows you to very easily compute the number of weeks, days, hours, minutes, or seconds between two dates. * Improved String.fmt handling of missing named arguments. * The SC.Store.reset() method was not clearing out previously constructed RecordArrays, even though the underlying data hash was being cleared. While technically this is valid -> most of the storekeys are set to SC.Record.EMPTY rather than being deleted altogether, which means the storeKey lists inside of the RA's aren't invalidated -> it seems a little strange that a method labeled “reset” does not, in fact, clean up the entire store.

This patch ensures that the entire store is cleared, and adds a few unit tests that enforce the one-record-array-per-query contract. * Fixes the order of the container and segmented view in the DOM for SC.TabView so that the segmented view should be rendered above the container without having to resort to forced z-index settings. * Adds transition plugin support to SC.ContainerView and introduces five pre-built plugins: SC.ContainerView.PUSH, SC.ContainerView.DISSOLVE, SC.ContainerView.FADE_COLOR, SC.ContainerView.MOVE_IN and SC.ContainerView.REVEAL. * Adds a developer error message if an SC.View is created using an existing layerId. This should prevent some weirdness from occurring. * Refactors SC.View:animate().

There were many problems with the animation and transition tests that existed before. There was no forward support so browsers, like the Firefox nightly that have dropped prefixes, would fail to identify as supporting transitions and transforms. Also, animation event listeners were hard coded into RootResponder for webkit only. Also the event names needed to be forward supported as well and because there is no consistency in the event naming, the real transition and animation events may not have been captured on certain browsers.

Now, SC.platform does quick and precise tests to determine the actual event names allowing the RootResponder to listen only to the properly named events rather than using a shotgun approach with a bunch of different browser prefixes.

To make the code forward compatible for when prefixes are dropped, SC.browser has three new support functions: experimentalNameFor(), experimentalStyleNameFor(), experimentalCSSNameFor(). These functions return the proper name for experimental names for object classes & properties, DOM properties and CSS attributes, not by guessing, but by testing the standard name and then testing prefixed versions of the name if necessary. This allows developers to avoid writing code like: SC.browser.cssPrefix + “box-shadow black 0 1px 2px”, which will fail on browsers that no longer need a prefix and instead use: SC.browser.experimentalCSSNameFor('boxShadow'), which will return either “box-shadow”, some browser prefix + “box-shadow” or SC.UNSUPPORTED (allowing you to do something else). * Makes invokeNext trigger the next run of the run loop if none is scheduled. This makes invokeNext the appropriate method to use when needing the DOM to be up-to-date before running code against it.

Previously, invokeNext functions would not run until the next run loop occurred, which if there were no events or timers, might mean that the code won't run for a long time. While invokeLast lets you put code at the end of the run loop, the DOM will not have yet been updated and invokeLater is risky to use at small intervals, because if the interval is too small, the invokeLater code will run in the current run of the run loop and again the DOM will not have been updated. Instead, invokeNext now ensures that the run loop completes execution and schedules an immediate timeout in order to allow the browser to update the DOM.

This works with the timer additions to the run loop, so additional run loops only run once even if there is an invokeLater expiring at the same time as the invokeNext timeout triggers a new run loop. * Refactors SC.RenderContext to simplify the API, introduce consistent naming and make it behave appropriately. This should remove the guess work about whether a function is or is not supported by the context and make it easier to remember the names and parameters of each method.

This does NOT patch jQuery to make all calls to .append(), .insert(), etc. pass security validation in IE. Instead it uses execUnsafeLocalFunction to perform jQuery's tests that are based on invalid HTML. * Minor optimizations to Array#filterProperty. * Improves animation support for current and future browsers. The previous platform checks prevented using accelerated layers on non-webkit platforms, plus any browser that dropped the prefixes would indicate that they did not have support for transitions and transforms. * Removes duplicate transitionend event listeners and only listens for the supported platforms event. * Adds 'delay' option to set the transition-delay property * Adds new SproutCore-only date time formatter, %E, to SC.DateTime which returns the elapsed time from or since now. There is an entire set of default values from the number of years ago to right now to a number of years in the future and of course the strings are completely configurable and localizable.

For example,

var date = SC.DateTime.create();

date.toFormattedString("%E"); // "Right now"

date.advance({ minute: 4 });
date.toFormattedString("%E"); // "In 4 minutes"

date.advance({ day: -7 });
date.toFormattedString("%E"); // "About a week ago"

DEPRECATIONS & REMOVALS

Also added better documentation for using dataSourceDidFetchQuery. * Fully deprecates the animation sub-framework, since it has been fully implemented into SC.View:animate and significantly improved. * Removes long deprecated findAll method from SC.Store. * Deprecates useFastPath in SC.CollectionView (i.e. SC.CollectionFastPath) since the performance improvements have been baked in by default. * Deprecates SC.BENCHMARK_RELOAD as a public property of SC.CollectionView. This is a property used for developing and improving SC.CollectionView and doesn't need to be public. It also doesn't need to be included in production code. Anyone hacking on SC.CollectionView can add (and later remove) their own benchmarks while they are coding it. * Deprecates SC.platform.cssPrefix and SC.platform.domCSSPrefix in favor of SC.browser.cssPrefix, SC.browser.domPrefix and SC.browser.classPrefix. The css prefix and dom prefix in SC.platform were calculated from the user agent, which duplicated work already being done with more rigor in SC.browser. * The :template_view framework is no longer included by default when requiring :sproutcore. This framework is now partially deprecated, meaning that it won't be officially supported by the core team. But it is not scheduled to be removed in any successive version and therefor anyone using it is welcome to continue doing so. * The default value of SC.SelectView:itemSeparatorKey has been changed from 'separator' to 'isSeparator' to match the documentation. If a property 'separator' is found on the item, it will still be used and a developer warning will appear in debug mode. * The 'owner' property that is assigned to child views is deprecated and may be removed in a future release. This property is assigned to a view's childViews when the view is created. However, it is a duplication of the property 'parentView' and it is not maintained properly and not assigned if a childView is added later using appendChild() or replaceChild().

BUG FIXES

According to:

developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html

The new values for 'autocorrect' are “off” and “on”, and the values for 'autocapitalize' are “none” and “sentences”. * Fixes a bug that caused the drop target to have dragExited called when the drag ends and also improves the ghostView layout to match the actual size of the drag view. * Fixes animation bug where animating multiple keys in which some do not actually change value resulted in leftover animation styles. * Fixes polymorphic records so that you can change the id on the record. Previously, this would result in broken storeKey caches on the polymorphic superclasses, so the same record would appear with different ids depending on which class it is requested with. * Fixes exception when setting the content of an SC.TreeController (or any other object that nulls out arrangedObjects and mixes in SC.SelectionSupport). Fixes previous commits failing unit test. * Fixes bug #990: SC.ListItemView Doesn’t Render Right Icons of the View’s rightIcon Property

The code for rendering a right icon was missing in the render method. It has been added. Additionally the first part has been adapted to the code for the (left) icon: In case of contentRightIconKey, it is only rendered if a value exits for that key. * Fixes SC.ImageButtonView to actually apply the image class to the wrapper div, thus removing the extra internal div and allowing the .active class to work like the docs say. Previously, there was no way to get an active version of the image used without also adding a custom class name to the button + the docs said you could and were wrong. * Fixes SC.CollectionView to reload when isEnabled changes. Otherwise, the isEnabled property isn't reset on the item views to match the value of the view itself. This was done by observing isEnabled separately from the other displayProperties so that we can also call reload(). * Fixes placement of the run loop for focus event so that code changed when makeFirstResponder runs, it runs inside of the run loop. * TextField incorrectly sets initial isBrowserFocusable * Fixes SC.LabelView default style so that 'needsEllipsis: true' will work on single line labels. Also added the property to the SC.LabelView class with jsdoc explaining it. * Fixes improper binary search used by SC.ManyArray addInverseRecord that resulted in an infinite loop * Call notifyPropertyChange on currentStates when statechart is destroyed.

The currentStates property was remaining cached after the statechart was destroyed. This meant that when respondsTo was called, it would still iterate through these now destroyed states, causing a crash. * Fixes bug that allowed the context menu to appear regardless of overriding contextMenu in a view or setting SC.CONTEXT_MENU_ENABLED or isContextMenuEnabled to false. This makes the context menu event handling behave the same as the key, mouse, etc. event handling. * Fix SC.TextFieldView to insert a new line when the enter key is press on a text area

A fix were already there for the SC.InlineTextFieldView class so I copy it into the TextFieldView class. I've updated the SC.InlineTextFieldView class so that it now call the super class in the case where it is a text area.

I've also removed some useless code in the InlineTextFieldView class: - A fix in the insertNewline method which is not needed anymore - The method fieldValueDidChange which only call the super class * Fixes the hint value for SC.LabelView so that it will appear when the label has no value and isEditable is true. Includes unit test. * Added fix for incorrect loop in SC.Request.manager.cancelAll * Destroying a READY_NEW record puts it directly into DESTROYED_CLEAN state, but was failing to remove the data hash like would happen when we pushDestroy a record or call destroyRecord/dataSourceDidDestroy on a record. * Fixed issue with centerFoo + border layouts which calculated views' negative margins based on the view's inner size rather than the size including the border. * There was an issue that if you destroyed a child view, it would destroy its layer and remove itself from the parent, which in turn invoked updateLayerLocationIfNeeded in parentViewDidChange. If before updateLayerLocationIfNeeded ran a new child was created with the same layer id, when updateLayerLocationIfNeeded did run it would remove the new layer from the parent.

The solution was that if a view is destroyed, don't invoke updateLayerLocationIfNeeded. * Fixes SC.Cursor's determination of its internal stylesheet object. Previously, it would just take the last stylesheet, but any style elements in the body would match this. Instead we find the stylesheet whose node matches the element we insert for the cursor object. * Fix SC.LabelView inline editing

If an SC.LabelView is inside a collection view the doubleClick method can't be call because the collection will handle the mouseDown event. * Prevents exception when using borderFrame property with useStaticLayout views before they have rendered. Includes updated unit tests. - Fixes incorrect calculation of the borderFrame property in SC.View. It used the wrong names for the properties and didn't work at all. - Fixes frame failing to recompute if the border property of the layout is adjusted. Previously, layoutDidChange only checked for changes to the width or height layout properties to indicate that the frame has changed. - Adds unit tests that validate the frame and borderFrame when using border layouts. - Adds _effectiveBorderFor() function, which reduces the amount of repeated code to determine the border of any particular side - Also tidies the layout.js file a la jshint. * Fixes typo in warning message and makes SC.View:createChildViews behave as the warning indicates. If there is an invalid childView it will be ignored, which includes removing it from the childView's array so further iterations over childViews (eg. SC.View:awake) don't throw exceptions.

Note: this is especially a problem if you wanted to create an app manifest based on the contents of the built static directory. The client would have to download a 2.5MB debug image that is never used. * Fixes a regression with SC.CollectionView that occurred after a previous fix to remove a view DOM leak. SC.CollectionView previously created a view with the same layerId as the view to be replaced before replacing it, which only worked because of some weird logic external to the CollectionView that used to prevent a view from being able to find its layer if it didn't have a parentView (which was also the cause of a leak because the layer might still exist in the DOM). In any case, having two views use the same layerId at the same time is a bad idea. * Fixes duplicate 'input' property in SC.platform. * Fixes bug noticed by updated jQuery. The previous version of SC.RenderContext:addStyle() would replace styles, which was really only due to an undocumented behavior of jQuery, plus it is semantically incorrect for 'add' to replace. The refactor of RenderContext makes the functions behave properly. * Fixes SC.View:animate() failing to work on Firefox 16+ and IE10+, since they have dropped prefixes on the properties. * Fixes problem with cleaning up bindings on SC.View. Previously, SC.View would destroy itself first before calling the super destroy method. This would remove the parentView object from all childViews, which meant that when the super destroy method tried to remove bindings and observers, it was unable to resolve any parentView property paths and thus unable to remove any bindings to the view's parentView. * Fixes minor memory leak in SC.Set. The way that SC.Set removes objects is to “untrack” the internal index of the object by shrinking its length, but it never actually removed the object at the last index. The only way that the object could be freed is if a new object is inserted at the same internal index, thus replacing it. If the objects were removed in the reverse order that they were added, every object would still be in the set (until they were possibly overwritten). * Fixes moderate memory leak with bindings and observers. Previously, SC.Binding objects and observers were never cleaned up even as views and objects were destroyed which could prevent the views and objects from being garbage collected and prevented the binding objects from being garbage collected. * Fixes minor memory leak in SC.ObserverSet. Each time that a new observer is added to an object the ObserverSet for the object will add a tracking hash for the target and the method. As more methods are tracked for the target, they are added and as methods are no longer tracked for the target, they are removed. However, even when no methods are tracked for the target, an empty tracking hash for the target still exists. This creates a small leak of memory, because the target may have been destroyed and freed, but we are still maintaining an empty tracking hash for it.

1.9.2 - BUG FIX RELEASE

Note: this is especially a problem if you wanted to create an app manifest based on the contents of the built static directory. The client would have to download a 2.5MB debug image that is never used. * Fixes SC.browser unit tests * Fixes determination of touch support in Chrome on Win 8. * Adds missing un-prefixed border-radius rules to the default theme for browsers that have dropped the prefix.

1.9.1 - BUG FIX RELEASE

If childView layers are rendered when the parentView's layer is created, the layer property on the childView will not be cached. What occurs is that if the childView is then removed from the parent view without ever having its layer requested, when it comes time to destroy the DOM layer of the childView, it will try to find it with a get('layer'). The bug was that it only returned a layer if the view has a parent view. However, since the child was removed from the parent first and then destroyed, it no longer has a parent view and would not try to find its leftover DOM layer. * Fixes improper implementation of SC.SelectionSet:constrain (fixes #870). It was naively using forEach to iterate through the objects while mutating the array so that the last object could never be constrained. * Fixes implicit globals in SC.MenuPane, creating a possible memory leak. * Fixes memory leak with child views of SC.View. The 'owner' property prevented views from being able to be garbage collected when they are destroyed. * Fixes SC.stringFromLayout() to include all the layout properties. * Fixes the excess calling of parentViewDidResize on child views when the view's position changes, but it's size doesn't. Previously, views that had fixed sizes (i.e. width + height), but not fixed positions (i.e. not left + top) would still call parentViewDidResize on their own child views each time that the view's parent view resized. However, this isn't necessary, because changes to the view's parent view will effect the view's frame, but if the view has a fixed size, it will not effect the child view's frames. - This fixes a strange issue that occurs with SC.ImageView's viewDidResize implementation, where it fails to resize appropriately. - This separates isFixedLayout into isFixedPosition + isFixedSize, allowing us more options to decide what to do when the layout is a fixed position vs. a fixed size vs. both vs. neither. - Note: A similar optimization already exists in layoutDidChange. * Fixes bug in SC.Locale that caused localizations to be overwritten by the last language localized. * Fixes SC.Request's application of the Content-Type header. It was incorrectly adding the header for requests that don't have a body which would cause some servers to reject GET or DELETE requests. * Fixes a bug where SC.Record relationships modified within a nested store, would fail to propagate the changes to the parent store if isMaster was NO in the toOne or toMany attribute. This also fixes possible instances of the same bug if using writeAttribute() and passing YES for the ignoreDidChange param inside a nested store.

1.9.0

CHANGES & FEATURES

Here are some example uses:

DEPRECATIONS & REMOVALS

BUG FIXES

1.8.2 - BUG FIX RELEASE

1.8.1 - BUG FIX RELEASE

1.8.0

CHANGES & FEATURES

If you call this with the same target/method pair multiple times it will only invoke the pair only once at the beginning of the next runloop. * Addition of invokeOnceLater to SC.Object. A convenience method which makes it easy to coalesce invocations to ensure that the method is only called once. This is useful if you need to schedule a call but only want it to trigger once after some defined interval has passed. * Desktop framework thoroughly updated to include WAI-ARIA attributes for improved compatibility with assistive technologies. * Addition of routing integration with SC.Statechart. States can be made to represent a route (by default SC.routes routes) and if assigned then the state will be notified to handle the route when triggered any time the app's location changes to match the state's assigned route. * Added mult extension to String that multiplies a string a given number of times. [5a2aee1] * Addition of SC.StatechartDelegate mixin. Apply this to objects that are to represent a delegate for a SC.Statechart object. When assigned to a statechart, the statechart and its associated states will use the delegate in order to make various decisions. * TextFieldView has a new property'hintOnFocus' which uses a div to act in place of the regular 'placeholder' so that it remains visible when the text field has focus. * SC.TextFieldView long placeholders will show ellipsis if too long. [ab66960] * Rewrite of SC.browser. Matches more browsers correctly and replaces the potpourri of various properties with seven standard properties: device, name, version, os, osVersion, engine and engineVersion with matching constants: SC.BROWSER, SC.DEVICE, SC.OS, SC.ENGINE. * Added a function SC.RunLoop.wrapFunction, which, when called on a function, returns a version wrapped in code that ensures a run loop. [de83d88] * Created a new object SC.bodyOverflowArbitrator, which, given requests for body overflow:hidden; or overflow:visible; will decide which overflow to assign. Objects issue, then change or withdraw their requests. Previously, views may have set the body overflow directly, which would lead to unpredictable behavior when more than one object had an interest in the setting at one time. [c55e32b] * APP_IMAGE_ASSETS is a new global array that contains the list of all sprited images, this is ideal to preload images at different points. Even before the app or SC finishes loading. [31c2239] * Added support for text selection in SC.TextFieldSupport. [1dcc289] * Don't throw an exception if there are SC.Record.EMPTY records in the store and calling commitRecords on the store. * Changed getDelegateProperty of SC.DelegateSupport to not accept null as a valid value. * Updated Handlebars to version 1.0.0.beta.4. [e80d40d] * Added helper method patchUrl to SC.Request. [5e955ce] * Throw an error in development mode when passing an incorrect parameter to SC.IndexSet.create. * Added default itemTagNames for 'dl' and 'select' collection tagNames in TemplateCollectionView. [73c3f84] * Don't allow disabled radio buttons to be checked in SC.RadioView. [99e47b1] * Moved all TemplateView code into its own framework. It is still included by default when requiring :sproutcore in your Buildfile, but can easily be excluded by requiring specific frameworks instead. * Speed improvement in IE by avoiding excessive focusin/focusout events. [1c817a9] * Speed improvements in renderContext, switching from joining arrays of strings to simple string concatenation. * SC.TabView places tabs first in the view hierarchy for accessibility. [9e1b4e4] * In SC.SelectView, if value object and list objects are both records, compare the store keys to see if they are really the same thing. * Added @lang support for multi-lingual text-to-speech voices. [4f9ec80] * Faster code escaping using regular expressions instead of DOM. * New flag to stop picker repositioning when the window is resized. * SegmentedView update to enable/disable overflow. * Small performance improvement for splitView. * New string measurement functions to optimize for string wrapping. * Added support for autoCorrect and autoCapitalize in TextFields. * Added back object types previously removed by the refactored SC.Object * Refactored observer paths code for a more robust handling. * Rewrite SC.LOG_RUNLOOP_INVOCATIONS — now renamed to SC.LOG_DEFERRED_CALLS — to work with the new runloop implementation. * Added this SC.RunLoop.kill to terminate cleanly a run loop in case of an error. * Added the ability to dynamically add substates to a statechart via a state's addSubstate method. * Updated the statechart tracing logic. * Updated SC.State. getSubstate now accepts a callback; added getState method; gotoState and gotoHistoryState now use getState * Updated state's gotoState and gotoHistoryState to allow for a more expressive state arg that now allows for the use of 'parentState' * Updated SC.State's getSubstate method to allow for path expressions. Also refacted the findFirstRelativeCurrentState method. * New SC globals to provide information like build mode, build number and locale.

DEPRECATIONS & REMOVALS

BUG FIXES

1.6.0

1.6.0.rc.2

1.6.0.rc.1

1.6.0.beta.3

1.6.0.beta.2

1.6.0.beta.1

CHANGE LOG FOR 1.5

Upcoming

1.5.0

1.5.0.rc.2

1.5.0.rc.1

1.5.0.pre.5

1.5.0.pre.4

CHANGE LOG FOR 1.4

DISCLAIMER: This is a very rough and not comprehensive overview of the 1000+ commits that formed SproutCore 1.4.

MAJOR

NEW

MISCELLANEOUS

BUG FIXES

BROWSER