use standard polyfills (only tested with esm)

This commit is contained in:
jfh
2020-08-09 18:33:17 +02:00
parent ff98330ddf
commit 842f59b6c1
21 changed files with 57243 additions and 3282 deletions

View File

@@ -7,8 +7,6 @@
* @copyright 2013 Jo Segaert
*
*/
// Todo: Wait for Mathjax 3.0 to get ES Module/avoid global
import {importScript} from '../../external/dynamic-import-polyfill/importModule.js';
export default {
name: 'mathjax',
@@ -204,7 +202,8 @@ export default {
// We use `extIconsPath` here for now as it does not vary with
// the modular type as does `extPath`
try {
await importScript(svgEditor.curConfig.extIconsPath + mathjaxSrcSecure);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
await import(svgEditor.curConfig.extIconsPath + mathjaxSrcSecure);
// When MathJax is loaded get the div where the math will be rendered.
MathJax.Hub.queue.Push(function () {
math = MathJax.Hub.getAllJax('#mathjax_creator')[0];

View File

@@ -23,19 +23,9 @@
<script src="jquery.min.js"></script>
<!--{endif}-->
<!-- Lacking browser support -->
<script nomodule="" src="redirect-on-no-module-support.js"></script>
<script type="module" src="redirect-on-lacking-support.js"></script>
<!-- As yet no ES6 Module support -->
<script src="jquery-ui/jquery-ui-1.8.17.custom.min.js"></script>
<!-- Browser polyfills -->
<script src="../external/dom-polyfill/dom-polyfill.js"></script>
<!-- ES6+ polyfills (Babel) -->
<script src="../external/core-js-bundle/minified.js"></script>
<script src="../external/regenerator-runtime/runtime.js"></script>
<!-- If you do not wish to add extensions by URL, you can add calls
within the following file to svgEditor.setConfig -->

19709
dist/editor/index-iife.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -23,19 +23,9 @@
<script src="jquery.min.js"></script>
<!--{endif}-->
<!-- Lacking browser support -->
<script nomodule="" src="redirect-on-no-module-support.js"></script>
<script type="module" src="redirect-on-lacking-support.js"></script>
<!-- As yet no ES6 Module support -->
<script src="jquery-ui/jquery-ui-1.8.17.custom.min.js"></script>
<!-- Browser polyfills -->
<script src="../external/dom-polyfill/dom-polyfill.js"></script>
<!-- ES6+ polyfills (Babel) -->
<script src="../external/core-js-bundle/minified.js"></script>
<script src="../external/regenerator-runtime/runtime.js"></script>
<!-- If you do not wish to add extensions by URL, you can add calls
within the following file to svgEditor.setConfig -->

19709
dist/editor/index-umd.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -23,19 +23,9 @@
<script src="jquery.min.js"></script>
<!--{endif}-->
<!-- Lacking browser support -->
<script nomodule="" src="redirect-on-no-module-support.js"></script>
<script type="module" src="redirect-on-lacking-support.js"></script>
<!-- As yet no ES6 Module support -->
<script src="jquery-ui/jquery-ui-1.8.17.custom.min.js"></script>
<!-- Browser polyfills -->
<script src="../external/dom-polyfill/dom-polyfill.js"></script>
<!-- ES6+ polyfills (Babel) -->
<script src="../external/core-js-bundle/minified.js"></script>
<script src="../external/regenerator-runtime/runtime.js"></script>
<!-- If you do not wish to add extensions by URL, you can add calls
within the following file to svgEditor.setConfig -->

19710
dist/editor/index.js vendored

File diff suppressed because it is too large Load Diff

1
dist/editor/index.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -24,8 +24,6 @@
* @typedef {PlainObject<string, string>} module:locale.LocaleSelectorValue
*/
import {importSetGlobalDefault} from '../../external/dynamic-import-polyfill/importModule.js';
const $ = jQuery;
let langParam;
@@ -388,11 +386,7 @@ export const putLocale = async function (givenParam, goodLangs, conf) {
}
const url = conf.langPath + 'lang.' + langParam + '.js';
return readLang(
// Todo: Replace this with `return import(url);` when
// `import()` widely supported
await importSetGlobalDefault(url, {
global: 'svgEditorLang_' + langParam.replace(/-/g, '_')
})
);
// eslint-disable-next-line node/no-unsupported-features/es-syntax
const module = await import(url);
return readLang(module.default);
};