node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7k stars 680 forks source link

is v3 ESM only? #942

Closed phpbg closed 1 year ago

phpbg commented 1 year ago

Support plan

Context

What problem are you trying to solve?

I am currently on v2 and I wonder wether to update to v3 or not.

My project is still using commonjs, but it seems v3 is ESM only.

Do you have a new or modified API suggestion to solve the problem?

n/a

GrosSacASac commented 1 year ago

Did you read the changelog ?

hannesfant commented 1 year ago

Yes https://github.com/node-formidable/formidable/blob/0179abfb75b586f3115298ee221674b5cb019ab3/CHANGELOG.md?plain=1#L80

I think @GrosSacASac could have said it immediately instead, since it's quite buried in the changelog, and most users don't read it to begin with. Just answering the question immediately would save everyone a lot of time, but that's just my opinion :)

phpbg commented 1 year ago

Hi,

yes, I did read the changelog, but AFAIK the fact that you internally use ESM does not imply that you don't built with commonJS support (sorry i'am not sure about it).

At least I would say it is not quite obvious, and it is not a feature, but a breaking change...

GrosSacASac commented 1 year ago

Is it a good idea to make it work both with commonjs and esmodules ?

phpbg commented 1 year ago

Is it a good idea to make it work both with commonjs and esmodules ?

Well, it depends on your v2 vs v3 strategy.

If you want to promote v3 for everyone, I suggest you make it work for both.

Anyway it would be great to make a clear statement in your readme

GrosSacASac commented 1 year ago

https://github.com/node-formidable/formidable/pull/944

GrosSacASac commented 1 year ago

Published formidable@3.5.0

phpbg commented 1 year ago

Thank you!

I guess I have to move on 3.5+ now ;-)