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

SWC support #622

Open
oreqizer opened this issue Jun 29, 2022 · 8 comments
Open

SWC support #622

oreqizer opened this issue Jun 29, 2022 · 8 comments

Comments

@oreqizer
Copy link

Will there be a SWC support?

@hwillson
Copy link
Member

hwillson commented Jul 1, 2022

@oreqizer can you provide more details around what isn't currently working with SWC?

@oreqizer
Copy link
Author

oreqizer commented Jul 2, 2022

I meant if there is a SWC plugin planned with functionality like babel-plugin-graphql-tag, that it will be preprocessing them queries to ASTs

@Gyv4ik
Copy link

Gyv4ik commented Sep 1, 2022

Are there any updates? My team uses NextJS + Apollo and SWC support blocks us from migrating the app from Babel to SWC.

@lhguerra
Copy link

lhguerra commented May 8, 2023

+1 on the next limitation

@Enalmada
Copy link

Enalmada commented Jun 11, 2023

I just learned about this when I added a .babelrc file to my next.js project as documented and saw this in my console

- info Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled

There seems to be a way to force swc on but I assume this isn't going to be compatible with babel-plugin-graphql-tag

module.exports = {
  experimental: {
    forceSwcTransforms: true,
  },
}

What is involved to get babel-plugin-graphql-tag swc compatible with next.js?

I also see this which might be the solution. I am so new to swc though I have no idea how to use it.
https://github.com/rishabh3112/graphql-tag-swc-plugin

@lhguerra
Copy link

As far as I know you can't use SWC and Babel at the same time with Next, so both this force option and the plugin feel weird

@rishabh3112
Copy link

rishabh3112 commented Nov 27, 2023

the plugin feel weird

🥲

@rishabh3112
Copy link

@Enalmada @lhguerra I think I have added majority of features needed for this, can you check this now?
https://www.npmjs.com/package/graphql-tag-swc-plugin?activeTab=readme
https://github.com/rishabh3112/graphql-tag-swc-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants