Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Yui3.4.0 What's new


Published on

Published in: Real Estate, Technology
  • Be the first to comment

  • Be the first to like this

Yui3.4.0 What's new

  1. 1. YUI 3.4.0(What’s new?)<br />霸先(@enmaai)<br />
  2. 2. Initial release<br />App Framework<br />Calendar<br />Graphics<br />Panel<br />Widget-autohide<br />Widget-buttons<br />Widget-modality<br />
  3. 3. Big Changes<br />App Framework(beta)<br />YUI and Loader<br />Calendar(beta)<br />Graphics API Updates(beta)<br />New Widget Plugins<br />Bug fixes and optimziations<br />
  4. 4. App Framework<br />The YUI App Framework is a rollup of the Controller, Model, Model List, and View components, combined to form a simple MVC-style framework for writing single-page JavaScript applications. <br />@see<br />
  5. 5. YUI and Loader<br />YUI.add('yui', function(Y){}, '3.3.0' ,{use:['yui-base','get','features','rls','intl-base','yui-log','yui-later','yui-throttle']});<br />YUI.add('yui', function(Y){}, '3.4.0' ,{use:['yui-base','get','features','intl-base','yui-log','yui-later','loader-base', 'loader-rollup', 'loader-yui3' ]});<br />remove ‘rls’,’yui-throttle’;<br />add ‘loader-base’, 'loader-rollup', 'loader-yui3'<br />
  6. 6. YUI and Loader(seed)<br />3.3.0<br />yui-min.js GZIP 22k<br />3.4.0<br />yui-min.js GZIP 66k<br />
  7. 7. YUI and Loader(rollup)<br />
  8. 8. YUI and Loader(rollup)<br />
  9. 9. What’s the matter?<br />both 3.3&3.4 are ok<br />YUI().use(‘node’,function(Y){}); <br />3.3 is ok,3.4……<br /><script src=“http://yui/3.3.0/build/node/node-style.js”></script> <br />3.4 not work<br /><script src=“http://yui/3.4.0/build/node-style/node-style.js”></script><br />the best<br />YUI().use(‘node-base’,’node-style’,function(Y){});<br />
  10. 10. Calendar<br />
  11. 11. Graphics API<br />
  12. 12. Bug fixes and optimziations<br />
  13. 13. Attribute<br />Added params to constructor, to support call to addAttrs on construction with user values, when augmenting and invoking constructor manually. Also broke out addAttrs logic on construction (introduced for Node), into its own _initAttrs method to facilitate customization.<br />
  14. 14. AutoComplete<br />Added the ability to use a `<select>` node as a result source.<br />#2529974: Function sources may now be either asynchronous or synchronous. Returning an array of results from a function source will cause it to be treated as synchronous (same as in 3.3.0). For async operation, don't return anything and pass an array of results to the provided callback function when the results become available. <br />#2529974: Added a `sourceType` attribute to `AutoCompleteBase`, which may be used to force a specific source type, overriding the automatic source type detection. <br />The `scrollIntoView` config option is now much smarter. It will only scroll if the selected result isn't fully visible. If the result is already entirely within the visible area of the viewport, no scrolling will occur.<br />A pre-existing `listNode` may now be specified at initialization time.<br />Added `subWordMatch` filters and highlighters. [Contributed by Tobias Schultze]<br />The `this` object now refers to the current AutoComplete instance instead of the window in list locators, text locators, filters, formatters, highlighters, and requestTemplate functions.<br />Added an `originEvent` property to the event facade of `select` events. It contains an event facade of the DOM event that triggered the selection if the selection was triggered by a DOM event.<br />
  15. 15. AutoComplete<br />#2529949: Small performance improvement for filters operating on empty query strings.<br />Result list alignment is now updated both when results change and when the window is resized instead of only when the list becomes visible. This makes right-aligned lists with dynamic widths less awkward.<br />Fixed a bug that prevented CSS-based z-index values from taking effect on the AutoComplete list and required the z-index to be set via JS. The `.yui3-aclist` class now provides a default z-index of 1, and this can be overridden with custom CSS. Specifying a `zIndex` attribute value via JS no longer has any effect.<br />Fixed a bug that caused the IE6 iframe shim under the AutoComplete list to be sized incorrectly the first time the list was displayed.<br />#2529895: Fixed a bug in which the `requestTemplate` would sometimes be used as the query instead of being appended to the source URL. This affected XHR and JSONP sources that used both a `{query}` placeholder in the source string and a custom `requestTemplate` value.<br />Fixed a bug that caused the `requestTemplate` function to be called twice for an XHR request instead of just once.<br />#2530410: Fixed a bug in which JSONP, XHR, and YQL requests were cached solely based on the query rather than on the complete request. This could result in cache collisions when two requests with the same query but different parameters (provided by a requestTemplate) were made. <br />#2530455: Fixed a bug that caused the `&` character to be treated as an up arrow key in Firefox. <br />Removed the "beta" label. Hooray!<br />
  16. 16. Base<br />Base now destroys plugins before destroying itself<br />Base.create/mix extensions can now define initializer and destructor prototype functions, which will get invoked after the initializer for the host class into which they are mixed and before its destructor.<br />Uses a hash version of whitelist mix for improved performance. Also removed non-required hasOwnProperty check and delete.<br />
  17. 17. Charts<br />Charts only requires datatype-number and datatype-date instead of the datatype rollup. <br />#2530413: Position axis labels with transform instead of css styles. <br />#2530533: Fixed issue in which stacked bar/column displayed inaccurated data on mouseover when zero values appeared in the series. <br />#2530404: Fix issue in which markers were incorrectly omitted from graphs. <br />#2530395: SplineSeries extends LineSeries instead of CartesianSeries. <br />#2529841: Add axis title. <br />#2530143: Refactor to use Graphics API<br />#2530223: Fixed bug in which negative value markers were not displayed in column/bar series.<br />#2529849: Fixed styles documentation bug<br />
  18. 18. Charts<br />#2530115: Fixed bug preventing tooltip's node from being overwritten.<br />#2529972: Fixed issue in which zero/null values were falsely creating markers in stacked bar and column series.<br />#2529926: Fixed issue in which null values were being treated as zero.<br />#2529925: Fixed bug in which dashed line was not drawn in combo and line series.<br />#2529926: Fixed issue in which null values in data provider are treated as 0.<br />#2529927: Addressed issue in which primitive value strings were not being parsed correctly in the TimeAxis.<br />#2529971: Force range on a NumericAxis when all values are zero.<br />#2529842: Ensure Numeric axis has at least on negative and positive tick when minimum is less than zero and maximum is greater than zero.<br />#2529840: Changed stacked bar and column series to handle cases in which the item value is at or rounded to zero.<br />
  19. 19. Collection<br />#2530376: Sparse arrays are now handled correctly in the non-native implementations of `Array.every`, `Array.filter`, `Array.find`, ``, and `Array.reduce`.. <br />
  20. 20. Console<br />CSS classes generated from the 'style' attribute changed from, e.g., yui3-inline-console to yui3-console-inline<br />
  21. 21. dataschema-json<br />Added support to accept the results array as input, leaving `schema.resultListLocator` as optional.<br />Field locators that contain . or [???] now fail over to look for that locator as a single property name rather than a nested value. For example, a locator `"not.nested"` would look for `inputRecord.not.nested` for a value, but if it doesn't find one, it will look for `inputRecord["not.nested"]`. If it finds a value there, it will not look for a nested value for subsequent records.<br />`getPath` is far more tolerant of locator strings. In particular, it considered utf-8 characters that didn't match the `w` regex group to be invalid. This is fixed.<br />
  22. 22. datasource-polling<br />#2529182: `setInterval` fires first `sendRequest` in a 0ms `setTimout`, then subsequent calls after the configured timeout.<br />
  23. 23. datasource-function<br />#2529824: success callbacks that throw an error no longer result in the `data` event being fired again. <br />
  24. 24. Data Table<br />Render cycle revamped to avoid calls through the Attribute API for each cell. This should improve render performance somewhat. More performance improvements to come in 3.5.0. The object passed through the render loops' supporting methods now has additional properties and many properties are added earlier. still refers to the cell added by the previous loop iteration--a proper fix is coming in 3.5.0. Look in the Gallery for a patch module.<br />#2529980: Now creates a new RecordSet for each instance rather than reusing the same one.<br />#2529968: Captions are only added if a value is set for the `caption` attribute.<br />
  25. 25. Data Type<br />Languages are no longer fetch-able for the `datatype-date` module, only for the `datatype-date-format` module:<br />
  26. 26. Drag&Drop<br />#2529889 Example for Delegate Drag and Drop has wrong parameters<br />#2529905 Using DDNodeScroll with DDDelegate causes JS error in Safari<br />#2530050 Incorrect documentation<br />#2530451DragDrop enhancement - ability to use dd with non-node objects.<br />#2530576 change notest needed in history file<br />
  27. 27. Dial<br />Names of 3 configuration attributes have changed: stepsPerRev -> stepsPerRevolution, handleDist -> handleDistance, centerButtonDia -> centerButtonDiameter<br />New configuration attributes: markerDiameter, handleDiameter<br />In addition to setting the Dial by dragging the handle as it was in 3.3.0, Dial now supports setting the value by clicking on the Ring. This does not cross value "wrapping" boundries. For example: If a Dial has 0 degrees = value 0, and the Dial's current handle position is 10 degrees with a value = 10, then a mousedown at 355 degrees will result in a value of 355 not -10. In this case all mousedown events will result in values between 0 and 355. This is within current value "wrapping" boundries. Moving across value wrapping boundaries, must be done by dragging the handle or using the keyboard.<br />Changed the name of class marker-max-min - to - yui3-dial-marker-max-min<br />In 3.3.0, when the user dragged the handle past the min or max, the Marker displayed as red to indicate min/max. When the cursor was released, the marker was no longer displayed. There remained no user feedback indicating max/min. When the keyboard was used to change the value, no min/max indication was displayed, except that the handle stopped moving. In this release, the Marker display state of red remains as long as the Dial is at min/max, regardless of mouse or keyboard use. If you don't want min/max feedback, CSS class yui3-dial-marker-max-min can be overridden.<br />#2530306: When mousedown is used to set its value, Dial now has intuitive handling of different configurations of min, max where stepsPerRevolution is greater than or less than one revolution. <br />
  28. 28. Editor<br />Third release of EditorBase. Considerable work was done on this component, but there are no public tickets associated with the issues that were resolved. This version of EditorBase is the current version being used in the new Yahoo! Mail. It's production stable and ready to be used with the proper skins and GUI.<br />
  29. 29. Escape<br />#2530408: Non-string arguments to `html()` and `regex()` are now coerced to strings.<br />
  30. 30. Event<br />`event-outside` added for "outside" events.<br />Y.Event.define(name) adds name to DOM_EVENTS whitelist. Accepts event name string or array of string names<br />event-hover properly pulls in required module event-mouseenter<br />DOM event subscriptions are now removed and objects cleaned up after last subscription is detached. Same for synthetic events.<br />'key' synthetic event migrated to official synth infrastructure. Now supports delegation.<br />'key' event spec param now supports letters and named keys. E.g. 'enter+ctrl' == '13+ctrl', 'up:a' == 'up:65' and 'A' == '65+shift'<br />
  31. 31. Event<br />Added experimental config YUI({ lazyEventFacade: true }) that triggers a mode for DOM EventFacades in IE8 to use getters to access event properties that involve any calculation, such as and e.currentTarget. Should improve performance.<br />mouseenter and mouseleave events now filter the native event rather than the generated DOMEventFacades for mouseover/out. This results in fewer calls to (, currentTarget, relatedTarget) as well, so should improve performance.<br />#2529464: Added onceAfter(...) method to do a self-detaching after() subscription<br />#2529807: Y.on(type, callback, HTMLElement[], COMPAT) subscriptions to attach to multiple elements in one call now correctly use native DOM elements instead of Nodes for all subscriptions<br />#2530227: Plugged the leaked global GLOBAL_ENV <br />#2530293: Fixed synth architecture to properly resubscribe to synths that use processArgs if the target is not available at the time of subscription<br />
  32. 32. Event-Custom<br />Custom events published from Y no longer bubble by default.<br />
  33. 33. Event-Gestures<br />For flick, reset start time on first move, to handle case where user mousesdown/touchstarts but then doesn't move their finger for 5s leading to inaccurate velocity.<br />
  34. 34. Highlight<br />#2529945: Fixed a bug that resulted in invalid escaped HTML when running a highlighter with an empty needle.<br />#2530529: Fixed an off-by-one bug in which an unhighlighted single char at the end of a highlighted string would be discarded when using `allFold()<br />
  35. 35. History<br />NOTE: The `history-deprecated` module, which was deprecated in YUI 3.2.0, has been removed from the library.<br />HistoryHTML5 now uses the new `window.history.state` property (which showed up in Firefox 4 and the HTML5 spec after YUI 3.3.0 was released) to get the current HTML5 history state.<br />Removed the `enableSessionStorage` config option that was previously used to work around the lack of an HTML5 API for getting the current state.<br />Added a `force` config parameter to History constructors. If set to `true`, a `history:change` event will be fired whenever the URL changes, even if there is no associated state change.<br />#2530305 (Ben Joffe): On a page with a <base> element, replacing a hash-based history state resulted in a broken URL. <br />#2529990: In IE6 and IE7, navigating to a page with a hash state could result in endlessly repeating history:change events. <br />#2530301: In IE6 and IE7, replacing a history state would actually result in a new history entry being added.<br />
  36. 36. ImageLoader<br />Added classNameAction option for ImgGroup. Setting to "enhanced" means that when using className on an <img> element, the src attribute is replaced rather than simply removing the class name<br />
  37. 37. IO<br />#2528240: Added ability to get the configuration of a transaction. <br />#2529314: Instantiable IO. <br />#2529317: IO now uses `event-custom` and event facades. <br />#2529447: Exposed more of the internals of IO for extensibility.<br />#2529553: Fixed IO iframe upload to reset form attributes. <br />#2530023: Add IO support for XHR basic user authentication.<br />#2530091: IO will not send `data` for `GET`, `HEAD` and `DELETE` HTTP methods.<br />#2530494: Fixed issue with IO doubling the URL query-params on a HTTP `GET` request when sending `data` together with form serialization.<br />
  38. 38. JSON<br />#2530295: Remove indirect `eval()`. <br />
  39. 39. JSONP<br />Support added to specify charset or additional attributes to add to the script tag.<br />Success and failure callbacks are no longer executed if the request takes longer than the configured timeout<br />
  40. 40. Loader<br />Added Alias support and flattened the module structure.<br />Alias support: When asking for: "dd" Loader actually asks for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"<br />Better RLS support<br />
  41. 41. Node<br />NOTE:#2529829: The empty() method now always does a recursive purge. <br />Added the getDOMNode() and getDOMNodes() methods to Node and NodeList prototypes. <br />#2529376: The one() method now accepts IDs that begin with a number. <br />#2529908: Bug fix: NodeList show()/hide() methods were broken with Transition.<br />#2529942: Bug fix: Some NodeList array methods were returning incorrectly.<br />
  42. 42. OOP<br />Significant performance improvements for `augment()`.<br />#2530036: `augment()` handled the `whitelist` parameter incorrectly when augmenting a function.<br />
  43. 43. Queue-promote<br />Fixed bug in promote method where the item moved to the head of the queue was wrapped in an array.<br />
  44. 44. Resize<br />#2529992: Allow Resizable nodes be used with DD.Delegate<br />#2530007: [Pull Request] - #2529992 Allow Resizable nodes be used with DD.Delegate<br />
  45. 45. ScrollView<br />Fixed _uiDimensionsChange code which was looking explicitly for the "width" attribute. Just plain wrong.<br />Added vertical paging support.<br />Removed DOMSubtreeModified event listening which was only really kicking in for Webkit and was too heavy handed. User now needs to call syncUI() manually on all browsers, if the content of the scrollview is changed, and may potentially result in dimension changes.<br />Broke out use of transform3d into a seperate method, and added a protected flag, _forceHWTransforms, to allow for customization if required (H/W acceleration related glitches or changing the set of browsers for which we attempt to force it).<br />Created Scrollview-List plugin to add CSS Classnames to immediate <li> elements on scrollview.<br />Fixed incorrect scroll width/height calculations on Chrome 9+, FF when syncUI() [ or _uiDimensionsChange() ] was called when the ScrollView was scrolled over.<br />Protected state flags are now reset if _uiDimensionsChange results in flipped orientation.<br />Use the larger of bb.scrollWidth/Height or cb.scrollWidth/Height, to calculate scroll dimensions to account for FF (which clips cb.scrollWidth) and Chrome/MacOS (which clips bb.scrollWidth when translated even after incorrect scroll calcs above).<br />
  46. 46. TabView<br />#2529830: Now accepts a Node instance for the Tab `content` attribute. <br />
  47. 47. Transition<br />The transition module now conditionally loads transition-timer as needed.<br />Native transitions are now used when possible for Firefox.<br />
  48. 48. Widget<br />Added workaround in destructor for single box widgets (contentBox === boundingBox) Also extracted DOM removal into separate method, which can be overridden if custom widgets don't want rendered DOM removed.<br />Fixed UI_EVENTS js exception when dealing with nested widgets rendered by different Y instances.<br />Fixed UI_EVENTS invoking nested widget listeners more than once (also fixed regression to Parent-Child as a result of this change).<br />Added support for destroy(true) to Widget, which will remove and destroy all child nodes (not just the boundingBox and contentBox) contained within the Widget's boundingBox in order to help control Node cache size over long-running applications. destroy() will maintain its current behavior due to the potentially high run-time cost of destroying all child nodes. Widget developers still need to continue with the best practice of destroying explicit node references they create, in their destructors to support the destroy() case.<br />
  49. 49. Widget-position-align<br />Added "alignOn" attribute which allows the implementer to specify when the widget should be re-aligned. By default, it re-aligns on window resize and scroll.<br />
  50. 50. Widget-stdmod<br />Move attribute event listeners to _renderUIStdMod() method so that setStdModContent() can be called on renderUI()<br />
  51. 51. YQL<br />#2530246: Fixed bug in yql module where options ('opts') were not actually being used. This prevented use YQL calls over SSL, which some tables require.<br />
  52. 52. YUI<br />Added `Y.Array.dedupe()`, which provides an optimized solution for deduping arrays of strings. When you know an array contains only strings, use `dedupe`, since it's faster than `unique`.<br />`Y.Lang.isArray()` now uses the native ES5 `Array.isArray()` method when possible.<br />`Y.Object()` now uses the native ES5 `Object.create()` method when possible.<br />`Y.Object.keys()` now uses the native ES5 `Object.keys()` method when possible.<br />
  53. 53. YUI<br />#2530376: Sparse arrays are now handled correctly in the non-native fallback implementations of `Y.Array.each`, `Y.Array.hash`, and `Y.Array.some`.<br />Added async:true support to Get, to dispatch scripts/link nodes in parallel. NOTE: Order of execution is not guaranteed (it's not required for the YUI Module use case, for which this feature was introduced - to improve performance). onSuccess is called once, after all files are loaded.<br />Added onProgress callback support to Get, which is useful when dispatching multiple scripts using the [] syntax. onProgress is called when each script is done loading in non-browser environments.<br />
  54. 54. YUI throttle<br />Initial release. Removed from yui-core and bumped to a stand alone module.<br />
  55. 55. End<br />