v1.6.0

@jstejada jstejada released this Apr 27, 2018 · 102 commits to master since this release

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

@jstejada jstejada released this Feb 20, 2018 · 214 commits to master since this release

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

@leebyron leebyron released this Sep 26, 2017 · 555 commits to master since this release

New:

v1.4.0

@leebyron leebyron released this Sep 22, 2017 · 555 commits to master since this release

New:

  • Full support for returning Observable from Relay Network implementations. Use const {Observable} = require('relay-runtime') to use Relay's lightweight Observable implementation which seeks to follow the Observable specification.
  • Support for the new Relay DevTools beta (install with yarn add relay-devtools) (86b63d4)
  • Support for latest version of Flow
  • Deprecated graphql.experimental All features now supported directly in graphql literal tags. (9afd764)
  • Pagination container now accepts an Observer when loading more data (ef7aa5b)

Potentially Breaking:

  • Relay Network and Environment internal APIs renamed to execute() and executeMutation() (0202673)
  • Removed legacy flow type generation (8cf10b9)

Fixed:

  • Case where callback might not be called after mutation (980de6d)
  • Improved printing of queries with @include in classic/compat mode (d652911)
  • Improved error messages (d8eb6d4)
  • Fix case where compiler might not place __typename and id in the correct order (95319d1)
  • Fix deferred queries when root arguments are not of type ‘ID’ (5ac9271)
  • Fixed remaining issues for compatibility with React v16.
  • Fix passing default arguments to @arguments in compat mode (1ce348a)
  • Fix issues in QueryRenderer when queries resolve synchronously and immediately (87bfc91)
  • Fix case where @argumentDefinitions would not be validated first (50803a5)
  • Change readyState to getDefaultState value after retry (beaf5c2)

v1.3.0

@kassens kassens released this Aug 28, 2017 · 692 commits to master since this release

A small update since 1.2.0 that mainly exposes a few new internals.

New:

  • graphql tags now support null literal values (@nkohari e7962fb)
  • Refactored RelayEnvironment to use Observables instead of Promises to prepare for streaming and other advanced usages (@leebyron)
  • Expose formatGeneratedModule on relay-compiler to allow more customization of the compiler (@robrichard 7b44013)
  • New CLI flag --validate to relay-compiler to validate without writing files (@ajhyndman af35c30)
  • RelayConnectionInterface is now injectable for legacy clients (@kassens d9c1eb0)

Fixed:

  • Various documentation fixes (@mattleff)
  • Some exceptions in the compiler were only printing to console, but not causing an error code (@kassens 14e28dd)
  • RelayRecordProxy#setValue now accepts arrays of scalar values (@kassens 7a2b27e)
  • Removed eslint-config-fbjs dependency from relay-compiler (@mwalkerwells 7b914f0)

v1.2.0

@leebyron leebyron released this Aug 16, 2017 · 744 commits to master since this release

In addition to all of the changes in v1.2.0-rc1, v1.2.0 includes:

New:

  • Unmasked fragment spreads introduced in the RC have been renamed from @inline to @relay(mask: false) (c7235ab) and can be used in both Relay modern and Relay compat (20327fd)
  • Full queries are generated in development builds for easier debugging (9a81b3f)
  • Relay compiler now allows disabling watchman for typical builds (@robrichard 4f80e02)
  • No longer explicitly need to include pageInfo when using pagination controllers (9686119)
  • Experimental support for returning Observable from provided fetch and subscribe Network functions (bfc7f7f)

Fixed:

  • Ensure Relay compiler generates the right kinds (db6ef37)
  • Edge cases when Network cache returns synchronously (2ffb5c6)
  • Incorrect error handling in Networking (63ca3ae)
  • Ensure logging for each response from a GraphQL Subscription (777bcf6)
  • Ensure the same edge is not added twice during pagination (d0aff0f)

Improved:

  • Full support for React v16
  • Support root level types that aren't named "Query" in Relay Compat (@robrichard 1544f59)
  • Improved generated flow types (0d4cf95)
  • Support for customized logging (a82a417)
  • Included a peerDep between relay-runtime and relay-compiler to create early warnings if dependencies are misaligned (2582646)
  • Support for flow types for custom scalars (9488a51)

