github facebook/relay v1.0.0

latest releases: v18.1.0, v18.0.0, v17.0.0...
7 years ago

Introducing Relay Modern

Today, we're releasing Relay Modern, a new version of Relay designed from the ground up to be easier to use, more extensible, and most of all to improve performance on mobile devices.

New in Relay Modern:

  • Support for Persisted Queries.
  • Simpler imperative mutation API.
  • Client schema extensions.
  • Flow type generation.
  • Support for GraphQL Subscriptions.
  • Experimental support for GraphQL Live Queries via polling.
  • Fewer requirements around routing.
  • Extensible core which can be used independently of React.
  • Garbage Collection for minimal memory use.
  • Improved runtime performance and smaller bundle (20% the size of Relay Classic).

Get Started with Relay Modern:

Install the release candidate of react-relay:

yarn add react-relay

Once updating to v1.0, require('react-relay') will return the Relay Modern API. For existing Relay apps, update your code to require the existing Relay Classic API: require('react-relay/classic').

Relay Compiler and Babel plugin:

In development, Relay Modern relies on a Babel plugin (just as Relay Classic does). Relay Modern also uses a compiler to generate runtime code.

yarn add --dev babel-plugin-relay relay-compiler

Once updating to v1.0, the new babel-plugin-relay plugin works with both Relay Modern and Relay Classic, replacing the legacy babel-relay-plugin. It uses much simpler configuration which should feel familiar to your .babelrc files.

Don't miss a new relay release

NewReleases is sending notifications on new releases.