Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telefunc with SWC #30

Open
Aslemammad opened this issue Jun 28, 2022 · 5 comments
Open

Telefunc with SWC #30

Aslemammad opened this issue Jun 28, 2022 · 5 comments
Labels
enhancement ✨ New feature or request low-prio 🐌

Comments

@Aslemammad
Copy link
Contributor

Idea: Next 12.2

Just an issue for creating the plugin, I'm going to work on this!

@brillout
Copy link
Owner

Neat 👍

@Aslemammad Aslemammad mentioned this issue Jul 14, 2022
@brillout brillout added the enhancement ✨ New feature or request label Oct 24, 2022
@brillout
Copy link
Owner

@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 😊.)

@Aslemammad
Copy link
Contributor Author

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.

@brillout
Copy link
Owner

Good point. I'll have a look at it.

@brillout
Copy link
Owner

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.

Also: swc-project/plugins#102.

@brillout brillout changed the title Telefunc in SWC Telefunc with SWC Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request low-prio 🐌
Projects
None yet
Development

No branches or pull requests

2 participants