Rewrite clientside code to remove jQuery dependency and fix bugs

Created on 15 January 2025, 3 months ago

Problem/Motivation

While trying to fix https://www.drupal.org/project/simple_recaptcha/issues/3197243 and possibly https://www.drupal.org/project/simple_recaptcha/issues/3376636 🐛 Possible racing issue / out-of-order form submission Postponed: needs info I ended up refactoring the clientside code to remove the jQuery dependency. I did this in order to make it easier to diagnose the issue, because to any modern developer jQuery code is strange and unpleasant to work with.

Along the way I fixed these other things:

  • Fix bugs which caused submission failures when using multiple AJAX forms on the same page
  • Simplify the clientside submission and button setup code to remove duplication and follow modern Drupal JS development best practices
  • Move duplicated code for initializing ajax forms which was previously in both simple_recaptcha.js and simple_recaptcha_v3.js into ajax.js
  • Clean up some typos
  • Add form ID to failure messages to make it easier to debug
📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇳🇿New Zealand fraserthompson Dunedin, New Zealand

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024