Review main Abandoned Breaking

75513[WIP][!!!][TASK] Upgrade to CodeMirror v6

Benjamin Franzke CR 0 V 0 Nightmare +739 −8294 updated 08/18/22, 23:14

Commit message

CodeMirror v6 is authored aES6 modules and can therefore
be directly integrated into our JavaScript importmap infrastructure.
This is the last module that used RequireJS and will allow
to deprecate RequireJS in an upcoming patch.

CodeMirror v6 is a major rewrite of codemirror.
Existing addons and language parsers needs to be rewritten.
There is a compatibility layer for parsers though. This
layer is currently used for our typoscript parser
(that itself is based on the old codemirror javascript parser).

A migration to a grammar based lexer (based on codemirror @lezer
infrastructure) would be desirable in future.

Also JavaScript invoke instruction for exported functions are adapted
to allow for empty invoke() JavaScriptModule instructions to call
exported functions as plain function without a `this`-context.
Exported methods must not be called with the ES6 module passed
as this-value/context, as that is forbidden for ES6 module exports.
In other words, use
`JavaScriptModuleInstruction->create('@my/module.js', 'myExport')->invoke()`
instead of `JavaScriptModuleInstruction->create('@my/module.js')->invoke('myExport')`.

TODO:
 * typoscript autocompletion (probably needs a new parser?)

Commands executed:

  yarn remove codemirror
  yarn add \
    @lezer/common \
    @lezer/lr \
    @codemirror/autocomplete \
    @codemirror/commands \
    @codemirror/language \
    @codemirror/lint \
    @codemirror/search \
    @codemirror/state \
    @codemirror/view \
    @codemirror/lang-css \
    @codemirror/lang-html \
    @codemirror/lang-javascript \
    @codemirror/lang-json \
    @codemirror/lang-php \
    @codemirror/lang-sql \
    @codemirror/lang-xml \
    @codemirror/theme-one-dark

Releases: main
Resolves: #96575
Related: #96323
Change-Id: If4a323289144a1212b6fd93ebedd122a62b8052c

TMP

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Files 323

Show 303 more files