mint-metrics / mojito-js-delivery

🧪 Source-controlled JS split testing framework for building and launching A/B tests.
https://mojito.mx/docs/js-delivery-intro
Other
16 stars 30 forks source link

Refactor Utils.domReady for modern browsers #65

Closed kingo55 closed 4 years ago

kingo55 commented 4 years ago

We use DOM Ready quite a bit, but this function has a lot of dead weight to support older versions of IE before DOMContentLoaded existed.

https://github.com/mint-metrics/mojito-js-delivery/blob/master/lib/mojito.js#L1085-L1185

How might we update this for a smaller codebase without needing to support older browsers?

allmywant commented 4 years ago

@kingo55 DOMContentLoaded is a good choice since it's now widely supported.

dapperdrop commented 4 years ago

Agreed. This implementation seems redundant now given we exclude older browsers now for most of the active Mojito containers in the wild.

kingo55 commented 4 years ago

You're right @allmywant - it has very broad compatibility: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event#Browser_compatibility

I don't think we specify target minimum browser support, but supporting down to IE 9 should cover most of our users. People are free to build out their own IE7/8 support if they really want to.

Do you want to take this issue @allmywant ?

allmywant commented 4 years ago

@kingo55 Sure I will do.

kingo55 commented 4 years ago

addressed by #79