Open Aslemammad opened 2 years ago
Neat 👍
@Aslemammad es-module-lexer has a wasm build. So I think we can use it to write a SWC plugin? Looks like SWC supports Wasm.
When using es-module-lexer
, the Telefunc transfomer is just string concatenation, so it should be easy to implement that SWC plugin.
Very much looking forward to having first class support for Next 13's dev --turbo
. Turbopack looks real neat.
Let me know what you think!
(Hope things are well on your side 😊.)
I'd like to deliver this, but now, there's no way to identify which phase of the bundling we are in (Server or Client) in SWC/Next since we need this to differentiate between different telefunc builds. If you think this is possible, let me know.
Good point. I'll have a look at it.
Looking at current SWC plugins (swc-project/plugins) I couldn't find any client/server discrimination so far.
I wonder what get_context() returns? Maybe the info whether the code is being transformed for the client/server is in there.
There is also get_experimental_context() and get_raw_experimental_context() but I don't know what the difference with get_context()
is.
Idea: Next 12.2
Just an issue for creating the plugin, I'm going to work on this!