interaction-kit icon indicating copy to clipboard operation
interaction-kit copied to clipboard

Switch from esbuild to swc

Open IanMitchell opened this issue 3 years ago • 1 comments

From what I've read online, swc is the more appropriate choice here. I need to do some investigation still

IanMitchell avatar Oct 16 '22 04:10 IanMitchell

Pinning this as a good issue for someone who wants to contribute to interaction kit. To accomplish this, look into making the library change in this file: https://github.com/IanMitchell/interaction-kit/blob/main/packages/discord-edge-runner/src/server.ts

Run npm run build at the top level of the interaction kit repo, and then you should be able to use it like this: https://github.com/IanMitchell/interaction-kit/blob/main/packages/interaction-kit/src/cli/dev.ts#L97-L116

You can try and test it through the ikit dev cli, or you can create a temporary test.ts file that imports the server function and throws some hardcoded options / file contents at the server to see if it works. I am happy to describe this step further or help test something if needed as well!

IanMitchell avatar Oct 16 '22 22:10 IanMitchell

Turns out there are several things that would be harder to do with swc that I don't think are worth the speed tradeoffs - watch mode in particular would be difficult. Going to stick with esbuild as a result.

IanMitchell avatar Nov 02 '22 23:11 IanMitchell