What is the motivation or rationale behind making Typebox 1.x ESM only? #1392
Replies: 1 comment
-
@shaharkedar Hi, The main reason for going ESM only is because Node 18.x fell out of LTS this year, and 20.x (current LTS) supports ESM resolution from CJS (meaning libraries can publish ESM packages and have them consumed by CJS applications). ESM packages are generally fine consume on newer versions of Node (which is what prompted dropping CJS), but mostly my preference is to only publish for a singular module system, not two, and EcmaScript modules is the Standard, so I just want to publish for that. However, I may still need to retain dual CJS / ESM for the short / medium term as TypeBox has users that are tied to the CJS module system. I am considering options at the moment by may re-add CJS support until the main consumers of TypeBox are able to move away from Node 18.x. Nothing is final yet, but CJS is being considered for V1 just to help ease a transition to ESM. Hope that brings some insight. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Typebox 1.x is currently ESM only. Is there a reason why there's no dual build for Typebox? I read some issues where ESM and CJS were mentioned, but didn't manage to find a clear answer to that.
Beta Was this translation helpful? Give feedback.
All reactions