<@U01MV4U2EV9> I saw a lot of discussion circulati...
# general
e
@thdxr I saw a lot of discussion circulating around ESM for the TS 4.7 release, and you obviously felt it was worth the pain to switch your codebase over. Could you give us a quick outline of the main reason to switch to ESM for a codebase as you see it?
t
where this all started for me was needing top level await to support SSM loading on function boot outside of that there aren't really direct benefits outside of things feeling more standardized. a lot of stuff under the hood has been cleaned up so there's more predictable behavior when doing things like dynamic imports but the reality is it's just a breaking change we all have to deal with at some point. sooner the better
every line of code, no matter how perfect it is that is in CJS is instantly technical debt
e
thanks
t
oh I guess another benefit is better treeshaking
e
I did wonder about that. Have you noticed any difference in bundle sizes at deploy time?
t
I've always used TS so I already was using import statements so most of those benefits have been around
TS + esbuild you were already getting tree-shaking benefits
e
Good to know 🙂 Just info gathering for my team, basically. We just finished migrating to esbuild in our backend