relay
                                
                                 relay copied to clipboard
                                
                                    relay copied to clipboard
                            
                            
                            
                        Support multiple Relay project configurations in extension
Reviving https://github.com/facebook/relay/pull/3972 into a separate PR and taking over for Terence. This mostly just copies that PR into a new one, but also does a few other fixes
- Fixes issues were were having with extension publishing with vsce. I updated to the non-deprecated@vscode/vsceupdated package. Packaging/publishing has changed a bit now- Uses esbuild to minify the extension into a single file as recommended by the VSCode docs
- Removes the use of the extension as a yarn workspace. Yarn workspaces and the vsce packager don't play very well together and were causing all sorts of dependency issues when trying to create the extension .vsix file. Since no other parts of this repo were using workspaces (e.g. the website) I removed that and made it so the extension is its own standalone folder.
 
- Clarified and updated extension options around the relay.projectsconfiguration. Also added a section to the README on how to migrate from v1 to v2
I tested this extension in a handful of different projects, some with no configuration needed, some with the old configuration options (which we map to the new one), and workspaces with multiple projects. However, if anyone has the time I'd love to have others try it out. Just run yarn build-local from the vscode-extension directory and manually install the resulting relay-2.0.0.vsix file into VSCode.
Unrelated to the core purpose of this change, but I also added a .nvmrc file to the root of this repo (and removed .nvmrc from the gitignore since running yarn at the root of this repo with Node 18 fails. Not sure if we were intentionally not including .nvmrc files though, so I can revert if needed.
/cc @davidmccabe @captbaritone @tbezman
I don't really understand the unit test failures at this point since my changes shouldn't have touched any of that. Maybe the cargo.lock file needs to be updated, not sure.
Any update on that PR? What do we need to finish and merge this PR?
cc @captbaritone @tobias-tengler
Do you plan to release this Pull Request?
I added relay.projects to settings.json as documented, but it did not work correctly and upon investigation I noticed that this PR has not yet been merged.
Do you plan to release this Pull Request?
I added relay.projects to settings.json as documented, but it did not work correctly and upon investigation I noticed that this PR has not yet been merged.
I just came looking to find out why that wasn't working, since it was documented as a feature. Do we know when this would be released?
Same for me, can we merge this MR and do a release ? Required for mono repo :)
What is everyone doing as a workaround to handle monorepos with multiple relay configs?
What is everyone doing as a workaround to handle monorepos with multiple relay configs?
You can pass projects into your relay.config.js like this:
module.exports = {
  root: ".",
  sources: {
    // put here the source of each project, the root dir of each package of your monorepo
  },
  projects: {
    project1: {
      schema: "...",
      language: "typescript",
    },
    // ...
  },
}
@noghartt thank you!