AkifumiSato / esbuild-jest-transform

14 stars 9 forks source link

What is relation of this package to esbuild-jest and jest-esbuild? #8

Closed gustawdaniel closed 1 year ago

gustawdaniel commented 1 year ago

Description

There are three packages: https://www.npmjs.com/package/jest-esbuild https://www.npmjs.com/package/esbuild-jest https://www.npmjs.com/package/esbuild-jest-transform

None of them not mentions about relations to each other. Can you explain me history?

You can see there: https://npmtrends.com/esbuild-jest-vs-esbuild-jest-transform-vs-jest-esbuild

that esbuild-jest was created as first and is most popular.

Why do you created esbuild-jest-transform and how can you refer to biggest competitor esbuild-jest? Why this one is better or wich problems solves?

Suggested solution

I propose to add response to this question to README

Alternative

I this package is worse that esbuild-jest and there is no chance to change this state I suggest mark this package as depreciated and recommend users to migrate to esbuild-jest

Connected issue: https://github.com/hannoeru/jest-esbuild/issues/7

allomov commented 1 year ago

These tools are independent implementations. There is no "industry standard" for esbuild transformers for jest, and everyone is free to choose his preferred solution. I switched from esbuild-jest to esbuild-jest-transform because of its minimalistic design, making it much easier to understand and support. At the same time, esbuild-jest has several dependencies and solutions that are unnecessary for me (for instance, https://github.com/aelbore/esbuild-jest/issues/80). Probably esbuild-jest has better marketing and was mentioned in some articles that have a higher ranking in google.

Still, there are jest/esbuilt issues that both tools can't resolve: for instance, you'll have an issue by adding plugins esbuild config option because jest won't support it in async mode. Here is a description of the issue with no answer (yet). Still, in the case of esbuild-jest there is no way to pass such an option.

gustawdaniel commented 1 year ago

Thanks @allomov for this explanation.