All Versions
20
Latest Version
Avg Release Cycle
45 days
Latest Release
567 days ago

Changelog History
Page 2

  • v5.0.0 Changes

    June 11, 2019

    Commits: v4.0.0...v5.0.0

    πŸ’₯ Breaking

    • react-relay containers no longer consume variables from React context, but instead from fragment owners passed through fragment refs. This means that if you have a custom QueryRenderer or other component that set Relay Context, setting variables on that context will no longer affect descendant components.

    βž• Added

    • πŸ”¦ Expose ability to pass custom scalar configuration to compiler (#2745 by @alloy)
    • βž• Add relay-config package to manage compiler configs (#2746 by @alloy)

    πŸ‘Œ Improved

    πŸ›  Fixed

    • βœ… Updated default compiler configuration to include files from __tests__ directories: 033a4bb
    • πŸ›  Fixed a bug in flow type generation that fields on inline fragments with duplicated names are only included once: [088afdf](https://github.com/facebook/relay/commit/088afdf347582533b9956adbc5b2a5e37fe9cfaf)
    • Deduplicate connection edges based on DataID (not just id field)
    • πŸ›  Fixed a bug that mutations on viewer field β€œoverwriting” existing fields in the store: Add hardcoded ID to viewer field

    Misc

  • v4.0.0 Changes

    April 30, 2019

    Commits: v3.0.0...v4.0.0

    πŸ’₯ Breaking

    • Fragment Container, Refetch Container, Pagination Container now always expect an object as the fragment declaration (single graphql tag is no longer valid input), since graphql tags no longer implicitly produce object wrappers during our babel transform: 1f26086.
    • ConnectionTransform will generate additional selections under the existing edges/pageInfo fields. A side-effect of this is that if edges/pageInfo were aliased, the generated fields now show up under the alias rather than as non-aliased sibling selections: 50008ab -
    • Compiler no longer allows directives to be used in locations not defined in the schema. Previously the compiler doesn't check the directives' locations, it causes directives being used on wrong places, e.g. @connection on a fragment definition.
    • Compiler now validates that all @arguments are defined on the callee

    πŸ‘Œ Improved

    ⚑️ Updates in testing tools:

    • There are two main modules that you may use in your tests:
      • createMockEnvironment(options): RelayMockEnvironment
      • MockPayloadGenerator and @relay_test_operation directive
    • With createMockEnvironment, you will be able to create an instance of RelayMockEnvironment, a Relay environment specifically for your tests. The instance created by createMockEnvironment is implementing the Relay Environment Interface and it also has an additional Mock layer, with methods that allow to resolve/reject and control the flow of operations (queries/mutations/subscriptions).

    - The main purpose of MockPayloadGenerator is to improve the process of creating and maintaining the mock data for tested components.

    βž• Added full support for client schema extensions: now full GraphQL types can be defined in the client schema (as opposed to just extending existing server types), and they will be properly retained during garbage collection when rendered.

    Using new fetchQuery implementation inside QueryRenderer which de-dupes identical requests in flight.

    βž• Add config support for babel-plugin-relay/macro (#2646) @sgwilym

    πŸ›  Fixed

    • πŸ›  Fixed compiler error when watchman cli was missing: 2958b97

    Misc

    • πŸ”„ Changed main entry point in package.json for react-relay and relay-test-utils
    • πŸ“¦ createRelayContext now in relay-runtime package to prevent multiple instances of packages that have "peerDependencies".
    • 🚚 RelayCompat is removed.

    Experimental

    • βž• Added experimental support from @stream and @stream_connection
    • πŸ‘Œ Improved support for @match directive
    • πŸ›  Fixed passing down and comparing fragment owners in a few places that were missing.
    • βž• Added experimental scheduler to QueryExecutor.
  • v3.0.0 Changes

    February 23, 2019

    3.0.0

    Commits: v2.0.0...v3.0.0

    πŸ’₯ Breaking

    • βœ‚ Removed Relay Classic and Compat.
    • 🚚 react-relay/modern has been moved to react-relay/.

    πŸ›  Fixed

    • πŸ›  Fixes an issue with schemas with internal enum values (ie, printing as a string but internally represented as an int), these enum values will now correctly print as the enum name instead of the internal value. #2638
    • πŸ”„ Changes commitMutation() to call onCompleted with null errors if there were no errors (instead of an empty array). c80a0fa
    • πŸ›  Fixed issue with sequential optimistic mutation payloads: 55ce137
    • Disabled a built-in graphql-js validation rule (checking that variables are used in allowed positions) in the compiler which could incorrectly report errors when an argument in the @arguments directive conflicted with the nearest parent field argument. Relay-compiler already implements the same validation internally and is aware of @arguments/@argumentDefinitions.

    πŸ‘Œ Improved

    • βœ‚ Remove validateNames option in compiler which was always true.
    • Flow types are properly generated for refetchable queries.

    Experimental

    • βž• Added partial support @stream and @defer in QueryExecutor. Note that this feature is experimental and subject to change. No public API is provided yet.
    • βž• Added support for using @module outside of @match, enabling new use-cases for data-driven dependencies. No public API is provided yet.
    • βž• Added fragment ownership under a feature flag. Fragment ownership is a new constraint that we're rolling out in the internal model of Relay where every instantiation of a fragment at runtime (i.e. a fragment for a given dataID) is associated with an operation that "owns" it; this operation will usually be a query. This is similar to how fragments work in GraphQL, where they need to be a part of a query in order to actually be fetched. This has a few benefits:
      • It allows us to stop relying on React Context to propagate query variables through the tree (which are needed in order to read fragments), and instead can be accessed directly on the fragment owner associated with a fragment.
      • Not using React Context also allows fragment results to be context-free and allows us to deal better with complicated edge cases like nested context (which occurred with refetch and pagination containers). E.g. if you pass a fragment reference from "above" a RefetchContainer/PaginationContainer/QueryRenderer and try to use it somewhere within one of those, it will probably not do what you expect since the variables will be wrong. With ownership, you always get the right variables.
      • This in turn also allows us to specify behavior like refetching (which has historically been confusing) more precisely: refetching a fragment simply means reparenting it under a new owning operation.
  • v2.0.0 Changes

    January 26, 2019

    2.0.0

    Commits: v1.7.0...v2.0.0

    πŸ’₯ Breaking

    • πŸ“„ Relay now uses new Context API instead of Legacy Context API. Any consumers of Relay context using the Legacy context API will break.
      • Removed experimental support for @deferrable directive
    • ⬆️ Upgrade graphql to 14.0.0
    • ⬆️ Upgrade react to 16.5.0
    • relay-compiler: Rename inputFieldWhitelist to optionalInputFields.
    • πŸ”€ Merge graphql-compiler into relay-compiler (#2593)
    • Selector type returned by environment.unstable_internal.getSelector(...) has changed.

    βž• Added

    • ReactRelayContext is now exported from react-relay.
    • βž• Added fragment ownership model to relay-runtime: fragments can now point to the query that owns them, which removes reliance on React Context and gives us flexibility to experiment with new apis.
    • Persisted queries: Enables a simple but straightforward mechanism to use persisted queries in open-source. (#2354)
    • πŸ‘ @arguments directive now supports literal values.
    • βž• Add 'severity' field to PayloadError in RelayNetwork interface.
    • βž• Add support for specifying missingFieldHandlers in the Relay environment. These handlers allow developers to provide a fallback for missing data for a query when environment.check() is called.
    • βž• Add support making GC scheduling configurable in the Relay environment.
    • πŸ‘ Allow passing a custom handler to @connection. This is useful for products that want to customize the way newly fetched items are merged into an existing connection.

    πŸ›  Fixed

    • recycleNodesInto no longer produces runtime error in DEV mode trying to mutate frozen objects (#2193)
    • πŸ›  Fixed receiving payloads out of order in QueryRenderer.
    • πŸ›  Fixed issue in Pagination Container when receiving new props.
    • πŸ›  Fix incorrectly garbage collecting data during an optimistic update.
    • Correctly fix double fetching with QueryRenderer in React Concurrent mode.
    • πŸ›  Fix rendering sibling QueryRenderers that have the same query and variables.

    πŸ‘Œ Improved

    • πŸ‘Œ Improved compiler error messages, which now show locations in source.
    • ⚑️ Updated the structure of generated ConcreteRequest to provide more flexibility for our fetching apis.
    • Cleaned up Reader and Normalization AST representation.
    • ⬆️ Upgrade build dependencies to Babel 7 and Webpack 4.
    • πŸ‘‰ Make generated Flow types for Input types exact objects.
    • πŸ›° Simplify structure of network payloads.
    • πŸ“‡ Rename RelayMarkSweepStore to RelayModernStore.

    Experimental

    • βž• Added support for new @match directive for dynamically loading code and data dependencies determined by server. No user api is provided yet.
    • βž• Added support for @refetchable directive which automatically generates a query for a fragment that is β€œrefetchable” (i.e. a fragment on Viewer, Query, or a type that implements Node). No user api is provided yet.
  • v2.0.0-rc.2 Changes

    January 22, 2019

    2.0.0-rc.2

    Commits: v2.0.0-rc.1...v2.0.0-rc.2

    πŸ’₯ Breaking

    • πŸ”€ Merge graphql-compiler into relay-compiler (#2593)
    • Selector type returned by environment.unstable_internal.getSelector(...) has changed.

    βž• Added

    • ReactRelayContext is now exported from react-relay.
    • βž• Added fragment ownership model to relay-runtime: fragments can now point to the query that owns them, which removes reliance on React Context and gives us flexibility to experiment with new apis.
    • Persisted queries: Enables a simple but straightforward mechanism to use persisted queries in open-source. (#2354)
    • πŸ‘ @arguments directive now supports literal values.

    Experimental

    • βž• Added support for new @match directive for dynamically loading code and data dependencies determined by server. No user api is provided yet.
    • βž• Added support for @refetchable directive which automatically generates a query for a fragment that is β€œrefetchable” (i.e. a fragment on Viewer, Query, or a type that implements Node). No user api is provided yet.

    πŸ›  Fixed

    • πŸ›  Fixed receiving payloads out of order in QueryRenderer.
    • πŸ›  Fixed issue in Pagination Container when receiving new props.

    πŸ‘Œ Improved

    • πŸ‘Œ Improved compiler error messages, which now show locations in source.
    • ⚑️ Updated the structure of generated ConcreteRequest to provide more flexibility for our fetching apis.
    • Cleaned up Reader and Normalization AST representation.
  • v2.0.0-rc.1 Changes

    October 31, 2018

    Commits: v1.7.0-rc.1...v2.0.0-rc.1

    πŸ’₯ Breaking

    • πŸ“„ Relay now uses new Context API instead of Legacy Context API. Any consumers of Relay context using the Legacy context API will break.
      • Although not officially supported, this change also breaks SSR with Relay: #2544. We will fix this issue in 2.0.0-rc.2.
    • βœ‚ Removed experimental support for @deferrable directive
    • ⬆️ Upgrade graphql to 14.0.0
    • ⬆️ Upgrade react to 16.5.0
    • relay-compiler: Rename inputFieldWhitelist to optionalInputFields.

    βž• Added

    • βž• Add 'severity' field to PayloadError in RelayNetwork interface.
    • βž• Add support for specifying missingFieldHandlers in the Relay environment. These handlers allow developers to provide a fallback for missing data for a query when environment.check() is called.
    • βž• Add support making GC scheduling configurable in the Relay environment.
    • πŸ‘ Allow passing a custom handler to @connection. This is useful for products that want to customize the way newly fetched items are merged into an existing connection.

    Experimental

    βž• Added a new relay-experimental package which exposes a few experimental APIs.

    • βž• Add fetchQuery_UNSTABLE api to fetch and retain data outside of React.
    • βž• Add SuspenseQueryRenderer and SuspenseFragmentContainer. These are new versions of our containers that use Suspense to communicate loading states.

    πŸ›  Fixed

    • πŸ›  Fix incorrectly garbage collecting data during an optimistic update.
    • Correctly fix double fetching with QueryRenderer in React Concurrent mode.
    • πŸ›  Fix rendering sibling QueryRenderers that have the same query and variables.

    πŸ‘Œ Improved

    • ⬆️ Upgrade build dependencies to Babel 7 and Webpack 4.
    • πŸ‘‰ Make generated Flow types for Input types exact objects.
    • πŸ›° Simplify structure of network payloads.
    • πŸ“‡ Rename RelayMarkSweepStore to RelayModernStore.
  • v1.7.0 Changes

    October 31, 2018

    Commits: v1.6.2...v1.7.0

    πŸš€ This release comes with two exciting contributions from external contributors:

    πŸ”Œ Language Plugins

    πŸ”¨ While we at Facebook only support JS and Flow flavored JS and generate optional Flow types, supporting TypeScript had been difficult. #2293 by @alloy does the required refactoring to allow other developers to write plugins to add this missing support.

    πŸ‘ Create React App support

    πŸ”Œ Create React App tries to minimize dependencies, so including Relay's Babel plugin for everyone didn't make much sense. This meant that using Relay with Create React App wasn't possible without ejecting.
    πŸš€ This release adds babel-plugin-relay/macro (@apalm, #2171) which in the upcoming [email protected] will make it possible to use Relay without ejecting powered by babel-plugin-macros (http://yarn.pm/babel-plugin-macros).

    βž• Added

    • πŸ‘Œ Support for language plugins (@alloy, #2293)
    • πŸ‘Œ Support for babel-plugin-macros (@apalm, #2171)
    • ⚑️ Updated to [email protected] to extract GraphQL strings for the compiler
    • Pagination and Refetch containers now warn when a request is triggered when they're unmounted. (@alunyov)

    πŸ›  Fixed

    • πŸ›  Fix double fetching in QueryRenderer in React Concurrent mode (@flarnie)
    • πŸ›  Fix rendering sibling QueryRenderers that have the same query and variables
    • πŸš€ relay-compiler is no longer a peerDependency of relay-runtime as it's not needed during deployment. Make sure to keep all Relay packages at the same version! (@kassens)

    βœ‚ Removed

    • βœ‚ Removed long deprecated RelayNetwork.streamQuery and RelayNetwork.sendSubscription
  • v1.7.0-rc.1 Changes

    August 16, 2018

    1.7.0-rc.1

    πŸš€ This release doesn't contain many commits, but comes with two exciting additions from external contributors:

    πŸ”Œ Language Plugins

    πŸ”¨ While we at Facebook only support JS and Flow flavored JS and generate optional Flow types, supporting TypeScript had been difficult. #2293 by @alloy does the required refactoring to allow other developers to write plugins to add this missing support.

    πŸ‘ Create React App support

    πŸ”Œ Create React App tries to minimize dependencies, so including Relay's Babel plugin for everyone didn't make much sense. This meant that using Relay with Create React App wasn't possible without ejecting.
    πŸš€ This release adds babel-plugin-relay/macro (@apalm, #2171) which in the upcoming [email protected] will make it possible to use Relay without ejecting powered by babel-plugin-macros.

    βž• Added

    • πŸ‘Œ Support for language plugins (@alloy, #2293)
    • πŸ‘Œ Support for babel-plugin-macros (@apalm, #2171)
    • ⚑️ Updated to [email protected] to extract GraphQL strings for the compiler
    • Pagination and Refetch containers now warn when a request is triggered when they're unmounted. (@alunyov)

    πŸ›  Fixed

    • πŸ›  Fix double fetch in React Async development mode (@flarnie)
    • πŸš€ relay-compiler is no longer a peerDependency of relay-runtime as it's not needed during deployment. Make sure to keep all Relay packages at the same version! (@kassens)

    βœ‚ Removed

    • βœ‚ Removed long deprecated RelayNetwork.streamQuery and RelayNetwork.sendSubscription
  • v1.6.2 Changes

    August 01, 2018

    1.6.2

    πŸ›  Fixed:

    • πŸ›  Fix relay-runtime main entry for OSS
    • πŸ›  Fix documentation page for Mutations
  • v1.6.1 Changes

    July 30, 2018

    Commits: v1.6.0...master

    Potentially Breaking:

    • ⬆️ Bump graphql peer dependency to ^0.13.0
    • πŸ‘‰ Use React.forwardRef. This is a breaking change for people relying on the relayContainer.refs.component implementation detail.

    πŸ†• New:

    • Introduce @relay(mask: false) directive for fragment *definitions: *Applied to a fragment definition, @relay(mask: false) changes the generated Flow types to be more usable when the fragment is spread with the same directive; The Flow types will no longer be exact objects and no longer contain internal marker fields.

    πŸ›  Fixed:

    • πŸ›  Fix pagination after using refetchConnection in Pagination Container
    • Use aliases for __typename generated fields in the union (#2465)
    • πŸ›  Fix issue in React Async mode where container would render inconsistent data if rendering was interrupted.
    • RelayConnectionHandler now properly writes page_info after refetching a connection
    • πŸ›  Fix issue where RelayContainerUtils didn't recognize React.forwardRef as React.Component
    • ⚑️ Properly guard agains errors thrown inside mutation or subscription updater functions

    πŸ‘Œ Improved:

    • πŸ“¦ De-hastify relay-runtime, set main entry in relay-runtime package.json.
    • dedupeJSONStringify is now more effective
    • Speed up relay-compiler by caching client schema extensions.
    • ⚑️ Expose applyOptimisticUpdate on RelayModern.
    • relay-compiler can now compile JS files with optionalChaining syntax.
    • relay-compiler can now compile JS files with nullishCoalescingOperator syntax.
    • relay-compiler can now compile JS files with optionalCatchBinding syntax.
    • ⚠ relay-compiler has better warnings when required variables are not passed in.
    • relay-compiler now generates operation Flow types: 5d83328.
    • ⬆️ Bump fbjs dependency to 0.8.17.
    • ⬆️ Bump fast-glob dependency to 2.2.2.
    • πŸ“š Several documentation improvements.