probot icon indicating copy to clipboard operation
probot copied to clipboard

Support ESM apps

Open AaronDewes opened this issue 2 years ago • 4 comments

Fixes #1684.

This would require Node 14, which is a breaking change, but Node 14 is the oldest still supported LTS version, so I think it's not a problem

AaronDewes avatar May 08 '22 16:05 AaronDewes

The tests work locally, I dont know why they fail on actions

AaronDewes avatar May 08 '22 16:05 AaronDewes

The fail is related to https://github.com/nodejs/node/issues/35889. --experimental-vm-modules is only required in Jest, not when actually using the app. I'm not sure what's the best way to proceed here. Trying to run the different code in the tests defeats the point of the tests

AaronDewes avatar May 08 '22 17:05 AaronDewes

Thanks for looking at this.

I'm no expert on this CJS/ESM stuff, but is it possible to change the tsconfig settings so that you transpile to JavaScript that uses ESM imports instead of the require?

mattwynne avatar May 09 '22 16:05 mattwynne

Yes, that is possible, but would require more major refactoring changes to be native ESM.

I can try to do that, but it could break some apps using probot, it'd require a lot of testing.

AaronDewes avatar May 10 '22 05:05 AaronDewes

Part of #1821.

AaronDewes avatar Nov 10 '23 18:11 AaronDewes