v19.0.0
Version 19.0.0 Release Notes
Relay 19.0.0 includes many documementation improvements, bug fixes, and improved capabilities.
@alias required on conditional fragments
To improve type safety, the @alias directive is now required on all fragments that are only conditionally fetched either due to @skip/@include or fragment type conditions which only conditionally match. You can opt out of this validation on a per-fragment basis with the @dangerously_unaliased_fixme directive.
To enable incremental migration we include a codemod which will automatically add the @dangerously_unaliased_fixme in all required places:
npx relay-compiler codemod mark-dangerous-conditional-fragment-spreads
You can also opt out of this validation entirely via compiler config feature flag:
{
// ...
"featureFlags": {
"enforce_fragment_alias_where_ambiguous": {
"kind": "disabled"
}
}
}
Improved Docs
We've merged ~30 commits to clean up and improve our docs since the last release:
- Added new pages:
- Quick Start - A single page guide to get Relay up and running locally
- Production Setup - A list of best practices for setting your Relay application up for production use cases
- Relay Babel Plugin - Information about Relay's Babel plugin and how to install it in your app.
- Relay Environment - API docs for the core Relay environment
- Runtime Configuration - Documentation covering runtime feature flags and more
- Removed outdated or orphaned doc pages
- Streamlined and fixed issues in existing docs
React 19 Compatible
React 19 is now a valid peer dependency of Relay (#4944) by Krzysztof Karol (commit)
Breaking Changes
- Relay now defaults to generating ES module imports in its generated js files. You can add
"eagerEsModules": falsein yourrelay.config.jsonto opt back into the old behavior. (commit) - Relay's NPM modules nolonger include a pre-bundled module. (#4935) by Iha Shin (commit)
Improvements
- Avoid duplication in config JSON Schema by Jordan Eldredge (commit)
- Go to definition in the LSP can now navigate to the correct column (#4969) by Jordan Eldredge (commit)
- Make store an optional argument when constructing a Relay Environment by Jordan Eldredge (commit)
- Include mixed loggerContext in handled snapshot errors by Itamar Kestenbaum (commit)
- Add id collision logging in RelayResponseNormalizer with typename metadata by Monica Tang (commit)
- Mark useLazyLoadQuery options as ReadOnly by Marco Wang (commit)
- Add onPause in cacheConfig for Relay subscriptions by Aria Fallah (commit)
- Add typename metadata to id collision log event by Monica Tang (commit)
Bug fixes
- Fix nullable refetchedFragmentRef in checkSameIDAfterRefetch (#4945) by Krzysztof Karol (commit)
- Add missing
readFragmentexport in relay-runtime (#4931) by Jay Jaeho Lee (commit) - Fix bug with caching incomplete used variables for fragment cycles by Jordan Eldredge (commit)
- Fix
observeFragmenttriggering unhandled rejections on network error (#4885) by Iha Shin (commit) - Checked for missed updates in effect create phase by Jack Pope (commit)
- Avoid writing to stdout in LSP by Jordan Eldredge (commit)
- Run requried transform on IR before validating @required on semantic non null fields in LSP by Jordan Eldredge (commit)
- Fix: Don't report @required on field that can be null due to @required bubbling as unnessesary by Jordan Eldredge ()
Documentation Improvements
- Update language to reference hooks not containers (#4964) by Jordan Eldredge (commit)
- Move the "Organizing Operations" tutorial page into the guides by Evan Yeung (commit)
- Fix code examples in the connections tutorial page by Evan Yeung (commit)
- Migrate most blockquotes in our docs to admonitions by Evan Yeung (commit)
- Update VSCode docs/errors to use pathToRelay (#4965) by Jordan Eldredge (commit)
- Iteration on new quick start guide based on feedback (#4966) by Jordan Eldredge (commit)
- Quick Start: Add note about watchman by Jordan Eldredge (commit)
- Remove "TBD" sections from the docs by Evan Yeung (commit)
Experimental Changes
- Fix relay reader module import bug by Lynn Yu (commit)
- Load component module earlier into record store 1/2 by Lynn Yu (commit)
- Generate data driven dependencies for static resources used by exec resolver normalization artifacts by Lynn Yu (commit)
- add ability to configure operationModuleProvider path separately from componentModuleProvider by Lynn Yu (commit)
- Check for .read_time_resolvers in module_metadata before adding exec time directive in split_module_import by Lynn Yu (commit)
- add exec time resolvers directive to split module import by Lynn Yu (commit)
- Generate exec time ASTs in rootFragment $normalization files by Tianyu Yao (commit)
- Compiler client 3D changes to support exec time resolvers by Lynn Yu (commit)