WooCommerce Forks select2, Releases selectWoo as a Drop-In Replacement with Improved Accessibility

The WooCommerce development team has forked select2 to create a more accessible, drop-in replacement library called selectWoo. select2 is a widely used jQuery-based library for making custom drop down menus. Many users are wondering if the project has been abandoned, because the repository hasn’t seen any activity since February and 115 pull requests have piled up.

In the interest of fixing some long-standing accessibility issues with the library, WooCommerce opted to fork it and has merged in some of the PRs that were submitted to the original project. SelectWoo is backwards-compatible and can be used the same way as select2 by simply replacing the select2.js file. It has been optimized for WordPress plugin development and can optionally be initialized with .selectWoo() in order to run alongside other versions of select2 that may be used by other plugins on the site.

SelectWoo makes many improvements for those who are using screen readers, but it needs more accessibility testing. Beta 1 is availabe on GitHub. The WooCommerce team has even created a testing page with different example pages so those using screen-reading software can easily test for bugs.

Forking is usually a last resort scenario for extending popular open source libraries, but the WooCommerce team wanted the flexibility of improving the project on their own timeline. One concerned developer asked the team what will happen in the future if select2 gets back on track and why they didn’t just submit pull requests to the select2 repository.

“With a fork we can at least get things merged in to meet our own schedule, rather than waiting/relying on others or running custom versions,” WooCommerce lead developer Mike Jolley said. “There are other benefits, too, such as allowing our version to be namespaced to avoid conflicts in WP admin. The fork is public. Our changes can be merged back, when/if the project picks up again.”

Both WordPress and Drupal core contributors have been working to address accessibility issues in select2 since 2015 when the WP Accessibility Team performed extensive testing on the library to see if it was fit for use in core. Some initial planning work happened but work on these issues stalled out as select2’s maintainers became unavailable.

“I’d do it with PRs if I thought they would get merged in, but I doubt they will,” WooCommerce developer Claudiu Lodromanean said. “There’s been no action in this repo in about six months and the fork contains some PRs that have been waiting to get merged here for a very long time.”

Forking a project can needlessly fragment its contributors by causing them to have to choose one or the other, especially as the projects diverge down the line. Motivated contributors may submit multiple PRs across both projects for improvements but most will simply contribute back to the project they use. Select2’s maintainers have not published any news about why the project has gone dormant.

“There are over 100 PRs in the select2 repo unmerged,” Jolley said in response to commenters asking about the necessity of the fork. “Some of these we actually need, so with the fork we’re free to merge these as needed. The accessibility issues are hurting users today, so we cannot really afford to wait.”

9 Comments


  1. Search/Replace WooCommerce with Automattic.
    I’m surprised they left the license as MIT. Better switch it before Matt finds out.

    Report


    1. They probably didn’t touch the license so it could be a true “drop-in replacement”.

      Report


      1. They’ve switched licenses on other things they have forked.

        Report


  2. Forking is usually a last resort scenario for extending popular open source libraries, but the WooCommerce team wanted the flexibility of improving the project on their own timeline.

    Funny enough, WooCommerce itself was a fork of a popular WordPress e-commerce plugin. This team likes to take things into their own hands.

    Report


    1. As a long-time follower of the open accessibility issue on the Select2 repo, my understanding was that there was little confidence that Select2 might adopt the changes WC introduced in selectWoo simply due to a pattern of inactivity for ~6 months.

      WC didn’t fork it willy nilly, they forked it because it was the only way they could ensure the a11y improvements could become widely available.

      Report


  3. I don’t see any problem with that as long as WooCommerce team improves the library. I hope it goes well, so we can have a stable library to use inside WordPress.

    Report


  4. Considering the recently released ACF v5.6.0 has fully adopted Select2 v4 for example, I hope I’m wrong but I wouldn’t be all that surprised if this SelectWoo fork does not always play nice with the official Select2 library in ACF and other plugins. However, Woocommerce will likely also be the 800 pound gorilla in the room when conflicts arise with other most plugins so it will get it’s way. Yeah for WP Select2 fragmentation too!

    Report

Comments are closed.