zikaari / monaco-editor-textmate

MIT License
122 stars 16 forks source link

Compatibility issue #2

Closed paul-marechal closed 6 years ago

paul-marechal commented 6 years ago

When using webpack, your package is bundled with this piece of code:

                    tokens: res.tokens.map(token => ({
                        ...token,
                        // TODO: At the moment, monaco-editor doesn't seem to accept array of scopes
                        scopes: token.scopes[token.scopes.length - 1]
                    })),

But the ...token notation is not working in the Electron renderer, even Firefox (ESR 52.8.1) has trouble with it.

It seems to be only working on Chrome.

zikaari commented 6 years ago

Electron is not always using latest Chromium build.

To get this working, you might wanna use babel and babel-preset-env to compile to lower target, like ES5 or below.

The reason this package is delivered with futuristic syntax is because browsers that don't support this syntax, also don't support WebAssembly (required by monaco-textmate).

paul-marechal commented 6 years ago

The reason this package is delivered with futuristic syntax is because browsers that don't support this syntax, also don't support WebAssembly (required by monaco-textmate).

Indeed. Thanks for the pointer with babel-preset-env.