Skip to content

Releases: facebook/relay

v2.0.0

26 Jan 08:22
Compare
Choose a tag to compare

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

22 Jan 18:26
Compare
Choose a tag to compare
V2.0.0-rc.2 Pre-release
Pre-release

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

31 Oct 16:34
Compare
Choose a tag to compare
v2.0.0-rc.1 Pre-release
Pre-release

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

31 Oct 16:12
Compare
Choose a tag to compare

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 react-scripts@2.0.0 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 babel@7.0.0-beta.56 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-rc1

16 Aug 07:22
Compare
Choose a tag to compare
v1.7.0-rc1 Pre-release
Pre-release

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 react-scripts@2.0.0 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 babel@7.0.0-beta.56 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

01 Aug 02:20
Compare
Choose a tag to compare

1.6.2

Fixed:

  • Fix relay-runtime main entry for OSS
  • Fix documentation page for Mutations

v1.6.1

30 Jul 01:46
Compare
Choose a tag to compare

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.

v1.6.0

27 Apr 01:43
Compare
Choose a tag to compare

1.6.0

Commits: v1.5.0...v1.6.0

Breaking:

  • The minimum React dependency was raised to ^16.3.0

Potentially Breaking:

  • Remove some usages of deprecated React lifecycle methods and changes to make containers React Async safe.
  • Remove support for legacy __type__ fields
  • Remove support for parsinglegacy interfaces(51c5761)

Fixed:

  • Make jest --watch work with React 16
  • Fix flow type generation for recursive Input types

Improved:

  • Move graphql-compiler out of relay-compiler as its own independent package
  • Make graphql a peer dependency
  • Upgrade graphql-js to v0.13.2
  • Support batch queries in Refetch and Pagination containers
  • relay-compiler: Makes flow generated '%future added value' for enums optional

v1.5.0

20 Feb 21:11
Compare
Choose a tag to compare

This release introduces several changes, some of the most relevant ones are highlighted here.

New:

  • Relay Containers are now Flow typed, however Flow types are not yet exported (#2284).
  • Relay Compiler now generates Flow types for GraphQL enum values.
  • Add undocumented support for client-only schema extensions using .graphql files. Extensions only work on existing types, and does not currently support adding client-only types to the schema.
  • Add experimental and undocumented support for QueryRenderer to render directly from store if data is available using new dataFrom prop.
  • Add hooks to enable and disable Relay GC in the store.
  • New ConcreteNode format supporting Batch requests.

Potentially Breaking:

  • Support for client-only schema extensions requires that your GraphQL schema not be inside your the directory you specify as src to the relay-compiler (#2346).
  • Changes the type of RelayNetwork.execute to return a RelayObservable with variables and node, in addition to the QueryPayload. However, RelayNetwork.create maintains the same API (c058ffc).

Fixed:

  • Fix passing a single item to a "list" input argument (42c1119).
  • Fix end cursor when fetch returned zero edges in Pagination Container (a17b462).
  • No longer throw false alarm error in RelayConcreteVariables (0398585).
  • Properly handle complex GraphQL argument literals in the compiler (bb02769).
  • Calling viewer handler multiple times should not accidentally cause viewer to be null (f442fcd).
  • Fix issue when using multiple connectionInfo for RANGE_ADD mutation (7f2013d).
  • Fix issue in Relay Compiler when parsing non-null input (4baa970).
  • Fix pagination on empty connections (62c8b43).

Improved:

  • Ensure the Relay build has run and is not using outdated GraphQL fragments. Optionally this can be turned off in the babel plugin settings (a628637).
  • Update all callers of react-relay to use CommonJS requires.
  • Speed up getIdentifierForSelection.
  • Compiler doesn't warn on missing fields with abstract types anymore.
  • Relay Compiler now de-duplicates identical objects when generating JSON artifacts which decreases size of artifacts and improves compressability.
  • Disable NoFragmentCyclesRule; can now use Fragments recursively.
  • Remove RecordSourceInspector which is of marginal value, especially now that we have a useful devtools app.
  • Print timing information in compiler —verbose mode.
  • Add option to Compiler to be —quiet.
  • Upgrade to graphql-js v0.13.0.
  • Upgrade to latest version of fast-glob.
  • Upgrade to babylon7 in Relay Compiler to support new JSX Fragment syntax.
  • Remove graphql.experimental.
  • Several Flow typing improvements.
  • Several documentation fixes.
  • Move test utils to their own package: relay-test-utils.
  • Add support for accessing Components wrapped in a Container in tests.
  • Use jest snapshots for relay-compiler tests.

v1.4.1

26 Sep 23:50
Compare
Choose a tag to compare

New: