Skip to content

v1.0.0-rc.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@leebyron leebyron released this 18 Apr 19:33
· 7860 commits to main since this release

Introducing Relay Modern

Today, we're releasing a first release candidate of 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@dev

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@dev relay-compiler@dev

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.