Git Product home page Git Product logo

relay-swc-monorepo's Introduction

This application is pretty close representation of a large, multi app, PNPM workspace that I work in.

We have many Next.js applications using Relay, and we've separated our shared components into their own package, ./packages/ui. We then utilize pnpm to link everything up and use these components in our ./apps.


This structure works fine with babel-plugin-relay but seems to break with the SWC Relay plugin:

With Babel: preview

With SWC: preview


First, running the application without modification should work:

pnpm install
pnpm dev

To reproduce the bug, use a locally built version of SWC from this PR

yarn link @next/swc in apps/frontend/* (didn't try PNPM's equivelant)

Rename ./apps/frontend/babel.config.js -> ./apps/frontend/babel1.config.js

Finally run pnpm dev

And you should see the bug ๐Ÿ™‡โ€โ™‚๏ธ

relay-swc-monorepo's People

Contributors

hanford avatar

Stargazers

 avatar

Watchers

 avatar  avatar

relay-swc-monorepo's Issues

Integrating react-relay with @swc/jest

Hi @hanford ,
Great work and thanks for creating this repo.

I was trying to replicate similarly for the react app with custom configuration with babel, webpack, react 17, swc/core, swc/jest.
This is a monorepo project created with yarn and lerna.

After integrating @swc/jest, and removing the initial babel-plugin-relay/macro import (and replaced with import {grahpql} from 'react-relay'). I am getting this issue

**Error: Invariant Violation: graphql: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as graphql **

Can you please let me know if we have require any other configuration ?

followed the similar configuration from this monorepo

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.