Skip to content
This repository has been archived by the owner on Jun 5, 2022. It is now read-only.

Commit

Permalink
Universe: use Relay 13 and the new Rust Compiler
Browse files Browse the repository at this point in the history
This commit upgrades Relay to version 13 and switches from the old
Relay Compiler to the new Rust one (since both things go together).

Basically, the main change is that now we have only one Relay config
for the whole monorepo and the compiler is being executed for the whole
monorepo as well (while being much faster). Additionally, Relay support
is directly integrated into Flow so in many cases I simply removed
previous Flow types (see `useLazyLoadQuery` and `useFragment`).

There is still ongoing effort to improve the Flow types in Relay so not
everything is finalized. For this reason I decided to use "Compat" types
mode. Similarly, some hooks (`useMutation` and `usePreloadedQuery` for
example) still require explicit types information so I didn't change
these yet. Regardless of that, we are pretty close to use "Final" types.
We just need to wait for the Relay team to finish everything.

Many issues were already resolved but there are still some that need to
be fixed (not blocking this PR):

- facebook/relay#3700
- relayjs/eslint-plugin-relay#131
- prettier/prettier#6102

Important links with additional information:

- https://relay.dev/blog/2021/12/08/introducing-the-new-relay-compiler/
- https://github.com/facebook/relay/releases/tag/v13.0.0
- https://github.com/facebook/relay/releases/tag/v13.0.0-rc.0
- https://github.com/facebook/relay/releases/tag/v13.0.0-rc.1
- https://github.com/facebook/relay/releases/tag/v13.0.0-rc.2

adeira-source-id: bc3d10741250e32b6fd399245f62d25484c6ae70
  • Loading branch information
mrtnzlml authored and adeira-github-bot committed Jan 7, 2022
1 parent 5a3029d commit 2a4c935
Show file tree
Hide file tree
Showing 19 changed files with 475 additions and 517 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@
"graphql": "^15.8.0",
"jest": "^27.4.7",
"react-test-renderer": "^17.0.2",
"relay-test-utils": "^12.0.0"
"relay-test-utils": "^13.0.0"
},
"scripts": {
"start": "next dev",
"start-production": "next start",
"build": "next build",
"build-analyze": "ANALYZE=true next build",
"relay": "adeira-relay-compiler",
"schema": "adeira-fetch-schema --resource=https://relay-example.adeira.dev/api/graphql"
}
}
7 changes: 0 additions & 7 deletions relay.config.js

This file was deleted.

109 changes: 28 additions & 81 deletions src/Homepage/__generated__/HomepageQuery.graphql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 27 additions & 14 deletions src/Homepage/locations/__generated__/Location.graphql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 38 additions & 23 deletions src/Homepage/locations/__generated__/LocationsPaginated.graphql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

1 comment on commit 2a4c935

@vercel
Copy link

@vercel vercel bot commented on 2a4c935 Jan 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.