Skip to content

856 vanilla js

Bengfort requested to merge 856-vanilla-js into main

See also !526 (closed)

Recently the first alpha for bootstrap 5 has been released. One of the most important changes is that they have removed the dependency on jquery. I took that as an opportunity to remove the dependency in our javascript as well. I also used http://youmightnotneedjquery.com/ as a reference.

This does port our code from jquery to vanilla DOM. However, we still depend on jquery because it is a dependency for bootstrap 4 as well as bootstrap-datepicker. So this is only a first step.

Most jquery functions have an equivalent in vanilla javascript. Still, the syntax is different so nearly every line that deals with elements needs to be changed. I somewhat tried to structure the edit history but had to give up at some point because the necessary changes are just too entagled. (Sorry!)

Jquery's event handeling is one of the few areas for which there are still no equivalent functions in vanilla DOM, so I created some helpers under the $$ namespace.

I used some more recent JS/DOM features:

All of these are supported in modern browsers, but not in IE, which is basically EOL at this point. (bootstrap 5 will also drop support for IE).

Edited by Bengfort

Merge request reports