benchmarks icon indicating copy to clipboard operation
benchmarks copied to clipboard

Add support to ESM

Open RafaelGSS opened this issue 2 years ago • 3 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Frequently modules are dropping support to CommonJS and in order to keep it up to date, we should support the ESM as soon as possible

Motivation

https://github.com/fastify/benchmarks/pull/216

Example

No response

RafaelGSS avatar Dec 26 '21 02:12 RafaelGSS

I rather just remove the offending modules.

jsumners avatar Dec 27 '21 18:12 jsumners

I rather just remove the offending modules.

What's wrong with keeping things up-to-date and dropping legacy supports ?? Just curious to know what's the pain point in adding support to ESM. If possible, what could be the strategy and how can I help to bring this upgrade ??

ikmrgrv avatar Apr 12 '22 05:04 ikmrgrv

  1. CJS isn't "legacy"
  2. ESM does not work the same way
  3. ESM is not instrumentable

jsumners avatar Apr 12 '22 11:04 jsumners

There are limitations in interoperability, while ESM can import CJS, CJS cannot require ESM, because it would break the synchronous constraint.

If this is still true, one may want to reconsider. Currently Fastify works just fine in my ESM project.

Turbine1991 avatar Dec 13 '22 23:12 Turbine1991