Skip to content

feat: replace ts-node with tsx, remove autoCompileOpts#12752

Merged
christian-bromann merged 23 commits intowebdriverio:mainfrom
goosewobbler:sm/replace-ts-node
May 8, 2024
Merged

feat: replace ts-node with tsx, remove autoCompileOpts#12752
christian-bromann merged 23 commits intowebdriverio:mainfrom
goosewobbler:sm/replace-ts-node

Conversation

@goosewobbler
Copy link
Contributor

@goosewobbler goosewobbler commented Apr 25, 2024

Proposed changes

Removing ts-node and replacing it with tsx.

This also removes autoCompileOpts from the wdio configuration, replacing it with a tsConfigPath option for providing a custom tsconfig.

Closes #11878

TODO:

  • ESM loader syntax switching based on node version
  • Tests
  • Manual test CLI setup
  • Docs

Types of changes

  • Polish (an improvement for an existing feature)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

Backport Request

  • This change is solely for v9 and doesn't need to be back-ported
  • Back-ported PR at #XXXXX

Further comments

Reviewers: @webdriverio/project-committers

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for taking a stab at this. I have two questions based on the changes. Let me know when I can make a full review.

@goosewobbler
Copy link
Contributor Author

goosewobbler commented Apr 27, 2024

Getting there, close to looking at docs. I'm not sure what to do about this ts-node reference in wdio-cucumber-framework, is this requireModule just to be left in there and add a tsx example into the comment?

@christian-bromann
Copy link
Member

@goosewobbler the user doesn't really need this option since WebdriverIO takes care of compiling any TypeScript code. Feel free to just leave as is.

@goosewobbler
Copy link
Contributor Author

goosewobbler commented Apr 29, 2024

I took a stab at the docs -- presumably the i18n files need to be updated too.

@christian-bromann
Copy link
Member

presumably the i18n files need to be updated too.

Don't worry about these, we do this through a different platform.

@goosewobbler goosewobbler marked this pull request as ready for review April 29, 2024 18:04
@goosewobbler goosewobbler marked this pull request as draft April 29, 2024 19:46
@goosewobbler
Copy link
Contributor Author

goosewobbler commented Apr 29, 2024

Still some more to do here, I tried to run some tests locally and the ConfigParser is failing to handle the TS file...

EDIT: found the culprit, we're exclusively using the ESM loader for tsx.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also update the TypeScript docs: https://webdriver.io/docs/typescript ?

@christian-bromann
Copy link
Member

I will hopefully be able to take a close look over the weekend.

@christian-bromann christian-bromann added this to the v9 milestone May 8, 2024
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work 🎉

@christian-bromann christian-bromann merged commit 963ddb9 into webdriverio:main May 8, 2024
@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label May 8, 2024
@wdio-bot
Copy link
Contributor

wdio-bot commented May 8, 2024

Hey goosewobbler 👋

Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. Please make sure to check your spam folder as well. If you have any questions, feel free to reach out to us at expense@webdriver.io or in the contributing channel on Discord.

We are looking forward to more contributions from you in the future 🙌

Have a nice day,
The WebdriverIO Team 🤖

@0xbuidler
Copy link

Hey @christian-bromann has this been released in prod ? I cannot find tsConfigPath in Options.Testrunner ?

@goosewobbler
Copy link
Contributor Author

@sshmaxime it's in v9 which hasn't been released yet. You can try pre-release builds by using the next tag instead of latest.

@christian-bromann
Copy link
Member

Our v9 release is planned for August 15th.

@0xbuidler
Copy link

Ohhh sweet ! Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Expensable $150 💸 PR: Polish 💅 PRs that contain improvements on existing features v9

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[💡 Feature]: Replace ts-node with tsx

4 participants