react-relay v2.0.0 Release Notes

Release Date: 2019-01-26 // about 5 years ago
  • 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.