relay

Relay is a JavaScript framework for building data-driven React applications.

MIT License

Downloads
25.4M
Stars
18.4K
Committers
848

Bot releases are hidden (Show)

relay - Version 18.1.0 Release Notes

Published by captbaritone 14 days ago

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
relay - Version 18.0.0 Release Notes

Published by captbaritone about 1 month ago

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 D54206758: 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

relay - Version 17.0.0 Release Notes Latest Release

Published by captbaritone 4 months ago

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
    }
}

[ccc4465e6a47] 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"
       }
    }
}

[53b24361bb4d] by tobias-tengler

Bug fixes

  • [f87e77daecc4]: Fix MockPayloadGenerator for deferred fragments in lists by Fernando Gorodscy
  • [24b557adeb88]: Use default values from mock resolver for Relay 3D payload by Andrey Lunyov
  • [59ff9c18a84b]: Mark resolves as clean again if we reread their fragment and find data unchanged by Jordan Eldredge
  • [0d7a3d04d7a9]: Input fields with defaults shouldn't be required (#4647) by Graeme Coupar
  • [7cc4f2b3d36d]: Check if condition on defer/stream fragments by Fernando Gorodscy
  • [05d64ccfd279]: Update GraphQL parser to consume escaped characters by Monica Tang
  • [448aa67d2a11]: 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.

  • [9f03ea52fd86]: 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.

  • [dc2cb85aa820]: Add code action to rename fragment (#4697) by tobias-tengler
  • [68c7ccafb3ef]: Add SchemaDocument go to definition LSP support (#4669) by tobias-tengler
  • [8fd21e75648a]: Attach previous location to duplicate type diagnostic by Jordan Eldredge
  • [dd9d3a03e969]: Support inlay hints by Jordan Eldredge (Requires upgrading to v2.3.0 of our VSCode extension)
  • [964e078395a8]: Activate LSP for schema and schema extension files (#4652) by tobias-tengler
  • [bb411693d638]: Support go to definition for arguments (#4605) by tobias-tengler
  • [bbddbf3b97f3]: Report errors if location provider fails (#4588) by Jordan Eldredge
  • [964e078395a8]: Activate LSP for schema and schema extension files (#4652) by tobias-tengler

Compiler Performance Improvements

  • [232985faceaa]: Parallel watchman queries for saved state and changed files by Gordy French
  • [ef22ae64b431]: Run schema validation in parallel by Jordan Eldredge
  • [a7984bcaa7aa]: Speed up watchman_query_time_before_subscribe by Tianyu Yao
  • [acd17ec66ac0]: Use multithreaded zstd compression by Gordy French
  • [a7984bcaa7aa]: Speed up watchman_query_time_before_subscribe by Tianyu Yao
  • [f7b030ec69f8]: Split a project into multiple chunks and parallelize by Tianyu Yao
  • [bafd56b13719]: Parallelize GraphQLAsts::from_graphql_sources by Tianyu Yao
  • [69dbfee34449]: Parallelize from_graphql_sources_map by Tianyu Yao
  • [ce12ecfdfae8]: Parallelize building schemas by Tianyu Yao
  • [586483e8ef03]: Parallelize from_file_source_changes by Tianyu Yao
  • [ee8523f67d66]: Implement SchemaDocument path resolution (#4639) by Tobias Tengler
  • [5f1eb8a67d65]: Add path resolution for fragment arguments (#4651) by tobias-tengler
  • [6601a3566fdb]: Speed up LSP requests outside of GraphQL by Evan Yeung
  • [a5a794743d6f]: Incrementally build Enum schema changes by Evan Yeung
  • [ce6ea74fe225]: Add go to definition support for type defined in variable definition (#4629) by tobias-tengler
  • [2ba726b7ec69]: Add go to definition support for directives (#4625) by tobias-tengler

Misc. Improvements

  • [29d9e55d4183]: Add preferFetchable argument to the @refetchable directive by Andrey Lunyov
  • [f45b35fdd579]: New feature flag that will allow to opt-out @fetchable types from the node query generation in @refetchable by Andrey Lunyov
  • [9958e5616271]: Print raw response on persisting parsing error by Tianyu Yao
  • [9cf21af244b9]: Integrate with Sapling or Git if they exist (#4691) by Jon Janzen
  • [badd5382d241]: Migrate relay hooks to hook-syntax by Alex Taylor (alta)
  • [349b5a89503c]: Use client schema extension enum values as source of truth for Flow types by Jordan Eldredge
  • [d3c8d1c23300]: Add feature flag for fragment arguments (#4648) by tobias-tengler
  • [9e9428ed8dca]: Add support for ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE flag in the the new hooks implementation by Andrey Lunyov

Documentation Improvements

  • [acb227af0492]: Fix search on relay.dev (#4715) by Paul O’Shannessy
  • [6b91a2edaa8a]: Improve compiler explorer (#4698) by Jordan Eldredge
  • [4c5cd416e041]: Add docs for preferFetchable argument by Andrey Lunyov
  • [95010c852a2d]: Relay: Update Obsolete Docs Reference to ReactTestUtils by Tim Yung
  • [51a82f698aab]: Document Relay Resolvers (#4547) by Jordan Eldredge
  • [ff8e80d9c9a9]: Update docs to clarify behavior of refetchable variables with nullable fragment reference by Jordan Eldredge
  • [76d6d77532fa]: Demonstrate using custom scalar to replace RelayResolverValue by Jordan Eldredge
  • [05cf0658487f]: Fixing minor typo in website (#4673) by Jeshuran Paul
  • [906f5ed90b06]: Relay docs: Fix shell script getting Prism'd as a JS comment by Robin Giese
  • [01091686ab73]: Relay docs: Tutorial page should have proper title by Robin Giese
  • [ea2cbbc1d95b]: Fix typos in the Relay Resolvers docs by Evan Yeung
  • [dc36b48b8ec4]: Fix typos in tutorial by Monica Tang
  • [14314f9b66d7]: Escape asterisks in README.md (#4635) by Chris Morin
  • [ee03182fa054]: Fix(docs): add instructions about installing watchman if necessary in the tutorial (#4620) by Mark Feng
  • [1256e7391dc4]: Remove CodeSandbox Example by Jordan Eldredge
  • [b7f59afc4b74]: Chore(doc): improve relay compiler doc for persist (#4608) by eMerzh
  • [8e557f97105e]: Fix typos (#4597) by Kenneth Lum
  • [615c2d234ddd]: 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.

  • [ba5e48ff6a70]: Add model resolvers for interfaces by Monica Tang
  • [55b8716e0282]: Return an interface with multiple weak concrete types from a resolver field by Monica Tang
  • [46879b4f97e4]: Multiple weak models implement an interface by Monica Tang
  • [98823ea3d853]: Add model resolvers for unions by Monica Tang
  • [245602fb54eb]: Remove allow_legacy_verbose_syntax ParseOption by Lynn Yu
  • [cdab89f4e04d]: Remove ENABLE_CLIENT_EDGES runtime feature flag by Jordan Eldredge
  • [b26f3beff1a8]: Remove @outputType feature flag by Monica Tang
  • [7ce13bce108c]: Remove LiveResolverStore from experimental export namespace by Jordan Eldredge
  • [f193cda39782]: Invert the default for emit_normalization_node_for_client_edges by Jordan Eldredge
  • [0cac319f8546]: Define resolver on interface with weak types by Monica Tang
  • [6bda98c76956]: 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.
  • [722b18f5bfa3]: Better error message for using an optional flow type for strong objects by Tianyu Yao
  • [4267075e7c97]: Implement schema generation for weak object fields by Evan Yeung
  • [5d2fa70dc611]: Prevent docblock parsing error for new resolver syntax in LSP by Tianyu Yao
  • [36802d906946]: Properly support nullable strong return type by Tianyu Yao
  • [8e5c5657b887]: Add "description" to Flow schema generation by Evan Yeung
  • [7e4158376a33]: Fix passing empty documents to schema gen by Tianyu Yao
  • [8cce449a11c8]: A RelayResolverValue generic by Tianyu Yao
  • [0d1b5c2515e6]: Add argument support for Flow schema generation by Evan Yeung
  • [95aaa48412e2]: IdOf<> return type by Tianyu Yao
  • [505206292a32]: Support boolean by Tianyu Yao
  • [77a87be08419]: Add root fragment support to relay resolvers by Evan Yeung
  • [35f9763c565f]: Pass fragment information to Flow schema generation code by Evan Yeung
  • [a8a41e2634c7]: Treat existing resolve syntax fields as fields by Tianyu Yao
  • [16e28af78b47]: Add @live to Flow schema generation by Evan Yeung
  • [49563f144ff6]: Fix incorrect error message for Relay Resolver missing function param by Evan Yeung
  • [24510aeb2b29]: Improve error messages for Relay Resolver schema generation imports by Evan Yeung
  • [433c93e4d08e]: Improve error messages for resolver schema generation by Evan Yeung
  • [d1749dfef059]: Add weak type definitions to Flow resolvers by Evan Yeung
  • [8fa3d4355468]: 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.

  • [efab5ab09deb]: Complete @alias (#4699) by Jordan Eldredge
  • [868183c58f7b]: Refine @alias enforcement by Jordan Eldredge
  • [6aaa9ce0058f]: Add directive to opt out of @alias enforcement by Jordan Eldredge

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.

  • [af1f9deb5487]: Disallow required on non-null and semanticNonNull fields by Gordy French
  • [56c099abec6b]: Fix non-null-required validator's field traversal by Gordy French
  • [470c8147acc1]: Create CatchField for @catch on Scalar by Itamar Kestenbaum
  • [38655ecf3375]: Create CatchField for @catch and throw unimplemented by Itamar Kestenbaum
  • [7bfd2007c574]: Emit proper Flow for semanticNonNull RelayResolverValue by Gordy French
  • [88a6ff9418da]: Fix semanticNonNull levels support in resolver docblock by Gordy French
  • [c7d46c3621fc]: Create CatchField feature flag by Itamar Kestenbaum
  • [696a1b357096]: Support @catch directive in RelayReader by Itamar Kestenbaum
  • [d1cf4722e33d]: Emit semanticNonNull in generated schema by Gordy French
  • [ddfa2b0e131e]: Parse semanticNonNull from docblock by Gordy French
  • [145c788063e9]: Add allow_non_null_resolver_fields feature flag by Gordy French
  • [cebc7f0650ee]: Experimental support for @semanticNonNull (#4601) by Jordan Eldredge
relay - v16.2.0

Published by alunyov 9 months ago

Minor breaking changes

  • [4e68155d732b]: Reuse TypegenConfig for SingleProjectConfigFile (#4585) by tobias-tengler

This change is a breaking change, as the customScalars config option in the single-project config must now be specified as customScalarTypes.

Added

  • [40fe615ad6f8]: @preloadable Support (#4515) by tobias-tengler

Bug fixes

  • [b995eec40461]: Update config.ts for typo (#4594) by Orta Therox
  • [2f9e88affdc7]: Fix goto references for TerseRelayResolver (#4587) by tobias-tengler
  • [d513e42f881e]: Suspend on active promises for client edge queries in the new hooks implementation by Andrey Lunyov
  • [eb0b7fcd991c]: Cleanup outdated records after model/output type resolvers updates by Andrey Lunyov
  • [ece1fd953b98]: Fix SDLSchema replacing logic by Deepak Singh
  • [d90dedfc577e]: Replace invariant in SuspenseResource with the warning in the case where GC is disabled by Monica Tang
  • [9f135b8f92a7]: Fix path on Windows (#4544) by martin
  • [aac57b30e812]: UseFragmentInternal should suspend if environment changes and there is a query in flight by Andrey Lunyov
  • [00aabd00be72]: Fix client->client nullable model issue for PluralConcrete object output types by Monica Tang
  • [7b3b0779b570]: Fix client->client nullable model issue for SingularConcrete object output types by Monica Tang
  • [3873809c2df8]: Handle missed updates from the low-priority state changes in the new hooks implementation by Andrey Lunyov

Improvements

  • [0037d05c61d8]: Cleanup allow(unused_imports) by Cameron Pickett
  • [ada971e33838]: Disallow some read time features in mutation responses by Jordan Eldredge
  • [a2c7ed480e2d]: Relay-compiler diagnostic errors logging improvements (#4574) by Alex Coleman
  • [1a57f0832665]: FIX(Graphql): Add support for input with default values (#4540) by eMerzh
  • [2f97f25e53a1]: Consume LiveState from relay-runtime root in typegen by Jordan Eldredge
  • [182a86647000]: Fix missing space in diagnostic location print (#4573) by Alex Coleman
  • [5a18984e4155]: Refactor model resolver codegen to re-use build_reader_relay_resolver by Monica Tang
  • [1972913c2d12]: Augment corpus digraph logic to intake a vec of TextSource by Monica Tang
  • [06cb092ae28f]: Implement compiler command to get graphql text sources and program by Monica Tang
  • [1a06f3269985]: Use Parameters and indexed access type to extract PreloadParams by Sam Zhou
  • [5cf0af11be92]: Update print_schema to support ARGUMENT_DEFINITION and INPUT_FIELD_DEFINITION directives by James Wren
  • [4c25549bcb1a]: More strict selectors equal check by Tianyu Yao

Documentation Improvements

  • [8392b68a5137]: Document directives argument for @refetchable (#4520) by Daniel Lo Nigro
  • [8ef4b47e69d0]: Document current behavior of server edges returning null by Jordan Eldredge
  • [361d0b3fae9f]: Typo fix (#4561) by Randall Bennett
  • [921f2a8715a1]: Fix(docs): normalize local data updates doc (#4564) by Guilherme

Miscellaneous

  • [4619f9706d97]: Add a json output option by Tianyu Yao
  • [49e4da17abbc]: Make compiler results seriaizable by Tianyu Yao

Experimental Changes

  • [5718ca9fd9b2]: Transform to convert fragments and linked fields on abstract types to inline fragment by Monica Tang
  • [399bf9201eba]: 6/n - Add tests for errorResponseFields by Itamar Kestenbaum
  • [27a062376ce3]: 5/n - Add erroring on seeing relayFieldErrors by Itamar Kestenbaum
  • [12d169fc9c23]: 4/n - Add logging on seeing relayFieldErrors by Itamar Kestenbaum
  • [0a9d473edeee]: 3/n - Add RelayFieldError and rename RelayFieldError to TRelayFieldError by Itamar Kestenbaum
  • [914794c4ddba]: 2/n - Rename requiredFieldLogger to relayFieldLogger by Itamar Kestenbaum
  • [af4afbdc2ab3]: 1/n - Add field errors to Snapshot by Itamar Kestenbaum
  • [08c32cfede3b]: Integration test for resolvers implementing fields for interface by Jordan Eldredge
  • [396a1dbfb8cd]: Expose live resolver modules outside of experimental-live-resolvers directory by Jordan Eldredge
  • [bac5f9c790a9]: Update for normalization node changes by Bhuwan Khattar
  • [8dd004f4711a]: Add apply_to_normalization_ast config for resolvers_schema_module by Bhuwan Khattar

Full Changelog: https://github.com/facebook/relay/compare/v16.1.0...v16.2.0

relay - v16.1.0

Published by alunyov 10 months ago

Added

  • [b683e8c2c355]: Add validations for custom scalar arguments by Alex Danoff
    Enable flag 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.

Bug fixes

  • [b379edf30a6e]: Handle the document type change from Query to Fragment by Andrey Lunyov
  • [5ffcdbcf0114]: Fix missing validation for global variables in client-edges (#4513) by Andrey Lunyov
  • [8e0949d6d90a]: Apply fragment renaming to resolver fields by Jordan Eldredge

Improvements

  • [dfad61878904]: Fix types in RelayMockPayloadGenerator.js by George Zahariev
  • [24ef22b4946c]: Adopt conditional type for useRefetchableFragment related functions by Sam Zhou
  • [400cfa841445]: Refactor extra typegen config fields into TypegenOptions struct by Monica Tang
  • [e694ba8792a6]: Use conditional type to power EntryPointElementConfig by Sam Zhou
  • [1cc9d937ea1a]: Refactor extra artifact project config fields into extra_artifacts_config by Monica Tang
  • [cf0fb394dbb6]: Incremental build compatible ResolversSchemaModule by Bhuwan Khattar
  • [0d429f796e69]: Implement fmt::Display for SchemaChange by Monica Tang
  • [d48a0e025385]: Fix RelayResolverModel-test by Monica Tang
  • [ab92df525948]: Use placeholder in connection warning by Jan Kassens
  • [6519571a092a]: Shallow freeze resolver value by Tianyu Yao
  • [7f54255c92ea]: Do not mutate a shallowly frozen subtree by Tianyu Yao
  • [904924c6925b]: Add validations for mutation resolvers by Alex Danoff
  • [ef84550353b6]: Handle panics in integration tests by Alex Danoff
  • [5c7555b2c00d]: Expose Sink type from relay-runtime (#4516) by jaroslav-kubicek
  • [9e0acc1d8c77]: Improve test coverage for recycleNodesInto on deeply frozen data by Tianyu Yao
  • [6b89a29678ad]: Add normalizeResponse to MultiActorEnvironmentConfig by Bhuwan Khattar
  • [61c7bffac76f]: Regression test for mutating complex resolver values by Tianyu Yao
  • [22a3c89f9518]: Import ClientRequest for client only mutations by Alex Danoff
  • [3017057e77eb]: Only freeze plain JS objects and arrays by Tianyu Yao
  • [f90edc4cb52a]: Add regression test for fragment spreads with undefined global variables as arguments by Monica Tang
  • [8011e22b6043]: Add areEqualOwners to check for structural equality of fragment owners. (#4500) by Andrey Lunyov

Documentation Improvements

  • [e854fa04acfe]: Typos (#4532) by Michael Letcher
  • [06756209a4aa]: Fix typo in website/docs/tutorial/queries-1.md (#4522) by Priyansh Agrawal
  • [59f5d604bb43]: Fix typo in Relay Mutations & updates doc by Mingshi Yang
  • [a0b50ac400b4]: Add graphql operation naming and organization docs by Aaron Lichtman
  • [19970477942d]: Add blog post explaining how Relay provides unique value in data loading by Jordan Eldredge
  • [4668757a37e9]: Add back updating-connections to current doc by Tianyu Yao

Miscellaneous

  • [2863820b5000]: Export fragment type generation for FCL setup by Monica Tang
  • [4712bcc92e85]: Replace uppercase React import with lowercase one by Sam Zhou

Experimental Changes

  • [cf30bf4a3561]: Upstream resolvers_schema_module from fb-relay-compiler by Bhuwan Khattar
  • [05689b07f341]: Js_module_import_path -> js_module_import_identifier by Bhuwan Khattar
  • [a2c57d988bc2]: Consolidate __relay_model_instance definitions by Monica Tang
  • [4f7739ac3363]: Generate_schema_resolvers -> ResolversSchemaModule by Bhuwan Khattar
  • [400090b0ad8a]: Make LiveState and suspenseSentinel top level exports of Relay by Jordan Eldredge
  • [07a90ee56ab5]: Repro tests for resolver client edges to nullable models by Monica Tang
  • [5bbdfc92cd35]: Generate rootFragment normalization ast for schema_resolvers by Bhuwan Khattar
  • [70a5ff0b15c9]: Always pass an args object to resolvers that define runtime args by Jordan Eldredge
  • [3ee60181ff50]: Inject useFragmentInternal to use in useLazyLoadQueryNode by Andrey Lunyov
  • [aa64b588fff4]: Unsubscribing from resolvers before removing the record while runing the garbage collector by Leonel Fernandez Mir
  • [44227353d574]: Validate that field arguments passed to relay resolvers are defined by Monica Tang
  • [930864a33ede]: Deprecate verbose resolver syntax with feature flag to enable by Jordan Eldredge
  • [86dc27050b26]: Add regression tests for undefined fragment arguments in relay resolvers by Monica Tang
  • [00d621701622]: Add regression tests for undefined field arguments in relay resolvers by Monica Tang
  • [41a33a19331f]: Add regression tests for both field and fragment arguments in relay resolvers by Monica Tang
  • [0c70e547f27b]: Update normalization AST generation by Gerard Moreno-Torres Bertran
relay - v16.0.0

Published by monicatang almost 1 year ago

Breaking

  • Arguments passed to the filters keyword for the @connection directive will now throw if they are invalid instead of being a no-op. [2dd79543d3f6]

Flow-related breaking changes:

  • Explicit type annotations are no longer needed for commitMutation [603ce546741a] and useMutation [051e4694c20b].
  • Records can no longer be modified directly and can only be passed to utility functions such as those in RelayModernRecord.js. [21a896c54e63]
  • Added the 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]
  • [1d95ce251653] - Make React.Element fully opaque

TypeScript-related breaking changes:

  • Empty variables will now be typed as Record<PropertyKey, never> instead of as {} to represent an object without properties. [16910c948e9a] (#4404)
  • Nullable fields will now yield a union of the actual type, 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)
    • Update: We will leave the feature flag available indefinitely, or until we have an explicit solution to missing data. See this issue for more context.
{
  "language": "typescript",
  "typescriptExcludeUndefinedFromNullableUnion": true
}

Bug Fixes

  • [313d62d2e96f] - Don't assign to frozen objects and arrays
  • [a5e0ba35d72f] - Fix flow errors in the reactive executor and relay runtimes
  • [17f4abf1eb59] - Make isWithinUnmatchedTypeRefinement be set on a per-fragment basis
  • [33d5475eba9b] - Fix RelayObservable ifEmpty: Cannot access 'current' before initialization
  • [41233831f88c] - Do not freeze array buffer views
  • [a2c2b6453702] - Get compiler playground working again (#4336)
  • [04005db54643] - Replace invalid variable characters for import name (#4293)
  • [0fce632a4882] - Fix refetching and pagination when using a custom nodeInterfaceIdField (#4053)
  • [e784ee42756b] - Fix version number parsing in cannotReadPropertyOfUndefined__DEPRECATED (#4314)
  • [a79038b77b3d] - Fix some grammar in validation selection conflict error messages
  • [6f30869b2896] - Updating connection handler to be able to deal with streamed edges that are already in memory
  • [2699206e9757] - Always use / as path separators in generated artifacts (to allow stable compilation between windows and unix-based systems)

Experimental

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:

  • [bd95f00a1010] - Updates RelayResolvers docs to include terse syntax and updates to the module resolution details

Improvements:

  • [15c2715fc203] - Fix compiler issue with stale artifacts for Resolvers in watch mode (#4415)
  • [0b2791feeebe] - skip_redundant_nodes: do not mess with order of selections within inline fragments with client edge metadata
  • [77304c284152] - Add flag and validation for strict resolver flavors
  • [3d66ad8907e1] - Add artifact with schema resolvers
  • [998fd498a104] - Regression test for not detecting undefined variables on resolver fields
  • [556d696fe4e8] - Fix Relay Resolver typegen for Typescript-based projects (#4274)
  • [508dca3b96ce] - Add handleMissedUpdates to subscription callback
  • [c899a6817e15] - skip generating client edge queries for base project fragments
  • [bb50fdf624cf] - Support Graph Mode GraphQL response data processing
  • [c93322b9a6c3] - Add directives to the base project resolvers (types/fields)
  • [5d22d1c21031] - Show a helpful error if a resolver returns an interface with no implementors (#4428)
  • [a8dc8a93e5b1] - Retain description for terse resolvers
  • [64b707d9182d] - Set the cache as missing state when missed updates
  • [b09fd948822e] - Support for suspend after initial mounting for plural fragments
  • [f4bdd5ac6044] - Components can suspend after initial mounting
  • [900f40cae43f] - Update operation tracker for optimistic updates
  • [b2dcbfe56094] - Allow @required to bubble to client edge resolvers.
  • [b23fe58e3d04] - Split out method in RelayReader responsible for propagating resolver metadata
  • [fca7a9ca7ebd] - Catch errors thrown during .read()
  • [4a1d71df2fb0] - Log Required fields even if not missing data
  • [5dfb88bc1699] - Simplify what we keep in the store for resolver errors
  • [feaba45d5e93] - Validate that resolver fields are always nullable
  • [147498ffa8ed] - non-nullable __relay_model_instance
  • [6e4ff95b9e1d] - Unify handling of plural/nullabile resolver field types
  • [273223898436] - Reflect correct resolver type in test fixture
  • [f0e802a7c1f4] - Ensure incremental builds include all @rootFragment fragments
  • [6a80a0f1a74c] - Add runtime test validating plural @live field
  • [634725410363] - Fix bug where suspending @weak resolver values were getting normalized
  • [3c4479637d32] - Enable tsx extension on relay resolvers (#4303)
  • [a02b7065aae0] - Don't wrap nullish values returned from @weak model resolvers
  • [0fe2553a3aa9] - Allow legacy resolvers with @rootFragment on model types
  • [fd06faa7546a] - Preserve correct resolver path across client edges
  • [fccb3c850a2f] - Allow resolvers with @rootFragment on model types
  • [b4099fcb69df] - Type bug with resolverDataInjector and resolvers that accept args
  • [5c0a74092420] - Fix for @required on client edges
  • [ed612b84370d] - Add feature flag for operation tracking that would work with lazy React notification
  • [cf1650e4018c] - Log on LiveResolver batch start/end
  • [f7d62f4fb431] - When adding a concrete object that implements an interface to a schema, also modify interfaces

Improvements

  • [58da8063854c] - Allow configurable @defer/@stream names (#4467)
  • [c4618c6077a2] - Add support for copying field errors into the store
  • [9a96c6ad0f45] - Improve error message clarity
  • [4ffd869524df] - Add typescriptExcludeUndefinedFromNullableUnion to SingleProjectConfigFile (#4482)
  • [51fca35271f0] - Stabilize printing paths in fixture tests
  • [9c7b92a43e75] - Type-safe updaters for TypeScript (#4370)
  • [0bc414290036] - allow using provided variables with refetchable fragments
  • [38a08ed8c3b7] - Allow printing interfaces implementing interfaces
  • [1328fc1b0421] - Export node from assignable fragment (#4409)
  • [bacd1aef8d68] - Allow extending interface interfaces
  • [7ba63874bf05] - Add getFields() to RelayModernRecord
  • [a062e17047d6] - Extend multiple schemas in parallel
  • [699b0aba3605] - Improve fragment and fragment spread hover
  • [091a4f097250] - Allow ast_diff_in_doc drops machine readable struct
  • [99ce43f042ba] - Inject changed schema files when loading from saved state
  • [bc40b4be8eef] - Fix error message in UpdatableDisallowRelayResolvers error
  • [7a14de0dd614] - Extract type for RequiredFieldLoggerEvent
  • [95c54b496251] - Allow persisting to also include the query text for safe migration (#3917)
  • [de6594bf3e84] - Using opaque type trick to enforce nested relay entry point safety
  • [ce74006e245c] - Recommend Babel extension to fix VSCode syntax highlighting (#4324)
  • [d04c7bef8eb6] - MockPayloadGenerator support for @no_inline with args
  • [39ebc1c7d28b] - Avoid reusing AST nodes (#4309)
  • [35fea8837e6c] - Add parent node information when providing error about printing empty selections
  • [2108aed4c44d] - Add support for deferred fragments in MockPayloadGenerator

Documentation

Additions:

  • [356bc78ccb01] - Docs v15.0.0
  • [5df8aee44445] - Add blog post highlighting changes in Relay 15 (#4258)
  • [098a84e7f1da] - Add Réa to list of relay users (#4430)
  • [6e9e000642a4] - Build Wasm compiler explorer when deploying docs website (#3928)
  • [1ef73b25c5c9] - Update mutations-updates.md (#4424)
  • [563c5700d4db] - Update connections-pagination.md (#4423)
  • [8fcf1fcb8074] - update docs for missing field handlers (#4259)
  • [28776765d74a] - Add doc explaining client mutation ID and actor ID

Typo fixes:

  • [610806b2ece6] - Fix typo in testing-relay-with-preloaded-queries.md (#4405)
  • [3b9f90a2e1f4] - Fixed typo in refetchable-fragments.md (#4427)
  • [b998f9b65089] - fix(docs): remove duplicate text in MutationConfig.md (#4462)
  • [0d63f5ab3f2d] - Update documentation with corrected usage of useTransistion
  • [10f00e448545] - Fix typo in tutorial (#4444)
  • [555ebfd3d68d] - Fix link to an explanation of @raw_response_type usage (#4435)
  • [5450fcd96906] - Fix small typo in tutorial (queries-2.md) (#4398)
  • [6910c554f2cf] - Connections Doc Minor Typo Fix (#4369)
  • [34a35815077a] - Fixed a typo in the website tutorial (#4342)
  • [994276157f4a] - Fix typo in load-query.md documentation (#4106)
  • [7094921ee9a3] - docs: add missing comma (#4295)
  • [dc659dfce37e] - docs: Fix typo in getting-started/installation-and-setup.md (#4306)
  • [442d4943d8ae] - Fix typo in jest method name (#4271)

Tutorial updates:

  • [94745eea040b] - fixing guided tour page
  • [cba77649c396] - update fragment tutorial documentation (#4292)
  • [007eff0a68eb] - Link to persisted queries in tutorial (#4359)
  • [51fee1513e2b] - Fix TypeScript before continuing in tutorial (#4355)
  • [97cedbca1a1b] - Rerun relay compiler (#4288)

Other corrections:

  • [9eb274756274] - fix(docs): readInlineData function (#4451)
  • [0ce764a4aa60] - Remove flow-type parameters from Relay API references
  • [9a1ea37e1af3] - A full example of creating Relay environment in Relay Environment Provider docs
  • [5357c44b56be] - fix(docs): Error boundaries link points to React legacy docs (#4392)
  • [0bf353a3c9f0] - Update commit-mutation.md (#4346)
  • [7e42ea1df78e] - Fix invalid usage of useMemo() in docs (#4281)
  • [37ad7f260c5f] - Update fetch-query.md (#4296)
  • [d4319028f539] - Update advanced-pagination.md (#4264)
  • [2f38a11816a8] - Fix grammar error in the fragments page of docs (#4267)
  • [6ed82894fa33] - Update record method for filling in missing data docs (#4249)

Tooling

  • [392ea1f2d9ab] - Build compiler playground as part of GitHub CI (take 2) (#4470)
  • [5cadb4368f69] - Improve inline fragment suggestions for abstract types (#4453)
  • [f67e9c55efc8] - Make the Relay Compiler Terminal Transient (#4455)
  • [1ae14fe73701] - Add a subcommand to dump definitions to file
  • [3b96b01d25f1] - Enable goto def in LSP to goto the actual schema definition (#4434)

Miscellaneous

  • [d4ca7d919d04] - Add From extension AST to definition AST
  • [beb0e920a9fc] - graphql-syntax: add comments explaining FloatNode
  • [a55a3fa11777] - Add newtype for Union::name
  • [1c8917b179bb] - Make InMemory schema cloneable
  • [4d9f2552cdf8] - Level-based logging for graphql schema tools
  • [a203dc6e25dc] - Remove duplicated flow definitions from arvr/js
  • [48ce83af6968] - Update strum and enable the derive feature
  • [59912af0e759] - Remove unused method arguments (#4326)
  • [17d9f9f05a9d] - Remove Flight support in Relay Compiler
  • [5dd6914ea89a] - Create stand-alone PR to fix VSCode extension build (#4275)
  • [cc1daa18fb08] - Create shared mock for scheduler (#4313)
  • [f5c48cdd9369] - Relay: More Resilient cannotReadPropertyOfUndefined
  • [46fa2faf0ecc] - Remove experimental.abstract_locations config
  • [3073f1e4a588] - Add feature flag to log missing data using invariant in prod
  • [e2b85160a713] - Remove inference_mode config now that LTI is the default

Flow Changes

  • [92aaeafb9e06] - Add TRawResponse to useClientQuery generics to support @raw_response_type
  • [9b7e157c0295] - Strictify EntryPoint typing by making TPreloadParams invariant
  • [fe26a5eeb2da] - Fix flow suppression in buildReactRelayContainer
  • [79ba93388fde] - Suppress forwardRef flow error on WWW
  • [fdafa272e014] - Enable mapped type
  • [eb295569850d] - Replace $Call with ReturnType in flow typegen
  • [037a28fd6d21] - Make Props readonly
  • [f0dbef284b74] - Codemod $Shape to Partial in Relay files, suppressing errors
  • [f9cba52f6bdb] - Update setLinkedRecords flowtype
  • [e43a36913a28] - Extract events into named types (#4254)
relay - v15.0.0

Published by captbaritone over 1 year ago

Relay 15.0.0 Release Notes

Breaking

  • [6092ddbb48ec] Change signature of missing field handlers. Instead of accepting a Record (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-Only] usePreloadedQuery, useQueryLoader, useRefetchableFragment, usePaginationFragment, useBlockingPaginationFragment. Updates in runtime, React APIs for better integration with Flow: and a first class support for types in flow for graphql tags. [a75a445bb72c] [ef29f061fd3a] [78bd12d39562] [614c74718544] [ab9f04ab54ea]

Features

  • Editor Integration. Our VSCode Extension is powered by tight integration with the Relay compiler. The following compiler improvements improve the experience of using the VSCode extension:
    • [a6eb291e6919] Find field references for vscode extension
    • [96c71931178a] Feature: LSP Fragment completions (#4134)
    • [50266e1051c9] Warn on deprecated field and directive args
    • [8f1d9beecdde] Feature: Nested input type field completions (#4148)
    • [cbdec0bdfbd6] Add recursive implementing objects method
    • [d24c29512bb2] Show schema field description in LSP hover
    • [298af349bda7] Document __typename and __id in LSP hover
    • [c62cad9ed87b] Fix LSP completion icon for fields (#4131)
    • [7c06b6c6caf9] Fix: Field alias completions (#4135)
    • [233d41b61cd4] Add error reference link for unknown field error
    • [3b40fe55d222] Improve scoping of diagnostic location for duplicate queries/fragments
  • Improvements for Open Source contributors:
    • [ec91ebca7bdb] Validate compiler output in OSS (#4116)
    • [603bb4bc2927] Add script to regenerate rust fixture tests (#4182)
    • [b1c9de3758b8] Copy sort-imports rule to Relay's internal lint rules
  • [Experimental] Support of fragment argument syntax currently being proposed for the GraphQL spec
    • [b497aa363056] Add spread arguments to Relay Compiler AST
  • [Experimental] Relay Resolvers. A significant portion of our development effort since our last release has gone into developing Relay Resolvers (a mechanism for exposing derived data in the graph) and Relay Live Resolvers (a mechanism for exposing non-Relay client state in the graph). While the features are still experimental and not documented for public use we’ve made significant progress. Some highlights:
    • [9d3a87db15f9] Ability to define multiple resolvers per-file
    • [8dc927fb0f0d] Terser syntax allows defining most resolvers with a single line docblock
    • [3a151b45acb9] Model resolvers allow defining new GraphQL types that are backed by JS objects
    • [2e134d90fd27] Retain Relay Resolver data during GC
    • [fb96666b2277] Support resolvers that return plural @weak objects
    • [2bd97883486f] Support defining @weak types in docblocks
    • [f5467f2cad75] Allow live Resolvers to be batched
    • [cb052fc21fb2] Clean up go to definition for resolvers
    • [dae31595dd70] Fix LSP on Windows (#4160)
  • [e80d6ba6ba53] Compact GraphQL query text (#3983)
  • [e64db9b33f9a] Allow passing custom headers when persisting queries (#4066)
  • [44fe2bc5beb4] Don't print "default" project name in diagnostics
  • [10e20cc7344c] Update types for LoadMoreFn: use variables directly, do not extract them from query
  • [8a44673ef671] Adding support for client extensions in mock payload generator (#4030)
  • [9393fe5b75d9] Use relative to fragment location path for provided variables modules
  • [6acd8cbcdf42] Support import type for named imports in typescript
  • [c0d019844f3e] Handle missing fields in readUpdatableQuery/Fragment
  • [d00df5837570] Add support for refetchable interfaces
  • [f070bc1b4d76] handle removed schema files in the incremental mode
  • [bdf1a411e78d] Fix validate_selection_conflict and enable the optimization in relay
  • [ac5f397fbf5e] More updates to LoadMoreFn types in custom pagination hooks
  • [bd0c22a4d098] Log event when we find an operation to suspend on
  • [2e449af8f642] Sort CustomScalarImports in runtime artifacts
  • [470a5fbc525f] Add SDLSchema.get_unions() (#4036)
  • [aa261bf5e60c] Provide default to loadQuery TEnvironmentProviderOptions TParam
  • [8eea4aae67d6] Improve error messages related to @refetchable
  • [1802a7d72082] Emit forced type assertions for ESModules
  • [872a64f9a6f0] Sort types of interface when generating selections for abstract @outputTypes
  • [051d1c4766f5] Add non-fatal validation warnings to Relay's compiler
  • [4cea5ddbcf61] Add TRawResponse type to ClientQuery
  • [f8c1c2d08762] Report related locations in diagnostics
  • [bcf7d6f230cb] Use import type in typescript for all imports (#4029)
  • [831fa9064d67] Upgrade to Flow 0.201.0
  • [96df06766f0d] Export ProfilerContext in react-relay (#4049)

Bug Fixes

  • [9790484549b2] BUGFIX - pop errors in validate_selection_conflict
  • [6f248f12e877] Manually fix LTI errors
  • [196a57bbd106] Fix bug where resolved promise was being reused
  • [9582ec7270c8] Support Suspension of ReactRelayQueryRenderer
  • [121903dfa6de] Default FetchPolicy for Live Queries to "store-and-network"
  • [8d4900661d17] Add assignClientAbstractTypes to the DataChecker
  • [68b684693867] Fix suspense for client-only fragments that contains suspensible live resolvers
  • [8c11098fb0d2] Fix schema name resolution
  • [3cb041521244] ProvidedVariables and RelayResolver
  • [5799146e654f] fix moduleImportConfig support for single project configs
  • [585ad644c246] Quote key in literal object argument
  • [5ea0fb9a52e4] Do not use path in snapshots, they are different on windows. (#4101)
  • [4bc057128aa0] Fix printing nested condition nodes
  • [85ab73f6ffe2] Fix types of useRefetchableFragment/usePaginationFragment for data/variables with/without optional keys.
  • [5028b31b9a75] Strip extensions on file import paths when writing out TypeScript generated code (#4057)
  • [976e6ee58a1d] Modifying @relay_test_operation to write metadata for client fields (#4047)
  • [e2a7e9602c44] Fix printing repeated conditions
  • [ce5e1ed83c2d] Compiler incorrectly reports missing required fields (#4123)
  • [4ba3fe89b941] Import fragment types in typegen in non-haste setups
  • [54ba473e25b9] Fix duplicate field validation
  • [6d013387f27b] Fix scheduling bug that caused extra queries
  • [4d12002a892d] Stop generating js fields in query for 3D when local import is enabled
  • [39c774bccdb6] Don't treat generated fragments as dependencies

Misc

  • [98e77006af46] Validate against using Relay Resolvers in typesafe updaters
  • [963ada76b587] update to rust 1.64.0
  • [86e476dad737] Don't call schema.object 2x
  • [b17af8d962f8] Add Interface.implementing_interfaces
  • [689dcb170a75] Cleanup relay-flight-experimental
  • [e0d62b11db2a] Populate all types in flatbuffer schema
relay -

Published by mofeiZ about 2 years ago

Relay 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!

Added

[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

Fixed

[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

relay - v14.0.0

Published by alunyov over 2 years ago

What's Changed

Breaking Changes

  • [8bb7478a27d5] 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 these CLI arguments.
  • [44d68872f4de] Relay Compiler: Make 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.
  • [ed53bb095ddd] New compiler validation: Disallow __typename in fragments on query.
  • [20626f2c8501] Make __typename selections within concrete linked fields have a string literal type, instead of the type string.
  • [48ed515dd734] 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.
  • 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
  • Experimental: Relay Resolvers
  • [901d6570090b] Relay Compiler: Add JavaScript language to Relay Compiler Configuration.
  • [124435968e54] Support for client-only queries.
  • [80a66c9a828a] Support query variables in @inline fragments (#3933).
  • [271a1621ee6b] Support CommonJS for @no_inline (#3923).
  • [9e717658f00d] Add new enum CustomScalarType to represent custom scalar types in the Relay compiler configuration.
  • [e73b95f5e232] Add new option to support compiling a single project (#3868).
  • [2a9f17f2b3db] support sha256 and md5 for local file persister (#3878)
  • [5e3c7b6d4f41] Build linux arm64 (#3882).
  • [23b4cacf1bd2] Expose Relay schema Extensions (#3859).
  • [f199ededc8a2] Relay Compiler: Enable updatable fragments.
  • [58b335e9b3f8] Relay Compiler: Allow single project configs to specify feature flags (#3840).

Fixed

  • [e8c9ffe8ded7] Relay Compiler: make LocalPersister include trailing newline (#3938)
  • [384315d7fd55] Report schema location for invalid types (#3924).
  • [141ef0fc4f1d] Avoid bug where watch mode can get stuck in invalid state (#3922).
  • [c48bda9f14f8] Ignore BOM when lexing (#3908).
  • [6cff97d75557] declarative_connection: allow interfaces or objects.
  • [52af6a65c526] Don't flatten fragment spreads with differing directives
  • [5a9d42e62c02] Fix incorrect type generation with @required on plural fragments.
  • [739009f649cd] remove DEPRECATED_GraphQLSubscriptionConfig type.
  • [928728a3ad9f] Relay Compiler: Detect cyclic @inline fragments.
  • [eb0fc26f8483] Hooks: Fix useMutation inFlight race condition (#3841).
  • [2101a7991ff8] Relay Compiler: Sort locally persisted operations (#3835).
  • [9f0dea4ff305] Relay Compiler: Sort unions conditionally.
  • [b04b2b71b3b7] Sort object members in type generation (conditionally) (#3808).
  • [bb7c65fa3268] Relay Compiler: Handle spaces between graphql tag and template. literal.

Improvements/Misc

  • [9556f2fffc46] Persist explorer state in the URL/local storage (#3930).
  • [dd4805753494] Performance optimizations in selection conflicts validations.
  • [bb8721f2f97d] Quote key names in complex type field argument literals.
  • [4e2030f367ba] Add FAQ page to docs.
  • [c6ecd527ac97] Print fragment variables.
  • [7b6e7f5f47ff] Track directives on argument definitions.

Full Changelog: https://github.com/facebook/relay/compare/v13.2.0...v14.0.0

relay - v13.2.0

Published by voideanvalue over 2 years ago

Added

  • [0c59b5a3731] Tear out the DELAY_CLEANUP_OF_PENDING_PRELOAD_QUERIES experiment
  • [7207485b8d5] Parse Resolver Definitions from docblocks
  • [a2285b88b77] Create a separate ArtifactContent variant for UpdatableQuery
  • [b211acf401b] Add interface that implements interface to test schema
  • [6565c7c3e46] Document Relay Resolvers
  • [e21d89ea004] always enable ENABLE_QUERY_RENDERER_OFFSCREEN_SUPPORT
  • [5172d1b02f9] Rust crate for pruning fields from type schemas
  • [fde6ec615b5] Start considering docblocks in LSP
  • [e97263f96d5] Support index with suffixes when validating module names (#3805)
  • [d5fadad9c4e] Make path a non-optional field now that we've rolled out the compiler…
  • [2e5799d5493] Include React 18 in peerDependencies (#3829)

Fixes

  • [a8fd33de702] Added tests that show nested fragment bug (1/2)
  • [a2037ae78c1] Patch edge case: add provided variables to relevant root operations
  • [4801f2b6660] Use default language in CliConfig
  • [d794a41dd26] Fix off by one error
  • [d48778c9486] Add test case for @ module and provided variables (1/2)
  • [8707399a167] Patch for SplitOperation and provided variables (2/2)

Improvements

  • [01a4499b9c4] Make readUpdatableQuery docs match copy in previous docs
  • [be382cfd4ad] docs: add graphql-ws as a websocket client (#3245)
  • [86e2580d21e] Use $fragmentType instead of $ref in docs
  • [5c1e15b9dcd] Clarify that we are watching not waiting
  • [c978b9770b6] Guard against invalid saved state
  • [e6fc28ada37] add directives support to @argumentDefinitions in graphql-ir
  • [74df20caf55] Update internalAct
  • [4a8ecea1af4] Attach location information to missing field diagnostics
  • [9c9c97812b2] Implement get_all for all IncrementalSources
  • [fa83f1eafda] disallow warnings/errors in QueryResource test
  • [a552532ac3a] Expose ability to extend objects after the schema has been created.
  • [bdbc736710a] Allow marking Relay Resolvers as deprecated
  • [bfe0e65790a] Use better location for invalid Relay Resolver root fragment
  • [1e923be977a] Move suggestion_list to schema
  • [6e8b52f6575] Avoid panic when a query consists of only client extension selections.
  • [453fb0bfd84] Simplify and improve converting common::Location to lsp::Location
  • [095135f0d4a] Remove special handling for go-to-def for Resolvers
  • [dbe2c9f73f8] Support Relay Resolvers on interfaces
  • [21a89d731ed] Suggest alternate type/interface if you pick one that does not exist
  • [764af24d78b] Provide code actions to fix a typo on the interface/type of a Resolver
  • [3da1c01cc4b] Targeted error message/code action when mixing type/interface
  • [635705675f7] Add suggestions with code actions when you typo a fragment name
  • [ee5da1e6230] Add path to Resolver codegen nodes
  • [5b259b118f6] use scoped $FlowFixMes
  • [f01cad28834] Improve hover message for Relay Resolver Fields
  • [47d9d20200d] Catch errors thrown by Relay Resolvers
  • [b8e78ca0fbb] update useLazyLoadQuery docs to remove type argument
  • [7fc1e543722] Report syntax errors on type (without waiting on save)
  • [32d17fa8e89] Refactor RelayModernEnvironment to access the network via public methods
  • [d743943ca74] Avoid duplicate output in the compiler CLI
  • [92bf54779bd] remove unnecessary getRequest calls

Misc

  • [ebf30bbd487] Remove dead QueryResource Suspense handling
  • [ebce9eb7f68] Remove redundant assertions from QueryResource tests
  • [00b9012398e] Rename and move RelayResolverMetadataSource → DocblockSource
  • [b565fc56ab7] Avoid unused type params
  • [2177e00af51] Make SourceSet and ProjectSet iterable
  • [77f4f791a49] Return docblock sources as part of extract
  • [035e29fb948] Add location to docblock AST
  • [d6ee691846b] Remove unused QueryResource cache APIs
  • [0308bfaf34e] Dedupe selections in react codegen
  • [e3da29b22f9] use disallowWarnings from test utils
  • [80e621f4417] Use disallowWarnings in `FragmentResource with Operation Tracker and …
  • [6ef14e55451] Sub out a crate responsible for parsing docblock AST into information…
  • [559cbb78c45] Parse docblock to ir struct
  • [e4237b386e5] Derive a schema AST from Resolver IR
  • [0cfdd54d432] Use disallowWarnings useBlockingPaginationFragment-test.js and
  • [37387839eb3] disallow console.error
  • [880c82c3347] disallow errors/warns in useLazyLoadQueryNode-test.js
  • [e8b5596cabc] Track embedded source indexes explicitly
  • [7687c7ae86e] Improve test output for relay-docblock
  • [72622e5e88b] Merge SourceSet and ProjectSet
  • [ffce58072b3] Model ProjectSet as a newtype vec
  • [ebf30bbd487] Remove dead QueryResource Suspense handling
  • [6f95ab78616] Update transform test to use source location
  • [9cd3331e569] Cleanup compiler feature flag to enable parsing docblocks
  • [d0806d46982] cleanup ENABLE_QUERY_RENDERER_OFFSCREEN_SUPPORT feature flag
  • [6216580476a] Show guide in internal docs
  • [98162d36249] Add homepage banner in support of Ukraine (#3824)
  • [62f6457cfc3] cleanup usage of interface type for UploadableMap
  • [e2d53b4a54f] cleanup usage of interface type in MutationVariables
  • [625370e2cbb] cleanup usage of interface types
  • [5a7646e0cb3] add disallowWarnings to LazyLoadEntryPointContainerDEEPRECATEDTest
  • [4f3c83cccae] Disallow error/warn in some tests in relay-hooks
  • [605e366622e] Disallow warn/error in loadQuery test
  • [36013ae0b4d] Make SourceText generic
  • [d8530106d08] Move Span::to_range() to TextSource
  • [e75b9094bb0] Port NoFragmentCyclesRule
  • [e02717cb44d] Add a persister for Instagram(distillery)
  • [a758c0deb24] remove unnecessary getFragment calls
  • [83136765cae] small followup cleanup for getFragment/getRequest
  • [3497ce7f963] Shared implementation of disallowWarnings and disallowConsoleErrors
  • [91feecfd489] remove rollout flag for @relay_flow_enum directive (4)

Experimental

  • [b430570ccc3] Add readUpdatableQuery_EXPERIMENTAL docs about updating linked fields
  • [874ca73ddae] Add optional feature flag to parse docblocks
  • [d2d2d1f2618] React Cache: useLazyLoadQuery and useFragmentInternal implementation
  • [ca31ec10a48] add rollout flag for relay_flow_enum_directive to compiler (1)
  • [3070fa3150c] Fork RelayModernStore and add test
  • [03afd5ea45c] Fork ResolverCache
  • [43c8e82a95c] Sketch out External State Resolvers
  • [e8019de7e9d] Emit different types and Reader AST for Relay Resolvers with @ LiVe in…
  • [8d23f5a1af7] Add new node type for live resolvers.
  • [af7a254c33a] Start to adopt new Reader node type
  • [220c7290389] Rebrand External State Resolvers to Live Resolvers
  • [20208b12632] Add rollout option for sorting typegen output
  • [c7cb886d5b4] Add a ConcreteUpdatableQuery variant to GraphQLTag
  • [2faed63e73e] Do not generate unused ASTs, params for updatable queries

Full Changelog

https://github.com/facebook/relay/compare/v13.1.1...v13.2.0

relay - v13.1.1

Published by alunyov over 2 years ago

Fixed

  • [b23570e3552] Restore live query in non fb_only (#3790)
  • [af262699b0c] Expose 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

relay - v13.1.0

Published by kassens over 2 years ago

Misc

  • [0ad48b395ef6b2163c73f4c48da5e7e18f359ada] removes old aliases in generated files by default. This can be restored temporarily with the compiler config "flowTypegen": "Compat" but projects should migrate to using the updated names (e.g. MyFragment$fragmentType instead of MyFragment$ref.

Full Changelog

https://github.com/facebook/relay/compare/v13.0.3...v13.1.0

relay - v13.0.3

Published by alunyov over 2 years ago

Fixes

  • [052cf7283cb] [e2888b9c0dc] Documentation Improvements
  • [c12b08cb239] Try to fix validateMutation for __isX fields
  • [2ec85b803d7] Fix null comparison for skip_printing_nulls (#3784)
  • [5a16a250ad3] Fix import fragment spread in @raw_response_type
  • [3e499ed2526] Add test to repro weird @raw_response_type behavior

Improvements

  • [6be20cb620b] Add a JSON file query persister strategy to relay-compiler (#3666)
  • [f30289fef0d] Print directives on query variable definitions
  • [3c701233f37] Remove unnecessary null values from metadata (#3626)
  • [f8123fd31e7] Update non-mutation documentation
  • [0b5a8b97b4c] New file category: Ignore. To keep some files in __generated__ (or in artifactDirectory) directories
  • [e5acd860aff] Easy content changes to relay mutation docs

Misc

  • [d7f3efc3271] Bump parking-lot to version 0.12.0
  • [7a3861f2657] add prctl 1.0.0
  • [45126dfef63] Remove worker_count from the OperationPersister interface
  • [da917c9e371] Deploy 0.171.0 to xplat
  • [6649f5f9c8c] Daily common/rust/cargo_from_buck/bin/autocargo
  • [becedd92de6] Intern RelativePath using intern::PathId
  • [2a064054aa9] Fixed Repository Reference in monorepo package.json files (#3467)
  • [0007a66c81d] Update indexmap to 1.8.0
  • [1e51356cf00] Change ImportStatements → TopLevelStatements

Experimental

  • [a2fdae5938d] Stub out Docblock Parser
  • [8ece9fc2943] LSP: Change default response error code to avoid blocking codeactions
  • [5fd50591af1] LSP: Fix a on-hover message
  • [c29ee16bb07] LSP: Reuse complete func in relay-lsp
  • [ef3efc641ab] LSP: Attach field type in detail field
  • [690d51114be] Provided Variables: Add to docusaurus
  • [9e60e09fcac] Provided Variables: Remove duplicate definition in generated artifacts

Full Changelog: https://github.com/facebook/relay/compare/v13.0.2...v13.0.3

relay - v13.0.2

Published by alunyov over 2 years ago

Fixed

  • [0f842787859] Update v13 docs with recent fixes
  • [d745bdfbb41] Check for existence of global before usage (#3646)
  • [03ed79cbe78] Add support for .gql file extensions for schema files
  • [c594f26e3ee] LSP: Fix sending code actions for incorrect code location
  • [96f8d0da625] fix error message source location (#3745)
  • [8ab1167e903] remove pattern filtering in glob_file_source, change it to walk_dir_file_source
  • [a7f125b308d] Update startCursor and endCursor in Connections.md spec (#2655)
  • [8ac91d7e978] use import instead of require if eager_es_modules = true
  • [f1435c3e3fd] Add build for linux-musl target (#3754)
  • [f82885c1686] Fix grammar error (component access => component accesses) and change fancy ' to simple '
  • [e2eb89ed738] Remove unused import from example (#3747)
  • [1a81c5ec641] Fix small warning in an example from the step by step guide (#3746)
  • [74c7ca62c30] Make clientid field readonly

Improvements

  • [6f9bb960aab] Added ---validate CLI option (#3771)
  • [cce915c70c7] support providing schemaConfig in single project config files (#3777)
  • [d4d98e48399] Make compiler transforms customizable and applied as a Vec of Transforms (#3701)
  • [449bb89b40a] Replace env_logger by simplelog (#3763)
  • [c88609f705d] add support for multiple warnings in relay-test-utils
  • [34380d127b8] Add defaults to persistConfig.params
  • [4013efffb17] Use Semaphore to limit number of concurrent requests when persisting (#3736)
  • [31c156a5658] remove duplication in deprecated mutation/subscription types
  • [490a77f6589] Use id field name from schema_config in relay-typegen
  • [c564ce3dcae] Improve Persisted Queries documentation (#3512)

Misc

  • [dbe0cbb69ed] update relay to clap3
  • [c2588c778fc] automatic update for shelljs@^0.8.5
  • [3328e8dda6e] automatic update for [email protected]
  • [edd3214473b] Run npx prettier on README files
  • [436a084dd3c] Deploy v0.170.0 to xplat
  • [aa73c44f544] Start separating out code which determines where files live
  • [11c20f5ff26] Moved fb-only unit tests out of oss
  • [5325cda67b5] Update tokio to 1.15
  • [e4919b17689] Upgrade console to 0.15.0
  • [84868c1948a] move more Relay error messages out of graphql-ir
  • [ed3e82d536e] Bump nanoid from 3.1.23 to 3.2.0 in /website (#3769)
  • [4699f678da7] added validation for operation variable names
  • [699d33cfcde] move Relay error messages out of graphql-ir
  • [0c4108d630d] Make loadEntryPoint from Relay unwrap es6 modules with a default export from a JSResource
  • [010b781d14a] write operation aggregate type in final phase
  • [1fc8122ba19] small refactor in codegen
  • [05ce2e0660c] Update Cargo.lock (#3767)
  • [d9d8783ec7c] update fixture-tests to clap3
  • [2cdc4240636] Enum changes are breaking changes
  • [e01b84041c7] export path_for_artifact from relay-compiler
  • [2e3089c2163] unit test for warnings testing util
  • [128d00b5fbe] Bump shelljs from 0.8.4 to 0.8.5 in /website (#3751)
  • [857a579caa5] Bump follow-redirects from 1.14.4 to 1.14.7 in /website (#3752)
  • [9ebec17f0fb] Custom project config from fixtures
  • [df9621abcf7] Daily common/rust/cargo_from_buck/bin/autocargo
  • [97a0e95d742] Add fb_only features flag to unit-tests in CI (#3741)
  • [9dab3ffd344] Remove default fb_only flag on Relay transforms
  • [720f652f31f] impl std::fmt::Write for FlowWriter and TypescriptWriter

Experimental

  • [a70cd064379] Add quickfix for @waterfall directive
  • [9ac65f9553d] Require adding @waterfall to Client Edge fields
  • [512583441dc] Fix issues with @requiredwithin Resolvers
  • [454de5bbad3] Provided Variables: Changed function signature
  • [c844a5ba76b] Allow runtime to check @required resolver values
  • [88093de09ab] Warn when a provider function returns different values across calls
  • [d543a7a516a] Provided Variables: Errors for provided variables with conflicting types or modules
  • [309c17ca4c4] Provided Variables: Add DiagnosticsResult to transform
  • [[ebc6c95b166] Rename provided variables using module name
  • [ccde4f790a2] renamed variables in test fixtures
  • [ee374c8e2f0] Ignore field handles for now
  • [f699664f777] Expose metadata about the transformation
  • [3a83ed431fd] Assigning undefined to a singular linked field should not assign null
  • [89d38a0d536] Also explicitly make js a non-updatable field
  • [8da45b00c04] For concrete assignable fragment spreads, always select __typename
  • [d17c0e5920f] Add unit tests for fragment spreads with abstract type conditions
  • [64fb54823ec] Generate correct flowtypes for linked field setters
  • [a1221c1a8f9] Enable @required for Relay Resolvers
  • [d4ab8a1c1b9] Fix binary search in flatbuffer schema
  • [a2b12fd25f5] Introduce assignable fragment validators

Thank you to all contributors who helped with this release!
Special thanks to @ch1ffa for adding many valuable fixes and improvements!

Full Changelog: https://github.com/facebook/relay/compare/v13.0.1...v13.0.2

relay - v13.0.1

Published by alunyov almost 3 years ago

Added

  • [4fd06d12a26] Add repersist cli flag (#3722).
  • [c28a45937f0] Added relay video from React conf 2021 (#3716).

Fixed

  • [dcf2098c642] Typing of fetchQuery to use Query type.
  • [1357c25926f] Ignore target in crates folder (#3723).
  • [b5add1e0369] Fix eagerEsModules flag in babel-plugin-relay (#3724).
  • [c7ca8f5d763] Warn for field extensions in config.

Experimental

  • [378104f341c] Test in RelayResponseNormalizer.
  • [77073a22a96] Runtime: add provided variables into network layer.
  • [f327738d33e] Runtime: inject provided variables into OperationDescriptor.
  • [e8bf0b68bb2] Always allowing setting data.linked_field = null, even if the linked_field contains no fragment spreads.
  • [4176c0e55c1] Renamed function allRootVariables -> withProvidedVariables.

Misc

  • [ea06433be93] Using new object! macro where appropriate.
  • [e10dba54b46] Bump copy-props from 2.0.4 to 2.0.5 (#3731).

Full Changelog: https://github.com/facebook/relay/compare/v13.0.0...v13.0.1

relay - v13.0.0

Published by alunyov almost 3 years ago

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.
      • 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 for graphql 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:


Changes since RC.2

Added

  • Allow Node interface id field to be configurable. (#3638)
  • [2ea681cc15e] Add FlatbufferSchema.has_type()

Fixed

  • [995bb871389] Add include option to single project config file, and warn if it is used.
  • [504b5a893fd] add serde(alias = "exclude") to SingleProjectConfigFile
  • [f0d7395db58] do not panic if query_type is not defined
  • Update refetching-queries-with-different-data.md (#3714)
  • [e0911d6443a] update doc references to renamed props
  • [e959f5ce37d] fix typo in fetch policies
  • [ed24f9d55f9] fix unused variables lints in relay-runtime
  • [a93d9223121] fix test utils for ResolverFragments

Misc

  • [e0751072c72] Update copyright headers from Facebook to Meta
  • [f16b8dab49f] workaround rust-analyzer bug
  • Remove outdated dependecies from package.json (#3712)
  • [1f0191065b5] Update generate_fixture_tests component on FBS:master
  • [e31cac77f99] auto lint fixes
  • [ebfa5b166a7] autocargo: ctp: depend on pxl instead of re-declaring its crates
relay - v13.0.0-rc.2

Published by alunyov almost 3 years ago


To install this version, run:

npm install react-relay@dev relay-runtime@dev
npm install --save-dev relay-compiler@dev babel-plugin-relay@dev

Or using yarn:

yarn add relay-runtime@dev react-relay@dev
yarn add --dev relay-compiler@dev babel-plugin-relay@dev

Fixed

  • [b0c5a84de58] Remove runtime feature flag for @required
  • Correctly extract module names on windows (#3694)
  • [1b30d824171] Use WalkDir to find files if watchman is not available
  • Allow default args on required fields (#3612)
  • Stop @preloadable Typescript code generation from emitting an inline require (#3685)
  • Clean the recordsource in mockClear (#3687)
  • Respect excludes when using glob (#3688)
  • Watch js,jsx files with watchman with typescript (#3684)
  • [863c2301aac] Fix incremental mode bug about undefined operation variable
  • [a1f7aba0494] Matching compiler config and babel plugin options
  • Fix the links of the GraphQL Cursor Connections spec (#3704)
  • Fix markdown in graphql-subscriptions.md (#3702)
  • [18305a101ac] Add fb_only feature for subscription/live query transforms
  • [95f1ed81a54] Update error message for invalid paths in config
  • [b18251f90bf] Update Cargo.toml version when publishing main to NPM (#3709)

Improvements

  • Add default exclude paths for multi-project config (#3693)
  • Add readme files to packages (#3689)
  • [a8b9c2c1d6a] add overloads for Flow integration to useFragment
  • [73d39b085e0] Switch to faster hasher for maps/sets
  • Change 'three' assumptions to 'two' (#3654)

Misc

  • [e72ea12c746] Store connection_interface on the project_config
  • [e8dfee9ac1b] Update type emission docs
  • [8e041d3c298] Update dependency of [email protected]
  • [b9adc815bc8] Run build for the test project in github actions (#3696)
  • [5baad8ca214] Move ProjectConfig and some other things to relay-config
  • [c49cb86824d] Upgrade to parking_log 0.11.2 and add feature send_guard
  • [3c45f95763e] typing for useLazyLoadQuery
  • Rebuild OSS test project to use the new flow-typing (#3691)
  • [d4d5f67e734] simple cleanup to bubble errors up
  • [3f8e1c6df7c] Fix typo (nullalbe->nullable) and failed markup section formatting
  • [c4321e3bb2d] extract generated type code to module
  • Bump algoliasearch-helper from 3.4.4 to 3.6.2 in /website (#3652)
  • [14550c8bd80] update license headers
  • [6de307c8fd6] use relative imports inside of relay-runtime
  • [4109d4ad3df] Typegen Config: Rename Phase4 -> Compat, make it default

Experimental

  • Typesafe Updaters: Add support for client schema extension fields. Typesafe updaters is an unreleased, experimental project to provide a more ergonomic, typesafe interface for writing updaters.

    • [30995390857] Rename fragments from Updatable_x to Assignable_x
    • [09fd08589c4] Add assignable fragment with abstract type to unit test
    • [59c9bc01c1d] Move transform_assignable_fragment_spreads to its own module
    • [45913fccb7f] Add support for client schema extensions in readUpdatableQuery
    • [9a9dc85c3f9] Assert that readUpdatableQuery throws when encountering client schema extensions
    • [24bab365ff2] Rename methods, etc. related to typegen for clarity

relay - v13.0.0-rc.1

Published by alunyov almost 3 years ago

To install this version, run:

npm install react-relay@dev relay-runtime@dev
npm install --save-dev relay-compiler@dev babel-plugin-relay@dev

Or using yarn:

yarn add relay-runtime@dev react-relay@dev
yarn add --dev relay-compiler@dev babel-plugin-relay@dev

Fixes

  • Evaluate custom scalars first (#3671) [a0160e80ccb]
  • Generate exact imports when using CommonJS and artifactsDirectory (#3675) [bc03126af3a]
  • Update the way we handle different paths in single project config file. [6eea5a8c97f]

Improvements

  • Do not gate required directive behind feature flag [964b2e4d81f]
  • Update compiler installation instructions [b67bb55f958]
  • Update persisting docs [15aacb091f9]
  • Add MacOS ARM64 build target to relay-compiler for better M1 Mac support (#3667) [dea3f325ba4]
  • Fixed example of 'Refreshing Fragments' (#3664) [f9065653593]
  • Move updatable fragment errors into own module [a961cf410d5]

Experimental

  • Provided Variables
    • Add JS module 'require's into generated artifacts [df7335a2b76]
    • Fix provided variables bug in transform [390bf1a55b2]
    • Renamed provided variable directive [7930ab7bd56]
  • GraphMode
    • Handle more node types [7730a5ba299]
    • Add utility to insert GraphMode into a MutableRecordSource [03647ab63d9]
    • Support more node types in transform [65bf22fa45d]

Misc

  • Use cosmiconfig instead of relay-config (#3678) [4c5ddec8f3d]
  • Remove relay-conifg (#3677) [46a408488a4]
  • Move validation messages out of graphql-ir [d92b9e55814]
  • GitHub Actions: remove redundant tag check [609f32b381c]
  • Shorten codegen code with object! macro [9157236cd7a]
  • Convert more of build_ast.rs to use object! macro [eb45f66e88d]
  • Remove publish_packages, this is moved to GitHub Actions [a4d3c2c6bdf]
  • Update itertools to 0.10.3 [f3f3ebb1d66]

relay - v13.0.0-rc.0

Published by alunyov almost 3 years ago

The one with compiler implemented in Rust.

For reference, see the issue: https://github.com/facebook/relay/issues/3180

To install this version, run:

npm install react-relay@dev relay-runtime@dev
npm install --save-dev relay-compiler@dev babel-plugin-relay@dev

Or using yarn:

yarn add relay-runtime@dev react-relay@dev
yarn add --dev relay-compiler@dev babel-plugin-relay@dev

Breaking Changes

  • relay-compiler is now implemented in Rust and it replaced the JS version from v12.
    • We'll publish a more detailed blog post with motivation for this migration, technical decisions, and challenges we had with it, and results. TL;DR: The main goal was drastically improve the speed of the build step.
    • A few new features that are supported in the new compiler:
      • TypeScript code generation added to the compiler.
      • New directives:
        • @required directive: Improve the ergonomics of handling null values by declaratively telling Relay to either LOG, THROW, or bubble (NONE) null fields. See more: https://relay.dev/docs/next/guides/required-directive/
        • @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.
      • Support for generic query persisting in the configuration.
    • Breaking changes in the new Relay compiler
      • Strict validation for conflicting fields in selections.
      • No field aliases can start with two underscores; these are reserved for internal Relay use.
      • In the new version, the support for custom JS transforms/JS Plugins are not implemented.
    • 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 for graphql tags.
    • It may break some of the components that rely on the structure of the generated Relay flow-types.
      • [0a487b60eb3] update Relay's types to use $fragmentSpreads and $fragmentType
      • [9a79039df19] add new $fragmentSpreads name to RelayResolverTestUtils
      • [d2c256f7984] Add ReaderInlineDataFragment to GraphQLTaggedNode
      • [8723bd66007] Add new runtime types
      • [4556f539853] rename FragmentReference to FragmentType
      • [d5fe5d25c62] make __fragmentPropName and __module_component not left-hand optional since they are within type conditions
  • 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.
    • [10c2a88a7f2] Make second parameter to SelectorStoreUpdater have type TMutationResponse instead of $FlowFixMe
    • [df04f8dd9a4] Remove default type parameter (any) from SelectorStoreUpdater
    • [1b8b1883d46] Add type param to SelectorStoreUpdater, with a default type of any
    • [2f04533b9f8] Add MutationParams type param to various structs and methods
    • [9c7301dd294] Inform useMutation callers of payloads
    • [e11a33476b0] Modify the public API of Relay.environment to add executeSubscription method
    • [2f4648edadf] Move MutationParameters to RelayStoreTypes
    • [a8b1e6fdb7d] remove $fragmentRefs from updatable fragment flow types

Improvements

  • [096d1b43750] Friendly error message if user gets singular/plural wrong in updaters
  • Docs: Fix typo in queries.md (#3602)
  • Cache dependencies in GitHub Actions CI workflow (#3604)
  • website: Fix broken links in the top page (#3613)
  • [c3ad9027a6] Make @required docs public
  • Fix broken links for older website versions (#3655)

Fixed

  • Fix conflicting field warning when using treatMissingFieldsAsNull (#3615)
  • [fe479fb15f0] Fix useRefetchableFragmentNode fetching with initial environment after actor switch
  • [551dd2d853d] Don't cleanup pending preload queries when you're server rendering

Experimental

  • TypeSafe Updaters: Initial experimental support for updatable queries and assignable fragments. Add a readUpdatableQuery_EXPERIMENTAL method which allows developers to update data in the store using regular assignment, instead of the existing store mutation APIs.
  • Relay Compiler Explorer
    • [29db2bb340e] New docs page that lets you quickly see the Relay compiler’s output for snippets of GraphQL. It performs the compilation in the browser using a Wasm version of the new Rust compiler.

Misc

  • [38f1c96e769] Codemod $ElementType/$PropertyType to Indexed Access Types
  • Fix version of the GraphQL.js version to 15.3.0 in babel-plugin-relay (#3628).
  • Bump tmpl from 1.0.4 to 1.0.5 (#3600)
  • Bump axios from 0.21.1 to 0.21.4 in /website (#3595)
  • Fix unit-tests in node v16 (#3608)
  • Adds a README to relay-config (#3656)

Thank you to all contributors who made this release possible!

Full Changelog: https://github.com/facebook/relay/compare/v12.0.0...v13.0.0-rc.0

relay - v12.0.0

Published by alunyov about 3 years ago

Relay Release Notes - 12.0.0

Commits: https://github.com/facebook/relay/compare/v11.0.2...main

About the Release

This is release contains a long list of new fixes and additions to Relay that was added in the last few months: runtime optimizations, react integration updates, logger updates, internal type-safety, documentation updates, and more.

It also contains a few small, but possibly, breaking changes. One of which is related to the Abstract Type Refinement, others to the live query behavior.

The Relay team is continuing work on the new rust-version of the compiler, and VS Code extension. As well as experimenting with the new features: multi-environment runtime support, advanced client-state management APIs. We hope to include these in the upcoming releases.

Thanks to all contributors for your work and support!

Breaking

  • Relay Runtime: Promote type refinement to default feature (no flag). In OSS this flag was false by default, but true in internal configuration [2732db54335].
  • useQueryLoader will not cancel network requests, except for live queries [211d6fec01c].
  • useLazyLoadQuery will not cancel network requests, except for live queries [a75da574223].

Added

  • Add Suspense logging to Relay Network Logger.
  • Add log event for when QueryResource suspends.
  • Add suspense logging when suspending from containers.
  • Add log event for when FragmentResource suspends.
  • Website: First draft of Relay Compiler Playground.
  • React: Support double invoking effects in QueryRenderer.
  • Runtime: Enabled unique subscription root: every response received is now processed in a unique Relay store root.
  • Runtime: Enable batched store updates by default.
  • Runtime: FragmentResource store revision optimization.
  • Add Suspense logging to Relay Network Logger.
  • Add execute.* events to the Relay Logger.
  • Expose various hooks utils from relay-runtime: getPaginationMetadata, getPaginationVariables, getRefetchMetadata, getValueAtPath, type Direction [3b6f70d85fb].

Fixed

  • React: Subscribe on commit in pagination container.
  • React: Actually subscribe on commit in fragment and refetch containers.
  • React: Prevent tearing in refetch container between render and commit.
  • React: Flip useTransition tuple.
  • React: Update relay useTransition tests.
  • Don’t keep unnecessary ref to props in FragmentSpecResolver.
  • Fix memory leak in containers [5a0c4c6320e].
  • Fix Relay Dev Tools network events.
  • Fix throwing promise from RelayModernFragmentSpecResolver.
  • Add improved type safety to useSubscription API.
  • OperationTracker now exposes pending operations affecting owner; display name for suspense promises are more accurate.
  • Do not re-throw errors for incremental payloads that may invalidate the whole query.
  • Runtime: Make RelayPublishQueue.run a no-op if no pending updates.
  • Runtime: Ship FragmentResource store revision optimization.
  • Check if global exists before calling ErrorUtils (#3465).
  • Fix double _publishQueue.run() in OperationExecutor.
  • Use the provided requestSubscription fn in useSubscription.
  • Code Cleanup: Remove RecordSource/RecordSourceMapImpl indirection.
  • Remove duplicated active observable tracking in _processModuleImportPayload.
  • Do not emit extension in compiler includes (#3518).
  • Check if global exists before using it (#3525).
  • Improve handling of falsy conditions and @skip.
  • Fix a bug in RelayReplaySubject that caused indefinite suspense in React double invoke.
  • Do not read from the store if no onNext callback is provided.
  • Make createOperationDescriptor type safe.
  • Set unique root ID before processing a non-incremental payload.
  • Track store writeEpoch in FragmentResource.
  • Update updater docs to include payload.
  • Small optimization in RelayPublishQueue [6b95ff87f23].
  • Reduce FragmentResource memory usage [bd35151fbe2].
  • Avoid calling environment.lookup when not needed in QueryResource.
  • Release redundant temporary retains when the component commits.
  • Support batched responses in RelayResponseCache.
  • OperationTracker now exposes pending operations affecting owner; display name for suspense promises are more accurate.
  • Rename QueryExecutor to OperationExecutor.
  • Rename transactionID to networkRequestId in log events.
  • Documentation/Website/Typo Fixes: #3439, #3456, #3479, #3492, #3493, 3495 #3517, #3530, #3532, #3535, #3545, #3564, #3566, #3569, #3570, #3576, #3552, #3546, #3550, #3577.

Misc

  • Update batching async module scheduling [8e3e2106061].
  • Only batch async module payload if there is more than one pending module payload.
  • Add ApplyMutation test for RelayEnvironment.
  • Additional testing for applyMutation.
  • CI: remove node 10 and 15, add node 16 (#3466).
  • Bump lodash from 4.17.20 to 4.17.21 in /packages/babel-plugin-relay (#3482).
  • Bump path-parse from 1.0.6 to 1.0.7 in /packages/babel-plugin-relay (#3559).
  • Update React flow types.
  • Add disallowWarnings(...) to some Relay unit-tests.
  • Remove useCustomizedBatch from runtime.
Package Rankings
Top 0.37% on Npmjs.org
Top 21.21% on Repo1.maven.org
Top 10.87% on Bower.io
Top 3.57% on Proxy.golang.org
Badges
Extracted from project README
GitHub license npm version