Closed himself65 closed 9 months ago
It would be super nice if we can remove our hack: https://github.com/dai-shi/waku/blob/34188f0965d8f4ec48163aec480f54f6fc36e9b5/src/lib/vite-plugin/rsc-transform-plugin.ts#L40-L44
@huozhi and I have created a standalone rollup plugin rollup-swc-preserve-directives
for collecting and prepend directives (swc
is only used for parsing, while the magic-string
does the rest transformation).
It would be super nice if we can remove our hack:
The directives usually stay at the top of the file. It seems that in the context of the waku, this convention is not followed. Would you like to share more information about this?
Would you like to share more information about this?
As far as I remember, react plugin adds import statement for jsx. Maybe, it's out of the scope of your lib.
I think we don't have such warning now
We could use a good library to handle this.
https://github.com/SukkaW/rollup-plugin-swc/tree/0.9.0#react-server-component-directives-use-client-and-use-server