Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update relay monorepo to v18 (major) #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 10, 2021

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
babel-plugin-relay (source) ^10.1.3 -> ^18.2.0 age adoption passing confidence
relay-compiler (source) ^10.1.3 -> ^18.2.0 age adoption passing confidence
relay-runtime (source) ^10.1.3 -> ^18.2.0 age adoption passing confidence

Release Notes

facebook/relay (babel-plugin-relay)

v18.2.0: Version 18.2.0 Release Notes

Compare Source

Relay version 18.2.0 comes with several bug fixes and improvements!

New compiler capability: Relay Codemods

Codemods are tools which enable you to programmatically update your code. These are especially helpful if you want to upgrade an API across your whole codebase without needing to manually change each call site. The Relay compiler, with its understanding of your GraphQL snippets, is well positioned to help with these kinds of tasks. In Relay 18.2.0 we are introducing Relay Codemods.

We currently support two different codemods:

  • mark-dangerous-conditional-fragment-spreads marks places where @alias is required to make a fragment spread safe. This can enable you to turn on the enforce_fragment_alias_where_ambiguous feature flag. Learn more in the @alias docs.
  • remove-unnecessary-required-directives identifies places where @required is unnecessary because it's used on a non-nullable field within a fragment or query that is @throwOnFieldError, and removes the @required directive.

We are looking forward to helping Relay users with more codemods in the future!

New experimental hook for pagination with prefetching

It is often possible to speed up list pagination by pre-loading one or more pages of results ahead of what the user is currently viewing. Our previous APIs made this difficult to fetch the next page of data without also rendering it at the same time. We are currently exploring an experimental API to make it easy to manage paginated lists with prefetching.

Read more in the docs: usePrefetchableForwardPaginationFragment

Expand places where @​catch can be used

The @catch directive can now be used on fragments, queries, mutations and aliased inline fragments. This enables more flexibility in controlling how field errors are handled.

