BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

Upgrade to codemirror 6

Open ssddanbrown opened this issue 3 years ago • 0 comments

PR to track upgrade from Codemirror 5 to 6. Quite a large change.

Closes #3518

References

Progress Report

Got a lot of fundamentals in place but concerned about the growth of complexity here.

Specifically:

  • The growth of bundle size, might need to do finer splitting.
  • The complex requirements of a theme. They're really designed to be bundled. Here's an example of an external theme. Don't think we can just define a string and import global JS like before. We could pass all required dependencies through a configure event but the theme implementation will probably be quite custom to BookStack. Or can we provide a simpler abstraction?

Probable going to progress this slowly across a number of months, to understand codemirror rate of change and to gain some perspectives on best approach.

Todo

  • [x] Add system to handle languages using old map keys.
  • [x] Fix missing languages (commented out)
  • [x] Use new lang packages where available
  • [ ] Test activation of each language available.
  • [ ] Understand themeing, and assess existing use/docs mention of window.codeTheme.
  • [ ] Markdown editor shortcuts.
  • [ ] Markdown editor events.
  • [ ] Add back support for the copy-icon popup buttony thingy.
  • [ ] Test support of PHP blocks without starting php tag and mixed content.
  • [ ] Dark mode support
  • [ ] Cross-browser testing

ssddanbrown avatar Aug 02 '22 19:08 ssddanbrown