blitz-js / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
MIT License
3.88k stars 83 forks source link

`babel-plugin-superjson-next`: it should target ES2015 like Next.js default #148

Open baptisteArno opened 2 years ago

baptisteArno commented 2 years ago

Hi!

It looks like the produced file is not ES2015 code. Any way I can enable this?

Shouldn't be the default behavior as Next.js is targetting ES2015 by default?

Skn0tt commented 2 years ago

Hi @baptisteArno! SuperJSON can be (and is) used outside of Next.js, which is why we need to be careful around such changes. Could you elaborate / share a link on the implications of targeting ES2015? What are the improvements that would bring?

baptisteArno commented 2 years ago

Sure I understand, it basically allows targeting IE11 browser.

So, no option to do this as of now?

Skn0tt commented 2 years ago

No, there's no way for you to change the build output for SuperJSON locally. I could definitely see us moving to ES2015 output, if there are considerable improvements in that. If it does nothing but remove IE11 support, that'd be a net-negative.