All project notes

Contribution

Faiz Halim on candypixel.js

Replaced jQuery with native browser events for form capture and introduced a Webpack build.

The original CandyPixel script took its own jQuery reference through jQuery.noConflict(true) in 9adbd1b. On 27 August 2019, Faiz replaced the jQuery-based capture code with a browser entry point that used native selection and event listeners. The same revision, 9f1eac9, added a Webpack build from src/app.js to app.js and retained js-cookie for cookie handling.

For a script embedded on customer sites, this changed the integration boundary. The capture code no longer needed a jQuery instance to find a form or attach its handler. Faiz also added retry handling for failed submissions in f16dfb7 and extended test coverage the next day.

From the diff

src/candypixel.js at 9f1eac9 adds a native submit listener and retains the cookie library. These excerpts come from separate parts of the diff.

+const Cookies = require('js-cookie');
+            document.querySelector(pattern).addEventListener('submit', function(event) {

Selected commit log

  • 2019-08-27 · 9f1eac9 · Remove jQuery dependencies and use Webpack
  • 2019-08-27 · f16dfb7 · Add retry submit
  • 2019-08-28 · 0c44688 · Increase coverage