sfmc-devtools icon indicating copy to clipboard operation
sfmc-devtools copied to clipboard

[TASK] Move to ESM modules

Open DougMidgley opened this issue 3 years ago • 2 comments

Many dependencies are starting to support ESM only modules over CommonJS. This means moving syntax from require to import. https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c ESM modules support both ESM AND CommonJS, but there is some gotacha, including requiring a JSON file isnt possible. The main risk i have seen in the past is affect on FS module, which no longer supports __dirname and workarounds are needed (not major). Ideally some helper methods (instead of just metadata) have test classes added before to help validate if migration affects functionality

DougMidgley avatar Jun 28 '22 21:06 DougMidgley

marking this for the next minor release, after we've gotten 4.0 on the road ;-)

JoernBerkefeld avatar Jun 29 '22 09:06 JoernBerkefeld

Will need to be a major release as this would break anything using commonjs referencing our project. Can be a major release JUST for this, but still needs a major. None the less, agree its a next step, not for v4

DougMidgley avatar Jun 29 '22 15:06 DougMidgley