For years, we had a unique external dependency (the only non-dev
dependency) called "next-tick" allowing us to schedule callbacks in
micro-tasks, either to provide asynchronous browser API shims or for
some specific logic where we would prefer to bring some asynchronicity
in without the need of bringing the event loop into this.
We were not too happy having this dependency because the name "nextTick"
didn't ring a bell to most RxPlayer developers who never really worked
with node.JS before, whereas the "microtask" concept is generally more
known and understood in JavaScript environments, or at least is easier
to look for on the internet.
Moreover, now that we consider that a Promise object has to be
accessible globally in the current environment as a precondition to run
the RxPlayer (so IE11 is now only supported as long as `Promise` is
polyfilled by the application, which almost everyone still
supporting that target in a complex media application does anyway) and
that specification-following Promise implementations include a mean
to schedule microtasks, we have a very easy way to provide a shim in
cases where the `queueMicroTask` global function is not already
supported.
So this commit removes the next-tick dependency and replace it by either
the natively-provided `queueMicroTask` function or a Promise-based
ponyfill if not, naming the result `queueMicroTask`, which should be
much more familiar to JS dev and is a simpler implementation than what
`next-tick` provided, we moreover now control.
Its removal also means that now the RxPlayer has no dependency from
an application perspective, which may eliminates some groups of issues
applications sometimes have when doing weird things with their
webpack/vite configs :p
We may still have an issue for Promise implementations which do not
rely on microtasks (or even event loop events, we shouldn't have an
issue with those), but I would expect that the very large majority of
Promise polyfills in use today respect that key part of the spec.