webdriverio-community / wdio-rerun-service

A WebdriverIO service that tracks failing tests and scenarios, allowing failing or unstable tests or scenarios to be re-run.
https://www.npmjs.com/package/wdio-rerun-service
MIT License
11 stars 13 forks source link

Transition package from CJS to ESM #36

Closed christian-bromann closed 1 year ago

christian-bromann commented 2 years ago

As part of the v8 effort we are currently migrating over to ESM as many packages will stop support CJS in the future. This means we have to transition all plugins to ESM as well, ideally with continuous support for CJS.

esaari commented 2 years ago

@christian-bromann we should be able to handle this. When were you aiming to release v8? We would do this as a tentative v.1.8.0.

christian-bromann commented 2 years ago

When were you aiming to release v8?

No ETA for that yet.

christian-bromann commented 2 years ago

Update: my initial assumption that CJS services/reporters would stop working when running WebdriverIO within ESM context is wrong. They continue to work as is without any changes required. However I still suggest to do this ESM transition eventually as dependencies might migrate to ESM and stop working. Given WebdriverIO dynamically imports services and plugins there is no need to build a hybrid package for CJS and ESM. Plugins can just export ESM code and it will work fine for users running CJS and ESM.

esaari commented 2 years ago

@christian-bromann thanks for the info. I think we will still do a 1.8.0 release as pure ESM when we get closer to the v8 release date.

christian-bromann commented 2 years ago

Awesome, just be aware that the release with the ESM transition should happen after the v8 release and you should update the @wdio/cli peer dependency then to ^8.0.0 so that no one with v7 would use the service. I suggest to make this a breaking change.