quailjs / quail

Accessibility testing in the browser and on the server.
http://quailjs.org
Other
300 stars 44 forks source link

Better modularization for Quail #366

Closed mlewand closed 8 years ago

mlewand commented 9 years ago

The code must be better split into modules to enhance separation of concerns, testability and maintainability. Additionally, this will make the code easier to understand, more likely to attract new contributors.

Right now we have a lot of stuff packed into main Quail object.

Quail object

Instead we'd like to extract these things to a dedicated modules, so that Quail represents only app and works on abstracted components, hiding all the implementation details in proper types.

Utilities

Methods like isDataTable should simply go to quail.utils.tables.isDataTable, containsReadableText to quail.utils.element.containsReadableText.

Selectors

I'd say that selectors definitely deserve their own namespace, so they would simply be grouped in quail.selectors.

Low Level Stuff

Low level implementation (fetching jsons, assigning assessments) should be implemented in their relevant types.

jessebeach commented 9 years ago

Yup, I'm totally on board for this.

I'd like to introduce the Babel compiler to the build process so we can use its module architecture (among other goodies): https://babeljs.io/

mlewand commented 9 years ago

It would be sweet to use some ES6 goodies with Babel, so it's great idea. Would you create a separate issue for it? So we won't forget it.

jessebeach commented 9 years ago

An update.

Selenium conversion work is done. I'm now moving the master branch over to a babel/browserify architecture that will allow us to build customized quail versions with targeted build scripts:

https://github.com/quailjs/quail/pull/380/files

jessebeach commented 9 years ago

I just committed the babelify branch to master. This moves Quail into a module structure.

I'm beginning work now on a configurable build that will allow an author to define a version of Quail with only the tests that are needed.

jessebeach commented 8 years ago

I've pulled Quail apart into modules that can be built together using a script.

https://github.com/quailjs/quail/pull/386

We'll continue to refine this, but we should now be able to put together a custom build for CKEditor.