threads.js icon indicating copy to clipboard operation
threads.js copied to clipboard

Generate modern output for dist-esm

Open aminya opened this issue 4 years ago โ€ข 11 comments

aminya avatar Mar 27 '21 15:03 aminya

Not sure if esnext is maybe a bit much as it's a moving target. Any reason not to target a specific language version, like es2020?

andywer avatar Mar 27 '21 17:03 andywer

Not sure if esnext is maybe a bit much as it's a moving target. Any reason not to target a specific language version, like es2020?

That's exactly the beauty of it. EsNext is always the latest JavaScript, and people who want to run the code on a fixed target will use Babel.

aminya avatar Mar 27 '21 18:03 aminya

Yes, but my point is that this is a library and this configuration determines what we ship to the user. So what are we going to tell the users what minimum ES spec their tool stack needs to support, so that using threads.js won't kill their build?

We would need to tell all users to always make sure that the tools they are using need to support whatever is the bleeding edge in that moment in order to use threads.jsโ€ฆ

andywer avatar Mar 27 '21 18:03 andywer

The CI errors are fixed in #351

aminya avatar Mar 27 '21 18:03 aminya

Thanks so much for your help, @aminya! ๐Ÿฅณ

PS: Please always share your view on things if you don't agree with me. Not sure what your current thoughts on ESNext vs ES2020 are, but it's important to me personally to have someone challenge what I write here. That kind of feedback is always appreciated ๐Ÿ˜‰

andywer avatar Mar 27 '21 19:03 andywer

Thank you for your attention!

Both work for me, and I don't have a strong opinion. Personally, I think of dist-esm as a build with the latest JavaScript, and those who opt-in to use it will usually use Babel to transpile it based on their target. But it is also possible to bump this version every year manually.

aminya avatar Mar 28 '21 03:03 aminya

I merged #351. If you rebase (or merge into) this PR, I can merge it, too ๐Ÿ‘

andywer avatar Mar 29 '21 17:03 andywer

I don't think node.js is ok with ES2020 ๐Ÿ˜‰

andywer avatar Mar 29 '21 17:03 andywer

ES2017 is safe. ES2018 is not safe to use with node 10.

andywer avatar Mar 29 '21 17:03 andywer

This error is not thrown from Nodej, but from eprisma which is used in envify which is used in puppet-run.

The point of #351 was to separate the building phase from the testing phase, so we can use the latest JavaScript. It seems all the tools support the latest JavaScript except puppet-run. Do you want to update its envify dependency?

https://github.com/andywer/puppet-run

This fork (@goto-bus-stop/envify) has updated envify: https://github.com/goto-bus-stop/envify

aminya avatar Mar 29 '21 17:03 aminya

Ohh, I see. Just merged and published puppet-run.

Man, you are so quick! Thanks for all your efforts ๐Ÿ‘ ๐Ÿ˜Š

andywer avatar Mar 29 '21 18:03 andywer