prefresh icon indicating copy to clipboard operation
prefresh copied to clipboard

Implement SWC plugin

Open nicksrandall opened this issue 1 year ago • 3 comments

I'd like to help port the babel plugin to SWC. Can somebody please explain what the differences are between the react version and the Preact version? I plan to start with the react version (already ported) and make the necessary changes to support Preact.

nicksrandall avatar Feb 27 '23 15:02 nicksrandall

+1 I also would like to se a SWC implementation therefore it would be a lot faster than babel like vite seem to move to SWC as well for the same reasons https://github.com/vitejs/vite-plugin-react-swc/blob/main/src/refresh-runtime.js

Hideman85 avatar Jun 23 '23 15:06 Hideman85

Hey, on the Babel side of things the two transforms are almost identical. The main difference in the Preact one is that we have this part extra to maintain and reset context references correctly

JoviDeCroock avatar Jun 25 '23 08:06 JoviDeCroock

+1

f0am avatar Feb 23 '24 15:02 f0am

A SWC plugin has been implemented at https://github.com/swc-project/plugins/pull/326

colinaaa avatar Jul 15 '24 05:07 colinaaa

It's also published! https://www.npmjs.com/package/@swc/plugin-prefresh

JoviDeCroock avatar Jul 15 '24 07:07 JoviDeCroock