Skip to content

Migrate testing to Vitest - #154

Closed
AFCMS wants to merge 4 commits into
preactjs:mainfrom
AFCMS:vitest
Closed

AFCMS wants to merge 4 commits into
preactjs:mainfrom
AFCMS:vitest

Conversation

@AFCMS

@AFCMS AFCMS commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

I think it makes sense considering that preact and @preact/signals are on Vitest too.

It also reduces considerably the amount of dependencies (including some unmaintained ones).

  • uvu, 2022
  • kleur, 2022, replaced by ansis (maintained, much lighter)
  • htm, 2022, replaced by native Vitest JSX transform

@rschristian

Copy link
Copy Markdown
Member

Sorry, not interested in Vitest.

@rschristian rschristian closed this Jul 1, 2026
@AFCMS

AFCMS commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, not interested in Vitest.

May I ask why? If it is used in the main preact repo I don't understand why it wouldn't make sense in other official packages.

@rschristian

rschristian commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

I'm not happy with it being used in the Preact repo (or anything else in the org) either FWIW.

The tool is objectively slower than our current/past tools, IMO is being developed the complete wrong direction, but most importantly, it barely runs on my machine (Preact repo switches between taking 3 minutes or cyclically crashing, depending on Vitest version -- it's unusable). I've unfortunately had to all but stop contributing to the main repo because of that switch.

As the main maintainer here, I'm going to veto.

Edit: uvu, kleur, and htm are developed by us/a friend. Finished software isn't a problem.

@rschristian

Copy link
Copy Markdown
Member

Hey, apologies if my responses to this & #153 were curt, tooling & security measures are just two items that I think are better left to the core team (which we do discuss, from time to time) as there's a lot of history, preferences, and risk involved in touching both. Judging by the emoji reactions, you disagree with this, but I would like to assure you it's nothing against you in particular and work is still appreciated.

Especially in regards to actions hashes, we want to keep everyone safe and allowing third-party changes opens us up to honest mistakes (by us or the external contributor), as well as malicious actors, but in either situation, I'd want the blame to fall solely on us if things go wrong. I don't want an honest contributor to get hate because of any mistake that leads to a vulnerability (recent ecosystem issues have lead to some upset users sending hate messages/conspiracy theories to maintainers and contributors alike). I'd sleep better knowing hate mail was directed at me for my mistake rather than me & another innocent contributor, if that makes sense.

Contributions are certainly appreciated & welcome across the org; the issue & reproductions as part of #151, along with the fix in #152 that I wouldn't have been able to get to until a week from now at best , were very helpful.

@AFCMS

AFCMS commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Understandable, it's fine 😅

I wouldn't have opened the PR in the first place if I hadn't see the other Preact projects using Vitest.

Still a bit surprised, Vitest have been a pleasure to work with in every project I made or contributed to, and generally faster than other alternatives I tried (notably Jest).

@rschristian

Copy link
Copy Markdown
Member

Jest is one of the slower ones for sure, but Preact core's previous use of Karma (despite seeing little maintenance for years) was 10-20% faster than Vitest is to this day IIRC. Different scopes and features ofc, but if you don't need it, ideally you don't pay for it

Speed is all comparative in the end I suppose.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants