alfa icon indicating copy to clipboard operation
alfa copied to clipboard

Lower typescript target to es2019 from es2020

Open dlemvigh opened this issue 3 years ago • 2 comments

alfa-cypress was causing errors due to nullish coalescing operator (??). By lowering the typescript build target to es2019, the issue goes away.

Was able to test it locally, by cloning and building alfa with the lowered build target, and then copy the files to my cypress project.

The first instance of the error is thrown from alfa-css src/value.js. It is therefor not enough to just lower the build target for just alfa-cypress.

Is there any danger for other projects in lowering the build target to es2019?

dlemvigh avatar Nov 28 '22 20:11 dlemvigh

The issue is simililar to this https://github.com/scottohara/loot/issues/185

It isn't directly an issue with alfa-cypress, but a compatibility issue with cypress

dlemvigh avatar Nov 29 '22 11:11 dlemvigh

This should have been fixed in Cypress 13: https://github.com/cypress-io/cypress/pull/27438 Leaving this open until we managed to get a proof of concept of it working.

Jym77 avatar Oct 24 '23 07:10 Jym77

Updating Cypress to version 13 resolves the problem as they now accept more modern ES syntax. See https://github.com/Siteimprove/alfa-examples/pull/39 for a detailed example.

Closing this PR now.

Jym77 avatar Sep 05 '24 12:09 Jym77