The version of codemirror we use for Sandcastle is very out of date. Overall CodeMirror is currently on v6 but switching to that could involve a bigger rework of Sandcastle. That said there is a CodeMirror v5 branch that's had small updates. We're currently on 5.52.0 (which is over 4 years old) but that project is up to 5.65.18 the releases between them are primarily bug fixes.
Notably I've noticed that the JS parser in our version of CodeMirror is not able to handle newer JS features like the nullish coalescing operator ?? which the latest version of CodeMirror 5 can handle.
I took 30ish minutes to quickly try this out and updating seems like it's just a drop in replacement and I didn't spot any immediate issues.
Alongside updating CodeMirror we should probably look at JSHint and make it use at least ES2020 so we don't get warnings for newer syntax.
The version of codemirror we use for Sandcastle is very out of date. Overall CodeMirror is currently on v6 but switching to that could involve a bigger rework of Sandcastle. That said there is a CodeMirror v5 branch that's had small updates. We're currently on
5.52.0
(which is over 4 years old) but that project is up to5.65.18
the releases between them are primarily bug fixes.Notably I've noticed that the JS parser in our version of CodeMirror is not able to handle newer JS features like the nullish coalescing operator
??
which the latest version of CodeMirror 5 can handle.I took 30ish minutes to quickly try this out and updating seems like it's just a drop in replacement and I didn't spot any immediate issues.
Alongside updating CodeMirror we should probably look at JSHint and make it use at least ES2020 so we don't get warnings for newer syntax.
It looks like this was the PR the last time we updated, might be useful to reference for processes https://github.com/CesiumGS/cesium/pull/8623. Also https://github.com/CesiumGS/cesium/pull/10220
CC @ggetz