CM6 build target

We’re currently in the process of upgrading from 0.17.x to 0.18.x and it seems that as part of the build process change, the ES target has somehow changed.

I’ve checked the tsconfig.json files across the repos and weirdly they were all targeting ES2020 even before the buildhelper change. However, in 0.18.0 using the old building method, ES2020 nullish coalescing (??) was polyfilled, while 0.18.1 they were kept in the code.


((goalColumn !== null && goalColumn !== void 0 ? goalColumn : 33554431 /* NoGoalColumn */) << 5 /* GoalColumnOffset */));


((goalColumn ?? 33554431 /* NoGoalColumn */) << 5 /* GoalColumnOffset */));

Not sure if this was intentional - I’d prefer not to have to run the code through babel just to downgrade this because we still target devices in the 2017-2019 ranges.

I believe the cause was the migration to @codemirror/buildhelper used to build the dist between state 0.18.0 and 0.18.1 (Commits · codemirror/state · GitHub):

1 Like

Ah now I see it. The old build files had "target": "es6", whereas buildhelper now targets target: "es2020"

Thank you for the pull request: make buildhelper compatible with previous tsconfig by BrianHung · Pull Request #1 · codemirror/buildhelper · GitHub