v14.0.0
What's Changed
Breaking Changes
- [8bb7478] Removed compiler CLI arguments:
src
,schema
,artifactDirectory.
This simplifies the public API of the compiler. The error message should print helpful message with possible config file, that can be used instead of theseCLI
arguments. - [44d6887] Relay Compiler: Make
language
configuration option required. In v13, we have default language asflow
(or Javascript with Flow comments) for reading and generating artifacts. Majority of the projects in OSS, however, usetypescript
- in order to detect which language (typescript, JS, or flow) is used in the project we will use this option. - [ed53bb0] New compiler validation: Disallow
__typename
in fragments on query. - [20626f2] Make
__typename
selections within concrete linked fields have a string literal type, instead of the typestring
. - [48ed515] Removed legacy exported type names from generated files.
typegen_phase
have been removed from the Relay compiler config.
Added
- Relay VSCode Extension by @tbezman / collaboration with @captbaritone. Starting with #3858.
- Please see: https://github.com/facebook/relay/tree/main/vscode-extension#readme for detailed information and installation instructions.
- Relay Provided Variables
- Provided variables allow populating a variable with a user-defined function. Unlike normal variables, provided variables are automatically defined for all operations that use them, allowing developer to avoid tedious updates to all the queries that might reference a fragment using the variable. This is helpful for global values such as configuration flags or device settings (pixel ratio).
- More: https://relay.dev/docs/api-reference/graphql-and-directives/#provided-variables
- Experimental: Relay Typesafe Updaters
- New Experimental APIs for updating local data:
readUpdatableQuery_EXPERIMENTAL
andreadUpdatableFragment_EXPERIMENTAL
- For more details see FAQ: https://relay.dev/docs/guided-tour/updating-data/typesafe-updaters-faq/#what-is-typesafe-updaters
- New Experimental APIs for updating local data:
- Experimental: Relay Resolvers
- Relay Resolvers is an experimental Relay feature which enables modeling derived state as client-only fields in Relay’s GraphQL graph. For more details see https://relay.dev/docs/guides/relay-resolvers/
- [901d657] Relay Compiler: Add JavaScript language to Relay Compiler Configuration.
- Please see: https://github.com/facebook/relay/tree/main/packages/relay-compiler for the list of supported compiler configuration options and CLI arguments.
- [1244359] Support for client-only queries.
- [80a66c9] Support query variables in
@inline
fragments (#3933). - [271a162] Support CommonJS for
@no_inline
(#3923). - [9e71765] Add new enum
CustomScalarType
to represent custom scalar types in the Relay compiler configuration. - [e73b95f] Add new option to support compiling a single project (#3868).
- [2a9f17f] support
sha256
andmd5
for local file persister (#3878) - [5e3c7b6] Build linux arm64 (#3882).
- [23b4cac] Expose Relay schema Extensions (#3859).
- [f199ede] Relay Compiler: Enable updatable fragments.
- [58b335e] Relay Compiler: Allow single project configs to specify feature flags (#3840).
Fixed
- [e8c9ffe] Relay Compiler: make LocalPersister include trailing newline (#3938)
- [384315d] Report schema location for invalid types (#3924).
- [141ef0f] Avoid bug where watch mode can get stuck in invalid state (#3922).
- [c48bda9] Ignore BOM when lexing (#3908).
- [6cff97d] declarative_connection: allow interfaces or objects.
- [52af6a6] Don't flatten fragment spreads with differing directives
- [5a9d42e] Fix incorrect type generation with
@required
on plural fragments. - [739009f] remove DEPRECATED_GraphQLSubscriptionConfig type.
- [928728a] Relay Compiler: Detect cyclic
@inline
fragments. - [eb0fc26] Hooks: Fix useMutation inFlight race condition (#3841).
- [2101a79] Relay Compiler: Sort locally persisted operations (#3835).
- [9f0dea4] Relay Compiler: Sort unions conditionally.
- [b04b2b7] Sort object members in type generation (conditionally) (#3808).
- [bb7c65f] Relay Compiler: Handle spaces between
graphql
tag and template. literal.
Improvements/Misc
- [9556f2f] Persist explorer state in the URL/local storage (#3930).
- [dd48057] Performance optimizations in selection conflicts validations.
- [bb8721f] Quote key names in complex type field argument literals.
- [4e2030f] Add FAQ page to docs.
- [c6ecd52] Print fragment variables.
- [7b6e7f5] Track directives on argument definitions.
Full Changelog: v13.2.0...v14.0.0