Relay is a JavaScript framework for building data-driven React applications.
This change is a breaking change, as the customScalars
config option in the single-project config must now be specified as customScalarTypes
.
Parameters
and indexed access type to extract PreloadParams by Sam Zhoudirectives
argument for @refetchable
(#4520) by Daniel Lo NigroFull Changelog: https://github.com/facebook/relay/compare/v16.1.0...v16.2.0
enable_strict_custom_scalars
to perform validations when custom scalar types are used, to check that the user doesn't try to pass literal values (strings, ints, etc) in positions where a custom scalar type is expected, as this can break type safety since Relay can't know whether those literals conform to the underlying custom type.EntryPointElementConfig
by Sam ZhouuseFragmentInternal
to use in useLazyLoadQueryNode
by Andrey Lunyov@connection
directive will now throw if they are invalid instead of being a no-op. [2dd79543d3f6]Flow-related breaking changes:
commitMutation
[603ce546741a] and useMutation
[051e4694c20b].RelayModernRecord.js
. [21a896c54e63]babel-plugin-syntax-hermes-parser
plugin, which switches Babel to use hermes-parser
instead of @babel/parser
, and enables full syntax support for Flow. [c320a892482c]React.Element
fully opaqueTypeScript-related breaking changes:
Record<PropertyKey, never>
instead of as {}
to represent an object without properties. [16910c948e9a] (#4404)null
and undefined
(T | null | undefined
) instead of (T | null
). To keep the old type generation behavior for now, you may set the typescriptExcludeUndefinedFromNullableUnion
feature flag in the relay-compiler
config as follows. ~Note the feature flag will be removed in a future release~. [cc47bc95414b] (#4380)
{
"language": "typescript",
"typescriptExcludeUndefinedFromNullableUnion": true
}
Relay Resolvers are an experimental feature of Relay which allows you to model derived data, and soon client state, in your Relay graph. Since our last release we’ve put considerable work into stabilizing the feature. This includes bug fixes across our compiler, type generation, runtime and LSP (editor integration). In particular, contributors have fixed a number of bugs which made it impossible to use Relay Resolvers with TypeScript.
Documentation:
Improvements:
@required
to bubble to client edge resolvers.@live
field@weak
resolver values were getting normalized@weak
model resolvers@rootFragment
on model types@rootFragment
on model types@required
on client edges@defer
/@stream
names (#4467)Additions:
Typo fixes:
useTransistion
getting-started/installation-and-setup.md
(#4306)Tutorial updates:
Other corrections:
readInlineData
function (#4451)useMemo()
in docs (#4281)cannotReadPropertyOfUndefined
experimental.abstract_locations
configinference_mode
config now that LTI is the defaultTPreloadParams
invariant$Shape
to Partial
in Relay files, suppressing errorsRecord
(which is an untyped grabbag containing whatever the store has), we instead pass a ?ReadOnlyRecordProxy
. Furthermore, we replace NormalizationLinkedField
with CommonLinkedField
, which both a ReaderLinkedField
and NormalizationLinkedField
"implement".flow
for graphql
tags. [a75a445bb72c] [ef29f061fd3a] [78bd12d39562] [614c74718544] [ab9f04ab54ea]@weak
objects@weak
types in docblocksimport type
for named imports in typescriptimport type
in typescript for all imports (#4029)assignClientAbstractTypes
to the DataCheckerjs
fields in query for 3D when local import is enabledRelay v14.1.0 adds improvements for existing relay features - primarily fixes and feature compatibility for client extensions and @inline
. Thanks to our open source contributors who helped us release the Relay VSCode Extension!
[cefab9e1659f] Support for @required
and client-edges
[90ccda1da4b0] Support @argumentDefinitions
in @inline
fragments (#3935)
[8adcfab3ec11] VS Code: Find references of the Resolver field.
[b965299349d1] useClientQuery hook
[7d5cc3431891] Add support for resolvers without fragments
[8db002fa4120] Support custom scalar arguments that are passed as literals
[a5d67d6bf677] Add resolvers to the dependency graph (Fix missing resolver fragments in incrmental mode and VS Code)
[57f96a133177] Improve error message when you mix up @live
and non-live values.
[c4dbd26278fa] Remove .js
and .ts
from require / import (#4002)
[cd1e9ae06d11] Fix MutationHandlers on field with args
[7e6dbdd6af74] Ensure only one implemntation on interface
[055908fb12a2] VS Code: Fix comment blocks to recognize the embedded language inside of a JS file. (#4001)
[6a9b0e560e3d] Performance optimizations in the validate_conflicting_selections
[fa5a3baa9a8d] Explicitly enumerate unsupported ReaderNode types
[9990e6f0bf79] Disallow default values on resolver fields
[d42bb7c5a139] VSCode extension pathToRelay doesn't allow relative paths (#3969)
[a86323f43c59] Validate conflicting selections in client fields
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 these CLI
arguments.language
configuration option required. In v13, we have default language as flow
(or Javascript with Flow comments) for reading and generating artifacts. Majority of the projects in OSS, however, use typescript
- in order to detect which language (typescript, JS, or flow) is used in the project we will use this option.__typename
in fragments on query.__typename
selections within concrete linked fields have a string literal type, instead of the type string
.typegen_phase
have been removed from the Relay compiler config.readUpdatableQuery_EXPERIMENTAL
and readUpdatableFragment_EXPERIMENTAL
@inline
fragments (#3933).@no_inline
(#3923).CustomScalarType
to represent custom scalar types in the Relay compiler configuration.sha256
and md5
for local file persister (#3878)@required
on plural fragments.@inline
fragments.graphql
tag and template. literal.Full Changelog: https://github.com/facebook/relay/compare/v13.2.0...v14.0.0
typegenPhase
in the single project config file. See release v13.1.0 for more details.Full Changelog: https://github.com/facebook/relay/compare/v13.1.0...v13.1.1
"flowTypegen": "Compat"
but projects should migrate to using the updated names (e.g. MyFragment$fragmentType
instead of MyFragment$ref
.__isX
fieldsIgnore
. To keep some files in __generated__
(or in artifactDirectory) directoriesworker_count
from the OperationPersister interfacecommon/rust/cargo_from_buck/bin/autocargo
detail
fieldFull Changelog: https://github.com/facebook/relay/compare/v13.0.2...v13.0.3