Unify loading Monaco
At the moment we have two ways of loading Monaco:
- the modern one, where we explicitly import
monaco
in the modules requiring it, and - the legacy one where some modules assume
monaco
to be a global object living in the global namespace.
The second approach was the default one previously. After upgrading Moanco in %14.1 the default way of adding Monaco is to explicitly import it where needed. During the upgrade, to support the existing use cases, we have introduced the globalAPI: true
option for the MonacoWebpackPlugin which does put monaco in the global namespace as well.
So, technically, now we can face (and it seems like we do face) the conflicts when two versions of Monaco are available at the same time (one explicitly imported and another one from the global namespace) which might lead to all sorts of potential conflicts and race conditions.
This issue aims at solving the problem by:
- switching all use cases to explicitly import
monaco
- remove the
globalAPI: true
"hack" from the webpack configuration