Preface
The YUI Library has grown and improved since the first edition of this book. Several components came out of beta or experimental status and most of them will be covered in new chapters or added to related chapters, which will now have more than the two components originally presented.
The coding style has changed and that will be reflected in the examples, which have been modified accordingly.
New developer tools have appeared to make code more reliant, to reduce loading time, to debug, test, and do performance profiling and we will take a look at them.
The biggest change is the release of version 3 of the YUI Library. YUI3 has recently had its first General Availability (GA) release which includes the most basic components, the infrastructure of the whole library. The Widget component, the basis for all the components that will have a User Interface (UI) is still Beta so there are no visual components in GA. YUI3 still has some way to go to achieve the variety of UI components of YUI2 and, above all, the maturity and reliability of its code base. Thus, this book will be based on the current YUI 2.8 release of the library. YUI2 is not dead by any measure; development continues and future releases will come when and if any significant number of changes warrant it.
Loading YUI2 components in YUI3
JavaScript programming is not what it used to be. As we ventured into more complex client-side applications and learned more about the language and the environment it lives in, the programming style has changed. All the examples in the first edition of this book have been updated to the new coding style.
The components in the YUI Library show that same change in style, though some of the original ones now feel aged and the newer ones are more flexible and capable. However, for the sake of the innumerable applications out there, the old components cannot be upgraded as backward compatibility must be preserved. To get out of this tight spot, the YUI team decided to branch off with YUI3, incorporating all the techniques learned over these years. However, YUI3 is not backward compatible with YUI2. Version 2 of the library will still be maintained and upgraded and, in fact, since the two versions branched, there have been as many releases in the YUI2 branch as in the YUI3 branch.
Although YUI3 is a much better programming environment than YUI2 and it has a more consistent and capable interface, it still lacks components such as "widgets", that is, those that have a visual interface. Recently, however, the YUI3 loader (and at this point it is not necessary to go deep into what the loader does) has been enabled to load YUI2 components as well. YUI2 can and regularly does coexist with other non-YUI library components and so does YUI3; there was no reason for them to not coexist with each other. Now, this has been made much easier with the ability of the YUI3 environment to load YUI2 components.
This means two things. First, YUI2 still has a long life. By ensuring that they can run in the YUI3 environment, we can mix and match both versions. All the complex visual components in YUI2 that had no equivalent yet in YUI3 can be used in the YUI3 environment. And second, it means that the YUI team can relax and take their time migrating the YUI2 components, ensuring that when they do get released as YUI3 native, they will be high quality, as per our expectations.
WAI-ARIA
The Web Accessibility Initiative's committee of the World Wide Web Consortium has developed the ARIA (Accessible Rich Internet Application) suite of documents to make the rich applications we can build with YUI accessible to people with disabilities. The degree of support for ARIA is not even across all YUI components. Only components with a visual interface the visitor can interact with need ARIA support. Of those, most YUI components do support ARIA—some have it built-in, others need extra subcomponents, and some do not support ARIA at all. Those that do support ARIA often have a few configuration options, though the defaults rarely need any change. In other words, we as programmers usually don't need to concern ourselves with ARIA besides loading the required subcomponents, if any. We won't cover WAI-ARIA in this book just as we don't cover "beta" components, they are both a work-in-progress with its state still changing and, even when it is available, we rarely need to concern ourselves with it beyond activating it.