v1.2.0-rc.1

@kassens kassens released this Jul 19, 2017 · 831 commits to master since this release

This release is another massive collection of some exciting new features, fixed bugs and improved error messages and warnings. Thanks to our external contributors, summer interns and anyone helping with code or bug reports.

New

  • Experimental @inline directive to inline fragments verbatim for use in utility functions (1b19ee0)
  • The compiler now supports --exclude and --include for more control over what files are parsed (94c8b20)
  • PaginationContainer can now refetch with new variables, useful for server filtered, paginated lists (6bc9127)

Fixed

  • Relay context is set correctly inside pagination containers (@pranaygp, b09bba4)
  • Fixed an issue where fragments didn't update correctly when the last item of a plural field was deleted (08336c6)
  • Fixed a bug where query files weren't re-generated if only the flow type changed (697c6ee)

Improved

  • Faster parsing in the compiler by caching the extracted graphql tags (7e1065f)
  • Improved error handling in the compiler (cb7680f)
  • The callback to loadMore and refetch of the pagination and refetch container is now consistently called after render (e316b6e)
  • The compiler now parses .js.flow files (3e0266c)
  • A new warning on pagination container helps avoid bugs (3fe68c8)
  • Better error when unknown directories are inside the generated output directories (9766201)
  • Line numbers of parse errors are now correct (ca15340)
  • Updated graphql dependency to ^0.10.5 (beba407)

v1.1.0

@leebyron leebyron released this Jun 23, 2017 · 903 commits to master since this release

Relay v1.1.0 represents a massive number of improvements atop the release of Relay v1.0 last month, including improved error messages, bug fixes, and a handful of new utilities. Special thanks to the Relay team's summer interns, who contributed a number of the improvements below:

Minor breaking:

  • Polyfills for Set, Map, and Promise are no longer bundled into Relay. (#1870)
  • babel-relay-plugin has been officially removed in favor of babel-plugin-relay (753f1f0)
  • "Soft error mode" is removed from babel-plugin-relay. Previously this would insert throw statements into the compiled output, now this produces compiler errors. (c7634da)
  • Optimistic responses from mutations are now expected to be objects (ed5f4f9)
  • Proper support for component filenames with non alphanum characters may change the names of Components (78ea60b)

New:

  • Relay containers now accept the prop componentRef to get a ref of the contained component (3571fb9)
  • More GraphQL validation rules are caught statically on the client (a85397a)
  • QueryResponseCache added to the public API (00c7e90)
  • RelayRecordSourceInspector added to the public API (bc81e06)
  • Relay compiler now supports different templates (a66b8b6)
  • Tons of improved error messages (#1767, 3236d90, e54e307, 0106f76, 7a73873, 24d35fc, ac00442, d837abc, aa78c84)
  • Performance enhancements to relay-compiler (afa874a)
  • Improved profiling messages (fff1f42)
  • Support for GraphQL.js v0.10
  • Support for React v16 (1cc7fc7, 1adfba2)
  • Support adding and deleting ranges of a connection from a mutation (4064b9b, aefe580)
  • Generated flow types for mutations (fd4b9e6)

Fixes:

  • Nested Refetch containers now correctly rerender children (#1702)
  • Views now re-resolve when query variables change (0bf9bc0)
  • Live query polling now sends a first request immediately (5e19e83)
  • Removed warnings when using custom scalars (296e0b7)
  • Schema without a Viewer type supported correctly (daf38f2)
  • Generated Flow types now respect @relay(plural) (#1810)
  • Generated Flow types accept non-strict input (66c3d1d)
  • Watch mode in relay-compiler is more resilient to errors (38707c0)
  • No longer require a GraphiQL printer within a network logger (#1857)
  • Improved flow types for QueryRenderer (#1855)

v1.0.0

@leebyron leebyron released this May 19, 2017 · 1036 commits to master since this release

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.