Re: ARIA APG - Vanilla JavaScript

Léonie,

I see a lot of use of JavaScript libraries in products. Providing
accessible examples of non custom menus, sortable tables, and popup dialogs
that work on older browsers is valuable to developers.  And if you can
point me to examples that work on the last three major versions of Chrome,
IE, Firefox and Safari on computer (Windows, linux, Mac) and mobile (iOS,
android) platforms, I would appreciate the link(s).

We have customers that are still on IE8.  We are often required to support
multiple browsers and 3 versions back of each. I would like to see W3C
examples use a commonly used libraries like jQuery (UI) and bootstrap,
especially if they are great examples of proper accessibility and don't
require custom code. If you use all custom code in W3C examples and they
work well on multiple browsers/versions/platforms, I would guess someone
would gather them up and make a library out of them to save other
developers time...

                                                              
                                                              
                    Regards,                     Fred         
                                                              
                   Fred Esch                                  
       Accessibility, Watson Innovations                      
    AARB Complex Visualization Working Group                  
                     Chair                                    
        W3C SVG Accessibility Task Force                      
                   IBM Watson                                 
                                                              
                                                              






From: Léonie Watson <lwatson@paciellogroup.com>
To: "'WAI Protocols & Formats'" <public-pfwg@w3.org>
Cc: "'Ian Pouncey'" <ian@ipouncey.co.uk>
Date: 03/26/2015 07:53 AM
Subject: ARIA APG - Vanilla JavaScript



Hello,

There has been some discussion about whether we should use jQuery or
vanilla JavaScript for the APG 1.1 examples. On the TF call of 2nd February
it was decided we should use jQuery, however neither of the draft examples
we have so far use a JavaScript library at all.

This seems like a good opportunity to revisit the discussion. TLDR: I think
there’s a good case to be made for using vanilla JavaScript and not a
JavaScript library for the APG examples.

jQuery (and other JavaScript libraries) have two main purposes:

      1.       Fix cross-browser JavaScript inconsistencies.
      2.       Provide easy access to features that are complicated to
      write in JavaScript.

Since IE9 the number of cross-browser inconsistencies has reduced
dramatically, and many features of jQuery are now features of JavaScript.
For example, the following things are effectively equivalent:

// jQuery
var getThings = $('#id .class element');

and

// JavaScript
var getThings = document.getQuerySelectorAll('#id .class element');

More examples are available here:
http://youmightnotneedjquery.com/


The use of JavaScript libraries is in decline. jQuery remains the most
popular library in use, but with each new version numbers are diminishing.
Of the 50 million sites using jQuery, only 1.5 million use jQuery 1.9.x,
and 250,000 use jQuery 2.x. jQuery 2.x is used on fewer sites than
MooTools, Script.Aculo.us (last updated in 2010), Prototype, and YUI (no
longer actively maintained) [2].

Several notable websites do not use jQuery (including Facebook, Wikipedia,
YouTube and Yahoo!). Nearly 34% of websites use no large JavaScript library
at all [3].

Example JavaScript (vanilla) can be used in any context (whether a
framework is being used to build an application or not). This means
examples written in JavaScript can be used by anyone.

Using vanilla JavaScript will also make it easier for people to learn the
fundamentals of accessible widget functionality. It might be a little more
verbose to read/write, but it isn’t abstracted into a library – and there
is no requirement for anyone to learn a particular library in order to
understand the examples either.

So in order to maximise usefulness, not place learning overheads on
developers, and in light of the general trend towards no libraries, I think
we should look again  at using vanilla JavaScript for the APG 1.1 examples.

Léonie.

[1] https://www.w3.org/2015/02/02-aria-apg-minutes.html

[2] http://trends.builtwith.com/javascript/javascript-library

[3] http://w3techs.com/technologies/history_overview/javascript_library/all



--
Léonie Watson Senior accessibility engineer, TPG
@LeonieWatson @PacielloGroup PacielloGroup.com

Received on Thursday, 26 March 2015 12:39:45 UTC