CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.02k stars 3.51k forks source link

Update CodeMirror for Sandcastle #12300

Open jjspace opened 2 weeks ago

jjspace commented 2 weeks ago

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.

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