RedwoodJS in a monorepo

Anyone running/tried to run RW w/ NX/Bazel/Buck/Rush? What was your experience?

1 Like

No experience, but it depends on if the tool in question supports yarn’s workspaces, since that is how Redwood manages its sub-projects api and web.

I stumbled upon NX and I think I’m in love. Not sure how Redwood would fit in there tho but would be awesome if someone with more experience in both projects could elaborate if these two could integrate well, technically speaking.

1 Like

NX has so much trouble keeping their primary React module (NextJS) updated to current major version that it’s probably not a good idea to even use their monorepo framework. The docs / videos never updated. So good luck building a new module for RedwoodJS.

Given the pace that Redwood updates, I don’t think NX will be able to keep up since they have trouble keeping up with NextJS. Work can only start when NX team actually starts documenting so people can build/update bindings without being in the dark or takes support seriously.

Had this problem with both NextJS and React Native with NX. That’s why my OP was also asking about agnostic monorepo tooling-- I was considering moving off of NX.

1 Like

Thanks for your feedback!

I quickly understood that the NX documentation is lagging behind after going thru their React documentation, finding some outdated examples, so I will move with caution and try it out on simple sites that easily could fit in a monorepo. It also gives me a chance to try NextJS.

We’ll see where NX is heading and maybe in the future it could be a fit. Sorry for hijacking thread for a second :slight_smile:

1 Like

Nah don’t apologize for that. We need more people trying stuff out. I was disheartened that there was no response to this thread for months, haha.

1 Like

Just to circle back, I just found out about Turborepo. Haven’t spiked on it yet, but definitely another option.

Recently saw (since @jeliasson already stumbled) manypkg and wanted to include it.

No idea what it is/does, but it says monorepo and so does this post!

Manypkg is a linter for package.json files in Yarn, Bolt or pnpm monorepos.

Seems it’s tooling for monorepos - not a tool for managing one.

Turbo repo is working nicely in my Redwood project.

yarn turbo run build will ignore web/api since there is no build script, and builds local packages/*

Also if you add these scripts to api/web

  "scripts": {
    "dev": "yarn rw dev --side=api" // and side=web for web

And add a dev script to your packages that runs a watch/build script

You can run it all with just one command yarn turbo run dev
Or add this to your scripts in the root so you can run yarn dev

"scripts": {
  "dev": "yarn turbo run dev"

Side note, this will probably not run very smooth if you have a lot of custom packages.