RE: ARIA APG - Vanilla JavaScript

I use a lot of these examples as test cases, to make the browser better.  Using jquery makes them less useful for that, because it hides differences between browsers.  Because of this, I would prefer vanilla javascript examples, with descriptions of expected API and AT behavior.

From: Matthew King [mailto:mattking@us.ibm.com]
Sent: Thursday, March 26, 2015 5:48 AM
To: lwatson@paciellogroup.com
Cc: 'Ian Pouncey'; 'WAI Protocols & Formats'
Subject: Re: ARIA APG - Vanilla JavaScript

Léonie, thank you for this well researched note. I agree that we should revisit this decision.

However, I want to clarify the prior taskforce decision. It was not that all examples would use jQuery but rather that utilizing jQuery in examples for the 2 main purposes you cited is acceptable.

I am very interested in hearing view points from people on this list who are not regular participants in the APG taskforce calls. And, to set the context for feedback, in the new APG, the examples take on much greater importance. The current APG TF is making the patterns and examples of those patterns the main feature or core of the APG. We believe that is how most members of the APG audience want to learn what the APG has to offer. So, the decision of whether or not to permit the use of JS libraries in the APG examples is very important.

Matt King
IBM Senior Technical Staff Member
I/T Chief Accessibility Strategist
IBM BT/CIO - Global Workforce and Web Process Enablement
Phone: (503) 578-2329, Tie line: 731-7398
mattking@us.ibm.com<mailto:mattking@us.ibm.com>



From:        Léonie Watson <lwatson@paciellogroup.com<mailto:lwatson@paciellogroup.com>>
To:        "'WAI Protocols & Formats'" <public-pfwg@w3.org<mailto:public-pfwg@w3.org>>,
Cc:        "'Ian Pouncey'" <ian@ipouncey.co.uk<mailto:ian@ipouncey.co.uk>>
Date:        03/26/2015 04: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 21:20:41 UTC