Bug fixes
  • [682ac5a]: Include Relay resolver import type when field is selected on query as well (#​4820) by Ernie Turner
  • [d6cb5a2]: Update required-on-non-null validation to also work within @​catch by Gordy French
  • [356327c]: Fix bug in Connections with errors by Evan Yeung
  • [9571d80]: Fix result type generic for Error to not double-nest by Itamar Kestenbaum
  • [af35418]: Ignore @​dangerously_unaliased_fixme when comparing structs by Jordan Eldredge
  • [f166d6b]: Fix dangling resolver artifact by Tianyu Yao
Improvements
  • [81eab03]: Remove unused fieldPath from resolver suspense objects by Jordan Eldredge
  • [d982b5b]: Add feature flag to opt in/out of including the path field in @​required reader nodes by Jordan Eldredge
  • [460508a]: Remove path from @​catch codegen by Jordan Eldredge
  • [a88c013]: Derive @​required fieldPath at runtime by Jordan Eldredge
  • [7c9aebb]: Add support for @​catch on fragments/queries/mutations and aliased inline fragments (#​4838) by Jordan Eldredge
  • [08fef89]: Cleanup resolver cache implementation only used in tests by Jordan Eldredge
  • [2c3b915]: Cleanup AVOID_CYCLES_IN_RESOLVER_NOTIFICATION by Jordan Eldredge
  • [2705e3d]: Add support for handling field errors on noncompliant lists by Ryan Holdren
  • [402aa97]: Update message in handlePotentialSnapshotErrors for payload errors by Itamar Kestenbaum
  • [8421851]: Improve error message when directive is used in wrong location by Jordan Eldredge
  • [3eb627d]: Add fieldPath to missing data field error logs (#​4835) by Jordan Eldredge
  • [bac814f]: Use prefetchable metadata in the prefetchable pagination hook by Tianyu Yao
  • [d079b29]: Allow @​required on connection fields by Jordan Eldredge
  • [733cc27]: Add schema name to project config by Monica Tang
  • [ebf028b]: Use directive location where it makes sense by Gordy French
  • [d3eb42f]: Don't require @​alias on plural fragments spread into plural selections by Jordan Eldredge
  • [e21e162]: Allow codemod to specify rollout percentage by Gordy French
  • [e4facf3]: Allow granular FeatureFlag gating of @alias enforcement by Jordan Eldredge
  • [deb7b09]: Allow users to return ID built in scalar using DataID by Jordan Eldredge
  • [3c92504]: Fix slow typegen in adslab by Tianyu Yao
  • [6e4c120]: Update error message for clarity by Jordan Eldredge
  • [5c548bd]: Allow @​dangerously_unaliased on @​inline fragments by Jordan Eldredge
  • [2cf6c7f]: Codemod command runs and collects code actions by Gordy French
  • [ad26284]: Make required-on-non-null-within-throwOnFieldError an LSP warning by Gordy French
  • [b41ae4c]: Support semantic non-nullable RelayResolverValue by Jordan Eldredge
  • [eba1d97]: Allow strong resolvers to reference opaque types by Jordan Eldredge
Documentation Improvements
  • [9401e69]: - add new client 3D page in 3D docs by Lynn Yu
  • [6a51b39]: - 3D docs starting point by Lynn Yu
  • [caa040a]: - document all top level functions in relay compiler by Lynn Yu
  • [1306086]: - document all top level structs in relay compiler by Lynn Yu
  • [86301c7]: - document all modules in relay compiler by Lynn Yu
  • [bdbe7e0]: Add rust docs for all top level enums in relay compiler by Lynn Yu
  • [5600502]: - document semantic nullability support in resolvers by Lynn Yu
  • [c3b0dd5]: Docs: Fix fragments tutorial thumbnail typo (#​4841) by Daniel Stocks
  • [5b7dc1f]: Add docs for usePrefetchableForwardPaginationFragment by Tianyu Yao
  • [5cccb7b]: - adding docs for abstract types in relay resolvers by Lynn Yu
  • [ebc4936]: Minor updates to docs on enabling relay resolvers (#​4824) by Arthur
  • [4776175]: Update docusaurus to 2.4.3 by Gordy French
  • [0b4920d]: - delete old relay doc versions older than 2 years by Lynn Yu
  • [b8967d2]: Add documentation for codemods (#​4826) by gordyf
  • [7c2b460]: Update description of dangerously_unaliased_fixme directive by Jordan Eldredge
Miscellaneous
  • [9eb9c94]: Update to latest react@experimental (#​4847) by Lauren Tan
  • [7e258ca]: Add @​relayRequiredVariables to metadata section of generated .graphql files by Jean Zhang
  • [4360f69]: Deprecate GK relay_enable_load_query_request_deduping by Nithik Balachandran
  • [15a19e9]: Update metadata generation for Live Query in Relay compiler by Xiangxin Sun
Experimental Changes
  • [30af003]: Add a runtime feature flag for prefixing read-time resolver storageKeys by Evan Yeung
  • [195d9a2]: Fix usePrefetchablePagination bug by Tianyu Yao
  • [57756e6]: Allow reusing fetching options in usePrefetchableForwardPaginationFragment by Tianyu Yao
  • [023b875]: Support dynamic switching of read vs exec time resolvers in reader by Evan Yeung
  • [53cef9d]: Update hook to expose data in UNSTABLE_extraVariables by Lynn Yu
  • [d036d49]: Update normalization artifacts for exec time resolver strong ids by Evan Yeung
  • [9035b32]: Generate prefetchable pagination ASTs by Tianyu Yao
  • [dececd1]: Generate metadata for prefetchable pagination by Tianyu Yao
  • [4a67ddd]: Create a separate edge fragment for prefetchable pagination by Tianyu Yao

v18.1.0: Version 18.1.0 Release Notes

Compare Source

Following up from our v18.0.0 release last month, v18.1.0 provides a number of fixes and improvements, adds some new experimental APIs, and ships some long-running experimental features as stable.

Relay Resolvers are now stable

For the past several years we've been iterating on Relay Resolvers which provided a structured and typesafe way to model client state and derived data in your GraphQL graph. As of this release, Relay Resolvers are enabled by default and no-longer experimental. As part of this stabilization we shipped fixes for Relay Resolvers when used with TypeScript and fixed a few edge cases related to how errors encountered by resolvers are handled.

  • [d10786]: Update docs now that resolvers are stable by Jordan Eldredge
  • [4e5377]: Remove Relay Resolver compiler feature flag by Jordan Eldredge
  • [7b8f1f]: Remove ENABLE_RELAY_RESOLVERS runtime feature flag by Jordan Eldredge
  • [1467b6]: Stabilize LiveResolverStore as the new implementation of RelayModernStore (#​4806) by Jordan Eldredge
  • [dec5ee]: Avoid running resolver code if root fragment throws with @​required(action: THROW) (#​4799) by Jordan Eldredge
  • [478274]: Ensure we import the type of a resolver for RelayResolverValue fields by Jordan Eldredge
  • [852fbc]: Improve edge resolver error messages by Gordy French
  • [575f20]: Add satisfies type assertion for typescript (#​4797) by Drew Atkinson
  • [2314f4]: Document relay field logger (#​4809) by Jordan Eldredge
Improvements to error @​catch

We released @catch in v18.0.0 and are very excited about the capabilities it enables. Check out Itamar Kestenbaum's GraphQL conf talk about it here: Build Confidently: How @​Catch and Error Handling Pave Way in Field Nullability.

Since that release we've made a few improvements:

  • Fields within a @catch directive that are marked as @semanticNonNull in the schema now generate non-nullable TypeScript/Flow types. See semantic nullability.
  • Errors exposed to product code by @catch no-longer include the error message. This is because GraphQL error messages are generally not safe to show to users. These error messages can still be accessed by the field logger provided to your Relay Environment. In the future we plan to let users opt into allowing safe error messages through to product code.
  • [26b78d]: Take advantage of @​semanticNonNull within @​catch (#​4794) by Jordan Eldredge
  • [6a038d]: Replace actual server-side error with generic "server error" message by Itamar Kestenbaum
  • [6c8827]: Don't report missing fields within an unmatched inline fragment by Jordan Eldredge
  • [2314f4]: Document relay field logger (#​4809) by Jordan Eldredge
Compiler Error Reporting

We've improved how errors are reported by the Relay compiler to ensure we report as many errors as possible, and each error includes sufficient context.

  • [9edbb0]: Report validation errors for all segements of a proejct by Jordan Eldredge
  • [adaf8a]: Report location of operation that does not define variable by Jordan Eldredge
New "Copy Operation" VSCode command

Our VSCode extension now includes a command to quickly copy the full text of a query directly from within your editor.

Copy operation VSCode command

  • [8d2380]: Add copy operation command (#​4778) by Tobias Tengler
Experimental APIs for reading fragment data outside of React

In some cases it can be useful to read a fragment outside of a React hook. However, doing this requires handling a number of concerns.

  1. The fragment data may not yet be ready (@defer or Relay Resolver suspense).
  2. The fragment may error (@throwOnFieldError, @required(action: THROW))
  3. The fragment's data might change over time.

To enable users to read fragment data while correctly handling these cases, we've added two experimental APIs:

  • observeFragment: Read a fragment as a stream of states where each state might be loading, error, or value.
  • waitForFragmentData: Read a fragment as a promise which will resolve when data is available, or reject if an error is encountered.
  • [6f0cbe]: Upstream observeFragment and waitForFragmentData to relay-runtime by Jordan Eldredge
  • [36eecf]: Documentation for observeFragment and waitForFragmentData by Jordan Eldredge
Docs

Thanks to members of our community for submitting pull requests to improve our docs:

  • [e133fe]: Remove reference to the Google Chrome Extension Store from the installation guide for Relay Developer Tools by Jakub KopÃ…â„¢iva
  • [e41490]: Replace story.image for story.thumbnail (#​4793) by Theo Kouzelis
  • [e95a5a]: Update mutations-updates.md in Tutorials (#​4765) by Jbee
  • [0cf094]: Update error handling and semantic nullability docs to include talks and links (#​4800) by Jordan Eldredge
Improvements
  • [08c74e]: Validate semantic-non-null interface implementations by Gordy French
  • [a5b963]: Renaming missing_field log event types to missing_required_field by Itamar Kestenbaum
  • [186c91]: Call cleanup of insertion effects when hidden (#​30954) by rickhanlonii (Meta Employee)
  • [ba0b46]: Add logging for normalization by Tianyu Yao
  • [792628]: Relay: Allow omitting exists on ExternalFileSourceResult by Nico Reed
  • [f1ee92]: Check pruned fields blocklist for undefined fields by Steven Chaitoff
  • [23958c]: Make metadata_for_machine keys string constants by Steven Chaitoff
  • [8d0302]: Relay: Remove unused code from oss code by Nico Reed
  • [6d36d7]: Fix mockClientData with generateDeferredPayload = true by Fernando Gorodscy
Experimental

We are always continuing to evolve and improve Relay. These changes are part of features or implementations which are either in progress or are being experimented with internally.

  • [cb1b4d]: Add feature flag and config option to give custom path for artifacts by Monica Tang
  • [4acf3f]: Make usePaginationFragment compatible with by Joe Savona
  • [f9365f]: Attempt to avoid cycled when expanding updated ids to include impacted resolvers (#​4792) by Jordan Eldredge
  • [59b2a6]: UseQueryLoader() (and refetch()) compatibility with by Joe Savona
  • [2f997b]: Update generated data driven dependency metadata for client 3D by Lynn Yu
  • [790d46]: Update Relay API for disk caching by Evan Yeung
  • [bb30bb]: Add feature flag for reader AST module imports by Evan Yeung
  • [f0761b]: Add a priority flag to task scheduler for store network updates by Tianyu Yao
  • [6f8f79]: Move corpus creation of program into helper function by Gordy French

v18.0.0: Version 18.0.0 Release Notes

Compare Source

With version 18, the Relay team at Meta and our community of contributors have made several significant improvements to Relay:

  • Improved validation of argument types
  • @alias released as stable
  • @catch to detect and granularly handle field errors
  • @throwOnFieldError and @semanticNonNull to avoid having to handle the nullability of fields which are only null in the case of error.
  • Intellisense for your Relay config file
  • Rename refactoring tools and inlay hints for fragment arguments

Read all about them in more detail below:

Breaking Changes
Improved validation of field and fragment arguments

Previously we were not correctly type-checking arguments passed to client-defined fields, such as Relay Resolvers and Client Schema Extensions. This new release adds that validation. If you need to opt out of this validation for any reason, you can enable the disable_full_argument_type_validation compiler feature flag.

{
    // ... rest of config
    "featureFlags": {
        "disable_full_argument_type_validation": {
          "kind": "enabled"
        }
     }
}
Major features
@​alias fragment aliases released as stable

Aliased fragments are a Relay feature that lets you access fragments spreads and inline fragments as named properties. This can be especially helpful for fragments which might be conditionally fetched due to @skip/@include or type conditions which might not match. With @alias these fragments get typed as nullable properties allowing you to check at runtime if they've matched or not before trying to use the data.

Read more about @​alias

@​catch

@catch, enabled by default will let you check at runtime if a field errored. This can allow you to disambiguate between true nulls returned by your server, and fields which are null due to field level errors.

Read more about @​catch

@​throwOnFieldError

@throwOnFieldError can be added to fragments and queries and will cause any field errors within that fragment/query to throw when read. This ensures that all null values you encounter are true nulls as returned by your field resolvers on the server, and not field level errors that have been coerced to null.

Read more about @​throwOnFieldError

Semantic Nullability

@throwOnFieldError unlocks a powerful new feature when combined with a schema that has fields annotated with @semanticNonNull. @semanticNonNull can be added to fields which have been made nullable in the schema only to enable more robust error handling, but are not expected to return null expect in the case of errors.

Within fragments or queries annotated with @throwOnFieldError, fields annotated with @semanticNonNull will be typed as non-nullable. This has the potential to dramatically reduce the number of null checks you need to perform inside your product code, while also making your product code more "correct" by treating all field errors as explicit errors.

Read more about Semantic Nullability

Relay Resolvers can now have access to context

Thanks for Mark Polak and Drew Atkinson from Microsoft, Relay Resolvers can now be configured to accept a shared context object, similar to standard GraphQL resolvers.

Pull Request

Read more about Resolver context

Ability to opt out of Relay Compiler source control integration

Thanks also to for Mark Polak from Microsoft, the Relay compiler config now supports the option "noSourceControl": true which will ask the Relay compiler to not automatically try to add/remove files from Git or Mercurial.

Pull Request

Editor Integration Improvements

Thanks to Tobias Tengler, Relay's editor support now includes:

  • Intellisense (autocomplete, hover tooltips, diagnostics) for the Relay config file. This fills a critical gap since the Relay config is quite under-documented. (#​4724) by tobias-tengler
    • Editor integration (#​4724) by tobias-tengler
    • Generate JSON schema for compiler config (#​4723) by Jordan Eldredge
  • Rename refactoring tools (#​4581) by tobias-tengler
  • Add Inlay Hints for Fragment arguments (#​4740) by tobias-tengler
  • Improved documentation links in errors and hover tooltips (#​4741) by tobias-tengler
Additional runtime logging integrations
  • [9b24ad]: Log notify stats by Tianyu Yao
  • [ed8a7f]: Add logging for DataChecker by Tianyu Yao
  • [462b01]: Add logging for store lookup by Tianyu Yao
  • [1faea5]: Add more loggings for GC by Tianyu Yao
  • [f42215]: Add more information to execute.next log by Tianyu Yao
Additional Improvements
  • [e84b10]: Inline enum values in hot code paths by Jan Kassens
  • [ebd987]: Strictify relay entrypoint typing by Sam Zhou
  • [989ebf]: Improve error reporting for argument type errors by Jordan Eldredge
  • [3ba54c]: Use more precise variance for some relay types by Sam Zhou
  • [9f0e9e]: Improve schema-validation error messaging by Steven Chaitoff
  • [eec960]: Report schema parsing errors for synced schema sources (#​4719) by tobias-tengler
  • [176f96]: Parallelize dumping schemas to disk by Deepak Singh
  • [e492d7]: Fix out of date component name in Mutations & Updates by Lynn Yu
  • [0f49c2]: Skip importing export types in TS (#​4754) by Drew Atkinson
  • [aba9e9]: Ignore null/undefined queries in entrypoints by Jordan Eldredge
  • [d5f1a0]: Correctly report unaliased fragments within inline fragment with @​skip by Jordan Eldredge
  • [2ad28f]: Disallow Node refetchable query on interfaces without implementations by Tianyu Yao
  • [c446d4]: Fix Relay incremental build for enums by Evan Yeung
  • [7998bc]: Support multiple @​module fragments in the same selection if they have @​alias (#​4744) by Jordan Eldredge
  • [df2aca]: I think we could allow @​module in the same selection if they have different keys by Jordan Eldredge
  • [294cb8]: Ensure we strip alias metadata from selections within inline fragments by Jordan Eldredge
  • [531c6f]: Fix syntax error when using the new relay resolver by Tianyu Yao
  • [6e47ac]: Return and handle all required_on_non_null_field errors by Gordy French
  • [2b5028]: Ensure documents are synced before calculating completions #​4473 by Jordan Eldredge
  • [c43429]: Add editor support for JSON config schema (#​4724) by tobias-tengler
  • [4d2fe9]: Error on multiple graphql type definitions on one flow type by Tianyu Yao
  • [99003d]: Prevent using @​alias within @​match by Jordan Eldredge
  • [7491d3]: Update relay resolve API doc by Tianyu Yao
  • [5d1225]: Fix incremental build when enum field argument changes by Monica Tang
  • [0c5d69]: Support incremental schema change for union changes by Lynn Yu
  • [d53615]: Refactor alias to always use inline fragments (and compose with other features) by Jordan Eldredge
  • [86800e]: Add compiler command to emit json schema of config file by Jordan Eldredge
  • [80e041]: Minor spell checking by Gordy French
  • [6a2c39]: Validate that @​match fields always have supported arg by Jordan Eldredge
  • [7bd521]: Only validate alias within each selection set by Jordan Eldredge
  • [44cbff]: Support Client Edge to Client Union for strong types by Monica Tang
  • [d35688]: Avoid reading inline fragments if abstract type condition does not match by Jordan Eldredge
  • [3787b8]: Handle case where @​required bubbles to @​aliased inline fragment on abstract type by Jordan Eldredge
  • [349334]: @​required should bubble nullable to parent semantic-non-null linked field by Gordy French
  • [f96121]: Allow abstract inline fragments to be omitted by Daniel Lo Nigro
  • [43bd9b]: Revert D542067: Validate edgeTypeName argument points to an existing type by Amy Hwang
Documentation Improvements
  • [c54830]: Docs for @​catch by Itamar Kestenbaum
  • [f07f56]: Update semantic nullability docs to remove feature flag that is no-longer needed by Jordan Eldredge
  • [861caa]: Fill in definitions for @​stream and @​stream_connection in Glossary by Lynn Yu
  • [e46ba9]: Document current support for experimental semantic nullability (#​4770) by Jordan Eldredge
  • [642e03]: Add definitions for @​live and @​live_query to glossary by Lynn Yu
  • [27b2a1]: Document resolvers constants by Jordan Eldredge
  • [175098]: @​throwOnFieldError documentation by Gordy French
  • [794cc3]: Pagination documentation fixes by Lynn Yu
  • [23a7c2]: Fix the connection key in the mutations tutorial (#​4751) by Sviatoslav Abakumov
  • [bf6153]: Fix small errors in docs by Lynn Yu
  • [99f4f6]: Organize sidebar for oss site by Evan Yeung
  • [0ab687]: Re-organize hierarchy of docs interally by Evan Yeung
  • [aa6538]: UseQueryLoader clarification by Monica Tang
  • [9f314a]: Fix GraphQL Field name for story thumbnail examples by Jerry Francois
  • [285dc2]: Spelling and capitalization by Gordy French
  • [0e57c3]: Fix unclosed jsx tag by Monica Tang
  • [7fccac]: Fix minor typo in editor-support.md (#​4721) by SY Ryu
  • [c632b4]: Link to Relay website @​defer @​stream docs by Monica Tang
  • [d61ce0]: S/class/className/ in MDX (#​4716) by Paul O’Shannessy
  • [98d76c]: Add instructions to run relay compiler after query update (#​4718) by Matthew Pawley
  • [dbae5c]: Link GQL node definition in useRefetchableFragment section by Danny Zou
Miscellaneous
  • [457e0c]: Update relay compiler README by Monica Tang
  • [36e9ea]: Remove loadQuery during render warning (#​4731) by Jordan Eldredge
Experimental Changes
  • [8cb637]: Support in useFragmentInternal by Joe Savona
  • [9125e2]: Support returning an interface in IdOf by Tianyu Yao
  • [a1ce49]: Schemagen should allow list items to be true non-null by Gordy French
  • [a726fc]: Add semanticNonNull support to generated schemas by Gordy French
  • [4a378d]: Add support for global custom scalars by Evan Yeung
  • [d3afbb]: Support @​deprecated annotation by Lynn Yu
  • [2efe7a]: Add support for fragment arguments by Evan Yeung
  • [ce4388]: Add test for conflicting arguments by Evan Yeung
  • [f239b7]: Add new relayresolver syntax to documents by Tianyu Yao
  • [b26951]: Disallow non-nullable return type by Tianyu Yao
  • [2152df]: Support attaching resolver fields onto Query by Tianyu Yao
  • [6ddd80]: Map Flow -> GraphQL Scalars in schema gen by Evan Yeung
  • [628b42]: Attach locations to parent types by Tianyu Yao
  • [884c96]: Resolve return flow types to their flow types by Tianyu Yao
  • [a1b186]: Unify processing weak fields by Tianyu Yao
  • [217eb3]: Unify processing rootFragment fields by Tianyu Yao
  • [5ee605]: Extract module for getting import and export by Tianyu Yao
  • [2a3c04]: Fix IdOf Flowtype by Tianyu Yao
  • [615020]: Add variable cycle detection by Jordan Eldredge
  • [bb6f7b]: Add correct root fragment information by Evan Yeung
And more

There were over 100 additional commits since our last release which have been omitted from this doc

v17.0.0: Version 17.0.0 Release Notes

Compare Source

Since our last release in January of this year, we've made many improvements to Relay. Themes include:

  • Improved correctness checking and validation
  • Additional editor features
  • Experimental features exploring error handling and nullability
Breaking Changes
Schema Validation

Relay compiler now runs spec-compliant schema validation against your schema including client schema extensions and Relay Resolvers. You can opt out of this feature by disabling validation in your Relay compiler config.

// relay.config.json
{
    //...
    "featureFlags": {
       "disable_schema_validation": true
    }
}

[ccc4465] by Jordan Eldredge

Edge Type Validation

We now validate that the names passed to directives like @prependNode and @appendNode are valid typenames. You can opt out of this validation with the following feature flag in your compiler config:

// relay.config.json
{
    //...
    "featureFlags": {
       "disable_edge_type_name_validation_on_declerative_connection_directives": {
          "kind": "enabled"
       }
    }
}

[53b2436] by tobias-tengler

Bug fixes
  • [f87e77d]: Fix MockPayloadGenerator for deferred fragments in lists by Fernando Gorodscy
  • [24b557a]: Use default values from mock resolver for Relay 3D payload by Andrey Lunyov
  • [59ff9c1]: Mark resolves as clean again if we reread their fragment and find data unchanged by Jordan Eldredge
  • [0d7a3d0]: Input fields with defaults shouldn't be required (#​4647) by Graeme Coupar
  • [7cc4f2b]: Check if condition on defer/stream fragments by Fernando Gorodscy
  • [05d64cc]: Update GraphQL parser to consume escaped characters by Monica Tang
  • [448aa67]: Fix Flow Types in RelayObservable by Jerry Francois
Improvements
Runtime Improvements

This release includes a new implementation of our hooks which are significantly more efficient in terms of memory use. Thanks to Dave McCabe for his work on this huge project.

  • [9f03ea5]: Make new useFragment implementation the default by Andrey Lunyov
Editor Integration Improvements

Huge shout out to community contributor Tobias Tengler for many improvements to our Editor Support via our VSCode extension. Our VSCode extension is powered by the relay-compiler so upgrading to version 17.0.0 of the compiler should unlock a number of great IDE features.

  • [dc2cb85]: Add code action to rename fragment (#​4697) by tobias-tengler
  • [68c7cca]: Add SchemaDocument go to definition LSP support (#​4669) by tobias-tengler
  • [8fd21e7]: Attach previous location to duplicate type diagnostic by Jordan Eldredge
  • [dd9d3a0]: Support inlay hints by Jordan Eldredge (Requires upgrading to v2.3.0 of our VSCode extension)
  • [964e078]: Activate LSP for schema and schema extension files (#​4652) by tobias-tengler
  • [bb41169]: Support go to definition for arguments (#​4605) by tobias-tengler
  • [bbddbf3]: Report errors if location provider fails (#​4588) by Jordan Eldredge
  • [964e078]: Activate LSP for schema and schema extension files (#​4652) by tobias-tengler
Compiler Performance Improvements
  • [232985f]: Parallel watchman queries for saved state and changed files by Gordy French
  • [ef22ae6]: Run schema validation in parallel by Jordan Eldredge
  • [a7984bc]: Speed up watchman_query_time_before_subscribe by Tianyu Yao
  • [acd17ec]: Use multithreaded zstd compression by Gordy French
  • [a7984bc]: Speed up watchman_query_time_before_subscribe by Tianyu Yao
  • [f7b030e]: Split a project into multiple chunks and parallelize by Tianyu Yao
  • [bafd56b]: Parallelize GraphQLAsts::from_graphql_sources by Tianyu Yao
  • [69dbfee]: Parallelize from_graphql_sources_map by Tianyu Yao
  • [ce12ecf]: Parallelize building schemas by Tianyu Yao
  • [586483e]: Parallelize from_file_source_changes by Tianyu Yao
  • [ee8523f]: Implement SchemaDocument path resolution (#​4639) by Tobias Tengler
  • [5f1eb8a]: Add path resolution for fragment arguments (#​4651) by tobias-tengler
  • [6601a35]: Speed up LSP requests outside of GraphQL by Evan Yeung
  • [a5a7947]: Incrementally build Enum schema changes by Evan Yeung
  • [ce6ea74]: Add go to definition support for type defined in variable definition (#​4629) by tobias-tengler
  • [2ba726b]: Add go to definition support for directives (#​4625) by tobias-tengler
Misc. Improvements
  • [29d9e55]: Add preferFetchable argument to the @​refetchable directive by Andrey Lunyov
  • [f45b35f]: New feature flag that will allow to opt-out @​fetchable types from the node query generation in @​refetchable by Andrey Lunyov
  • [9958e56]: Print raw response on persisting parsing error by Tianyu Yao
  • [9cf21af]: Integrate with Sapling or Git if they exist (#​4691) by Jon Janzen
  • [badd538]: Migrate relay hooks to hook-syntax by Alex Taylor (alta)
  • [349b5a8]: Use client schema extension enum values as source of truth for Flow types by Jordan Eldredge
  • [d3c8d1c]: Add feature flag for fragment arguments (#​4648) by tobias-tengler
  • [9e9428e]: Add support for ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE flag in the the new hooks implementation by Andrey Lunyov
Documentation Improvements
  • [acb227a]: Fix search on relay.dev (#​4715) by Paul O’Shannessy
  • [6b91a2e]: Improve compiler explorer (#​4698) by Jordan Eldredge
  • [4c5cd41]: Add docs for preferFetchable argument by Andrey Lunyov
  • [95010c8]: Relay: Update Obsolete Docs Reference to ReactTestUtils by Tim Yung
  • [51a82f6]: Document Relay Resolvers (#​4547) by Jordan Eldredge
  • [ff8e80d]: Update docs to clarify behavior of refetchable variables with nullable fragment reference by Jordan Eldredge
  • [76d6d77]: Demonstrate using custom scalar to replace RelayResolverValue by Jordan Eldredge
  • [05cf065]: Fixing minor typo in website (#​4673) by Jeshuran Paul
  • [906f5ed]: Relay docs: Fix shell script getting Prism'd as a JS comment by Robin Giese
  • [0109168]: Relay docs: Tutorial page should have proper title by Robin Giese
  • [ea2cbbc]: Fix typos in the Relay Resolvers docs by Evan Yeung
  • [dc36b48]: Fix typos in tutorial by Monica Tang
  • [14314f9]: Escape asterisks in README.md (#​4635) by Chris Morin
  • [ee03182]: Fix(docs): add instructions about installing watchman if necessary in the tutorial (#​4620) by Mark Feng
  • [1256e73]: Remove CodeSandbox Example by Jordan Eldredge
  • [b7f59af]: Chore(doc): improve relay compiler doc for persist (#​4608) by eMerzh
  • [8e557f9]: Fix typos (#​4597) by Kenneth Lum
  • [615c2d2]: Fix(doc): update config name following update (#​4596) by eMerzh
Experimental Changes

We are also continuing to evolve many experimental features which are not yet stable enough to be enabled by default in Relay.

Relay Resolvers

Relay Resolvers have been extended to support defining types which implement interfaces, and define resolvers that return client-defined interfaces where all implementing types are defined using Relay Resolvers. Relay Resolvers are now stable enough to have full documentation with instructions on how to enable them.

  • [ba5e48f]: Add model resolvers for interfaces by Monica Tang
  • [55b8716]: Return an interface with multiple weak concrete types from a resolver field by Monica Tang
  • [46879b4]: Multiple weak models implement an interface by Monica Tang
  • [98823ea]: Add model resolvers for unions by Monica Tang
  • [245602f]: Remove allow_legacy_verbose_syntax ParseOption by Lynn Yu
  • [cdab89f]: Remove ENABLE_CLIENT_EDGES runtime feature flag by Jordan Eldredge
  • [b26f3be]: Remove @​outputType feature flag by Monica Tang
  • [7ce13bc]: Remove LiveResolverStore from experimental export namespace by Jordan Eldredge
  • [f193cda]: Invert the default for emit_normalization_node_for_client_edges by Jordan Eldredge
  • [0cac319]: Define resolver on interface with weak types by Monica Tang
  • [6bda98c]: Make interface model resolver fields compatible with client schema extension-defined concrete types by Monica Tang
    Additionally, we are exploring the ability to extract Resolver type and field definitions directly from your typed JavaScript code, similar to how Grats works. This work is still highly experimental, only supported for Flow, and not yet fully functional. If you are interested in working with us to help bring this support to TypeScript, please get in touch.
  • [722b18f]: Better error message for using an optional flow type for strong objects by Tianyu Yao
  • [4267075]: Implement schema generation for weak object fields by Evan Yeung
  • [5d2fa70]: Prevent docblock parsing error for new resolver syntax in LSP by Tianyu Yao
  • [36802d9]: Properly support nullable strong return type by Tianyu Yao
  • [8e5c565]: Add "description" to Flow schema generation by Evan Yeung
  • [7e41583]: Fix passing empty documents to schema gen by Tianyu Yao
  • [8cce449]: A RelayResolverValue generic by Tianyu Yao
  • [0d1b5c2]: Add argument support for Flow schema generation by Evan Yeung
  • [95aaa48]: IdOf<> return type by Tianyu Yao
  • [5052062]: Support boolean by Tianyu Yao
  • [77a87be]: Add root fragment support to relay resolvers by Evan Yeung
  • [35f9763]: Pass fragment information to Flow schema generation code by Evan Yeung
  • [a8a41e2]: Treat existing resolve syntax fields as fields by Tianyu Yao
  • [16e28af]: Add @​live to Flow schema generation by Evan Yeung
  • [49563f1]: Fix incorrect error message for Relay Resolver missing function param by Evan Yeung
  • [24510ae]: Improve error messages for Relay Resolver schema generation imports by Evan Yeung
  • [433c93e]: Improve error messages for resolver schema generation by Evan Yeung
  • [d1749df]: Add weak type definitions to Flow resolvers by Evan Yeung
  • [8fa3d43]: Crate for extracting type information from JS definitions by Tianyu Yao
@​alias

We've added an experimental new directive to allow fragments to appear as fields. This can enable you, or optionally require you, to check if a fragment was fetched before using it.

Error Handling and Semantic Nullability

As part of our involvement with the GraphQL Nullability Working Group we are exploring features to enable explicit error handling and semantic nullability. Neither of these features are officially available yet, but we're excited about what will become possible here.

  • [af1f9de]: Disallow required on non-null and semanticNonNull fields by Gordy French
  • [56c099a]: Fix non-null-required validator's field traversal by Gordy French
  • [470c814]: Create CatchField for @​catch on Scalar by Itamar Kestenbaum
  • [38655ec]: Create CatchField for @​catch and throw unimplemented by Itamar Kestenbaum
  • [7bfd200]: Emit proper Flow for semanticNonNull RelayResolverValue by Gordy French
  • [88a6ff9]: Fix semanticNonNull levels support in resolver docblock by Gordy French
  • [c7d46c3]: Create CatchField feature flag by Itamar Kestenbaum
  • [696a1b3]: Support @​catch directive in RelayReader by Itamar Kestenbaum
  • [d1cf472]: Emit semanticNonNull in generated schema by Gordy French
  • [ddfa2b0]: Parse semanticNonNull from docblock by Gordy French
  • [145c788]: Add allow_non_null_resolver_fields feature flag by Gordy French
  • [[`cebc7f0

Configuration

📅 Schedule: Branch creation - "* 0-3 * * *" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 0eecda9 to 93a4e5c Compare March 24, 2021 16:15
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 93a4e5c to 2f7b44d Compare April 15, 2021 18:42
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 2f7b44d to 6daa91c Compare May 10, 2021 04:16
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 6daa91c to ae57ebc Compare June 7, 2021 02:38
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from ae57ebc to 0621202 Compare June 28, 2021 02:19
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 0621202 to 65ab648 Compare October 19, 2021 02:10
@renovate renovate bot changed the title chore(deps): update relay monorepo to v11 (major) chore(deps): update relay monorepo to v12 (major) Oct 19, 2021
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 65ab648 to 7c0e610 Compare March 7, 2022 11:41
@renovate renovate bot changed the title chore(deps): update relay monorepo to v12 (major) chore(deps): update relay monorepo to v13 (major) Mar 7, 2022
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 7c0e610 to 847f116 Compare March 26, 2022 12:43
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 847f116 to a2fa144 Compare June 18, 2022 19:30
@renovate renovate bot changed the title chore(deps): update relay monorepo to v13 (major) chore(deps): update relay monorepo to v14 (major) Jun 18, 2022
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from a2fa144 to a5393bd Compare September 25, 2022 12:11
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from a5393bd to 7116afe Compare November 20, 2022 17:20
@renovate renovate bot changed the title chore(deps): update relay monorepo to v14 (major) chore(deps): update relay monorepo to v15 (major) Mar 16, 2023
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 7116afe to cd4dd18 Compare March 16, 2023 13:58
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from cd4dd18 to a7e12bf Compare October 19, 2023 19:45
@renovate renovate bot changed the title chore(deps): update relay monorepo to v15 (major) chore(deps): update relay monorepo to v16 (major) Oct 19, 2023
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from a7e12bf to c76cfc4 Compare December 11, 2023 21:49
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from c76cfc4 to 774735e Compare January 23, 2024 18:27
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 774735e to c79e98e Compare June 15, 2024 00:45
@renovate renovate bot changed the title chore(deps): update relay monorepo to v16 (major) chore(deps): update relay monorepo to v17 (major) Jun 15, 2024
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from c79e98e to b01c4a9 Compare September 7, 2024 04:29
@renovate renovate bot changed the title chore(deps): update relay monorepo to v17 (major) chore(deps): update relay monorepo to v18 (major) Sep 7, 2024
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from b01c4a9 to 419812e Compare October 4, 2024 22:37
@renovate renovate bot force-pushed the renovate/major-relay-monorepo branch from 419812e to 923daf0 Compare November 21, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants