v13.0.0
Breaking Changes
relay-compiler
is now implemented in Rust and it replaced the JS version from v12.- The motivation and details for this change are captured here: https://relay.dev/blog/2021/12/08/introducing-the-new-relay-compiler/
- A few new features that are supported in the new compiler:
- TypeScript code generation added to the compiler.
- New directives:
- @required: Improve the ergonomics of handling null values by declaratively telling Relay to either
LOG
,THROW
, or bubble (NONE
) null fields. - @no_inline: Disable inlining the fragment when it is used in normalization(query) artifacts. Reduce generated artifacts size if the fragment is used in many places.
- @required: Improve the ergonomics of handling null values by declaratively telling Relay to either
- Support for generic query persisting in the configuration.
- Breaking changes in the new Relay compiler
- No field aliases can start with two underscores; these are reserved for internal Relay use.
- Export query hashes to JSON is removed.
- The quick instructions on how to use the new compiler are here:
- Updates in runtime, React APIs, and generated flow types for better integration with Flow: and a first class support for types in
flow
forgraphql
tags. It may break some of the components that rely on the structure of the generated Relay flow-types. - Statically flow-type the second parameter passed to updaters, optimistic updaters and
commitLocalUpdate
; it is now derived from the shape of the mutation and is optional. This type had previously been typed as$FlowFixMe
(i.e.any
); as a result, adding static types here is a breaking change. - Removed
relay-config
.
For more details see:
- 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
Changes since RC.2
Added
Fixed
- [995bb87] Add
include
option to single project config file, and warn if it is used. - [504b5a8] add serde(alias = "exclude") to SingleProjectConfigFile
- [f0d7395] do not panic if query_type is not defined
- Update refetching-queries-with-different-data.md (#3714)
- [e0911d6] update doc references to renamed props
- [e959f5c] fix typo in fetch policies
- [ed24f9d] fix unused variables lints in relay-runtime
- [a93d922] fix test utils for ResolverFragments
Misc
- [e075107] Update copyright headers from Facebook to Meta
- [f16b8da] workaround rust-analyzer bug
- Remove outdated dependecies from package.json (#3712)
- [1f01910] Update generate_fixture_tests component on FBS:master
- [e31cac7] auto lint fixes
- [ebfa5b1] autocargo: ctp: depend on pxl instead of re-declaring its crates