Review main Merged Breaking

73466[!!!][TASK] Upgrade to CodeMirror v6

Benjamin Franzke CR +2 V +2 Nightmare +1102 −8403 updated 09/19/22, 09:25

Commit message

CodeMirror v6 is a major rewrite of CodeMirror v5.
Existing addons and language parsers need to be rewritten.
There is a compatibility layer for parsers though, which we
use for our TypoScript parser (which itself is based on
an old CodeMirror javascript parser).

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

The TypoScript code completion code is adapted via a small shim
that calculates the line-oriented token-state from the
CodeMirror v6 syntax tree. Rewriting the code completer (which
also parses the object structure) has not been an option, without
also rewriting the TypoScript syntax highlighter.
Ideally, both the parser and the code completion would be based
on a modern lezer grammar based parser, allowing to perform
code completion on a proper TypoScript syntax tree.

CodeMirror v6 is authored as ES6 modules and can therefore
be integrated into our JavaScript importmap infrastructure,
without bundling.

Note that 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:
`JavaScriptModuleInstruction->create('@my/module.js', 'myExport')->invoke()`
instead of
`JavaScriptModuleInstruction->create('@my/module.js')->invoke('myExport')`.
This is needed to be able to use JavaScriptModuleInstruction's
for CodeMirror v6 function exports.

Commands executed:

  npm remove codemirror
  npm install \
    @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
  npm run build

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Christian Kuhn +1
    • Andreas Kienast +1
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Christian Kuhn +1
    • Andreas Kienast +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 331

Show 311 more files

Review log 3048

Show 1223 earlier messages
  1. Benjamin Franzke uploaded patch set 1 02/14/22, 09:00

  2. Benjamin Franzke wrote 02/14/22, 09:02

    Topic set to esm
  3. core-ci voted on patch set 1 V +1 02/14/22, 09:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23492

  4. Benjamin Franzke uploaded patch set 2 02/16/22, 14:21

  5. core-ci voted on patch set 2 V +1 02/16/22, 14:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23727

  6. Benjamin Franzke uploaded patch set 3 08/17/22, 12:53

  7. core-ci voted on patch set 3 V -1 08/17/22, 13:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30238

  8. Benjamin Franzke uploaded patch set 4 08/17/22, 14:13

  9. core-ci voted on patch set 4 V -1 08/17/22, 14:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30242

  10. Benjamin Franzke uploaded patch set 5 08/18/22, 08:37

  11. core-ci voted on patch set 5 V -1 08/18/22, 08:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30261

  12. Benjamin Franzke uploaded patch set 6 08/18/22, 12:19

  13. core-ci voted on patch set 6 V +1 08/18/22, 12:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30269

  14. Benjamin Franzke uploaded patch set 7 08/18/22, 18:28

  15. core-ci voted on patch set 7 V +1 08/18/22, 18:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30275

  16. Benjamin Franzke uploaded patch set 8 08/18/22, 21:40

  17. core-ci voted on patch set 8 V +1 08/18/22, 21:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30277

  18. Benjamin Franzke uploaded patch set 9 08/18/22, 22:08

  19. core-ci voted on patch set 9 V +1 08/18/22, 22:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30278

  20. Benjamin Franzke uploaded patch set 10 08/18/22, 22:41

  21. core-ci voted on patch set 10 V +1 08/18/22, 22:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30279

  22. Benjamin Franzke uploaded patch set 11 08/18/22, 23:14

  23. core-ci voted on patch set 11 V +1 08/18/22, 23:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30281

  1. Benjamin Franzke uploaded patch set 12 08/23/22, 20:51

  2. Benjamin Franzke uploaded patch set 13 08/23/22, 20:55

  3. core-ci voted on patch set 12 V +1 08/23/22, 20:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30393

  4. core-ci voted on patch set 13 V +1 08/23/22, 21:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30394

  5. Benjamin Franzke uploaded patch set 14 09/15/22, 20:57

  6. core-ci voted on patch set 14 V +1 09/15/22, 21:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31131

  7. Benjamin Franzke uploaded patch set 15 09/16/22, 10:54

  8. core-ci voted on patch set 15 V +1 09/16/22, 11:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31172

  9. Andreas Kienast voted on patch set 15 V +1 09/16/22, 11:39

  10. Benni Mack uploaded patch set 16 09/16/22, 21:40

  11. Benni Mack voted on patch set 16 V +1 CR +1 09/16/22, 21:44

  12. core-ci voted on patch set 16 V +1 09/16/22, 21:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31195

  13. Christian Kuhn commented on patch set 16 09/16/22, 22:02

    impressive! started clicking around on this: styleguide 'elements t3editor' looks a bit funny - seems as if codemirror does not apply line breaks as before. uploaded a screeni in forge to show this.
  14. Benni Mack commented on patch set 16 V 0 CR 0 09/17/22, 07:41

    Yes. Could reproduce (did a review with Lolli together last night).
  15. Benjamin Franzke uploaded patch set 17 09/17/22, 15:54

  16. Benjamin Franzke commented on patch set 17 09/17/22, 15:54

    Reply

    Thanks, that's true. line breaks aren't enabled – not especially on purpose, but I think I'd like to leave them disabled (does anyone use that in normal text editors??), and rather fix the scrollbar issue you mentioned. (btw, I've somehow always overseen the t3editor styleguide testdatasets, therefore this got missed)
  17. core-ci voted on patch set 17 V +1 09/17/22, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31210

  18. Andreas Kienast uploaded patch set 18 09/19/22, 05:44

  19. Andreas Kienast commented on patch set 18 09/19/22, 05:44

    Just a rebase...
  20. core-ci voted on patch set 18 V +1 09/19/22, 05:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31257

  21. Benni Mack commented on patch set 18 V +1 CR +1 09/19/22, 06:24

    solution with the scrolling is okay for me.
  22. Christian Kuhn voted on patch set 18 V +1 CR +1 09/19/22, 07:34

  23. Andreas Kienast voted on patch set 18 V +1 CR +1 09/19/22, 07:44

  24. Benjamin Franzke voted on patch set 18 V +2 CR +2 09/19/22, 08:25

  25. Benjamin Franzke merged patch set 19 09/19/22, 09:25