All Versions
13
Latest Version
Avg Release Cycle
39 days
Latest Release
10 days ago

Changelog History
Page 1

  • v7.1.0

    November 07, 2019

    7.1.0

    βž• Added

    • πŸ†• New warning in RelayPublishQueue if if RelayPublishQueue::run() is called again during a run(): 3823534
    • πŸ‘Œ Support for the new configuration option in the compiler (aa1453b) writerConfig.writeQueryParameters - that can accept the function:

      writeQueryParams: ( dir: CodegenDirectory, filename: string, moduleName: string, params: RequestParameters, ) => void

    πŸ›  Fixed

    • 0️⃣ Compiler: fix validation of required fields with default values #2903 by @mrtnzlml
    • [Allow non-nullable Viewer field in ViewerQueryGenerator #2924 by @janicduplessis
    • βž• Add exports to relay-runtime to make available in relay-experimental: a0fc101

    Misc

    • 🚚 Renaming/cleanup in the compiler: Moving some parts of the new codegen runner to OSS, removed redundant prefixes.

    Experimental

    • πŸ‘ Allow an extraOptions object on PreloadOptions: 68e893e
    • πŸ‘ Allows passing a raw query to preloadQuery(), which makes it usable without the special $Parameters file: edb4670
    • getModuleIfRequired replaced with queryResource in the EntryPoints: 32f4a71
    • βž• Added new Relay Experimental Docs: 3f7ba11
    • βž• Added Step-by-step guide to Relay Hooks: 2d1473f
    • βž• Add support for loading 3D resources in optimistic responses: bef3551
  • v7.0.0

    October 21, 2019

    7.0.0

    Commits: v6.0.0...v7.0.0

    πŸ’₯ Breaking

    Variables are no longer set in Relay Context when using a QueryRenderer. This means that any product code that was relying on reading variables from RelayContext will break. If you need to access the variables that were set at a query root, the recommended approach is to manually pass them down through the component tree in product code.

    βœ‚ Removed old RelayNetworkLogger, and relay-runtime no longer exports createRelayNetworkLogger. This logger is being replaced with event based logging on the Environment which will allow us to have richer and more contextual events logged with more detail on what's going on. Wrapping the actual network request doesn't work well as some "requests" might never actually end up on the network when they can be fulfilled completely from the store.

    ⚑️ The constructor signature of Store constructor changed; specifically the second argument to the constructor is now an options object. Any product code directly constructing a Store and passing a second argument will need to be updated.

    🚚 Relay Compiler no longer relies on graphql-js for query validation. Most of the validation rules we used previous are now part of the RelayParser itself, while the remainder and implemented as transforms (15e8d22). Additionally, we've removed the concept of RelayIRValidations (da01bf3), which ran after IR transformation.

    πŸ‘ @defer is no longer allowed on inline fragments, since we can’t communicate a loading state with Suspense when used on an inline fragment. @defer is now only supported on fragment spreads.

    βž• Added

    • RelayCompiler: added a new directive (3dd79e8) @DEPRECATED__relay_ignore_unused_variables_error to suppress errors that were surfaced after we've migrated from GraphQL NoUnusedVariablesRule to RelayIRTransform validation. GraphQL NoUnusedVariablesRule was not aware of the difference between root (operation) variables and local fragment variables (defined by @argumentDefinitions) - because of that, it was considering the local fragment variables that have the same name as the root variable as used and did not report the violation. But in Relay compiler, we know this distinction, and we already keep track of the root variables and can report those invalid cases. Unfortunately, this revealed multiple violations that weren't possible to fix without product team involvement. For this purpose, we added a directive that can be used to temporarily suppress the error while teams fix their queries.

    πŸ‘Œ Improved

    • 😌 Relaxed the constraint for @refetchable directive on a fragment: we no longer enforce that the argument for the node field is called id; it can be called anything as long as it’s an ID type.
    • Developers can now select the __id field anywhere that __ typename can be selected, in order to fetch the internal cache key of an entity. The primary use-case for this is updating records that don’t have an id. Before, updating or deleting such entities would require writing an updater function that traversed from the nearest strong entity (w an id); now, developers can directly target records with e.g. store.get(record.__id) in an updater function.

    πŸ›  Fixed

    • πŸ“œ RelayCompiler: Usage of $variables in Complex objects (or as List Items) is now disabled by RelayParser: 6946e85 This was already unsupported, but Relay previously threw an error later in compilation.
    • 🀑 MockPayloadGenerator: allow null as default value of enum: 6946e85
    • πŸ›  Fix display names for containers.
    • πŸ›  Fixed @refetchable connection metadata for custom handlers.
    • πŸ›  Fixed missing field handler behavior for plural linked fields.
    • πŸ›  Fixed getRefetchMetadata to handle both commonjs and esmodules. (#2875)
    • πŸ›  Fixed printing require module dependency in generated artifacts. (#2861)

    Misc

    • ⬆️ Upgraded React peer dependency to 16.9.0.
    • ⬆️ Upgraded babel-preset-fbjs to 3.3.0
    • πŸ— RelayCompiler: We've changed the field type and typeCondition in GraphQL IR types to use Relay internal representation of GraphQL type (2606f32). Before this change, we were directly using graphql-js type instances. But eventually, our goal in Relay compiler is to get rid of the dependency on the graphql-js schema representation and use a faster/less memory intensive representation of the schema. We also build a Schema wrapper: 9e6d919 - that should help us during this migration.

    Experimental

    • 🐎 Several performance improvements to the internal implementation of useFragment were shipped.
    • πŸ›  Fixed issue to stop tracking mutations as in flight in the RelayOperationTracker when applying the optimistic update; this caused issues with suspending unexpectedly.
    • πŸ›  Fixed issue to stop tracking GraphQL subscriptions as indefinitely in flight in the RelayOperationTracker; instead, subscriptions should only be tracked as in flight when they’re waiting for incremental or module payloads. This caused issues with suspending indefinitely in some cases.
    • πŸ›  Fixed issue to correctly dispose of ongoing requests when unmounting a useQuery hook; this might happen when useQuery starts a long-lived request, e.g. to poll for real time data.
    • πŸ›  Fixed issue in useQuery to not suspend indefinitely when server response doesn’t return all of the requested data. This might occur for example when making selections on abstract types.
    • πŸ›  Fixed re-establishing store subscriptions when using useBlockingPagination.
    • πŸ›  Fixed pagination with Relay Hooks when using fragments that contain @argumentDefitions.
    • Pagination with Relay Hooks is now allowed even if server returns value for hasNextPage as false.
    • Several improvements to new experimental representation of connections.
    • Temporarily exposed new option for useQuery: renderPolicy_UNSTABLE, which determines whether data should be eagerly or lazily rendered.
  • v6.0.0

    September 16, 2019

    Commits: v5.0.0...v6.0.0

    πŸ’₯ Breaking

    • πŸ‘€ Environment no longer supports a configurable PublishQueue, this is a prerequisite for upcoming changes to support a new connection representation and the Store interface changes (see below): 44edf14
    • ⚑️ Changed the Store interface, adding snapshot() and restore() methods and changing the way that PublishQueue/Store coordinate to revert/rebase optimistic updates: a5c903d
      • Note: this should have no impact on users who use the default Store implementation; the main impact is to alternate store implementations and consumers thereof.
    • βœ‚ Removed the unused RecordSource interface load() method: bd15d4e
    • Changed dataFrom prop in ReactRelayQueryRenderer to fetchPolicy, changed 'STORE_THEN_NETWORK' to 'store-and-network'.
    • πŸ”„ Changed $key in flow type for plural fragments to plural ($ReadOnlyArray<>)
    • 🚚 environment.unstable_internal has been removed, since we no longer need to support Relay Compat.
    • Minimum required React version is now 16.9.0

    βž• Added

    • Added _ unreleased _ relay-experimental package which contains experimental version of Relay Hooks using React Suspense.
    • βž• Added a LocalQueryRenderer that has the same API as QueryRenderer, and only renders from data in the store.
    • @inline directive and readInlineData() function that enables data masking for functions instead of React components.
    • Added an @raw_response_type directive on query, mutation and subscription. With the directive, a new flow type will be added to the generated artifact that represents the shape of the server response.
    • πŸ†• New documentation for Client Schema extensions and managing local data was added.

    πŸ‘Œ Improved

    • Validate that required arguments are provided in compiler.
    • πŸ“¦ Don't include (70453f2) @babel (https://github.com/babel) packages in generated bundles ( (70453f2#2764#2764) (#2764)) (70453f2)
    • 🐎 Made several performance optimizations for our compiler transforms.
    • πŸ‘ Allow RelayFileWriter to specify the filesystem object (#2837)
    • πŸ”§ Can now configure persistFunction with relay config.

    πŸ›  Fixed

    • 🀑 Various fixes to the MockPayloadGenerator
      • Added test case for mocking null values (#2762 (#2762))
      • Fixed MockResolvers for Objects in plural fields
      • Fixed generated values for scalar arrays/enums
      • Fixed mock resolvers for arrays of Enums (#2779 (#2779))
      • Handle cases when MockResolver for ID returning undefined
    • πŸ›  Fix edge case in ConnectionHandler when field is unset
    • πŸ›  Fixed relay-compiler babel polyfill problem.
    • πŸ‘‰ Use reporter to report changes (#2838)
    • πŸ‘‰ Use global state for persisted queries to fix --watch (#2625 (#2625))

    Misc

    • v6.0.0 should now be compatible with React 16.9.0.
    • πŸ‘ Experimental: work-in-progress support for a new approach to representing connections, with changes starting in 6f01295. The new connection representation is not feature complete and disabled by a feature flag. The APIs are highly likely to change.
    • βž• Added a new implementation of the RelayRecordsSource (available behind a feature flag)
  • v5.0.0

    June 11, 2019

    Commits: v4.0.0...v5.0.0

    πŸ’₯ Breaking

    • react-relay containers no longer consume variables from React context, but instead from fragment owners passed through fragment refs. This means that if you have a custom QueryRenderer or other component that set Relay Context, setting variables on that context will no longer affect descendant components.

    βž• Added

    • πŸ”¦ Expose ability to pass custom scalar configuration to compiler (#2745 by @alloy)
    • βž• Add relay-config package to manage compiler configs (#2746 by @alloy)

    πŸ‘Œ Improved

    πŸ›  Fixed

    • βœ… Updated default compiler configuration to include files from __tests__ directories: 033a4bb
    • πŸ›  Fixed a bug in flow type generation that fields on inline fragments with duplicated names are only included once: [088afdf](https://github.com/facebook/relay/commit/088afdf347582533b9956adbc5b2a5e37fe9cfaf)
    • Deduplicate connection edges based on DataID (not just id field)
    • πŸ›  Fixed a bug that mutations on viewer field β€œoverwriting” existing fields in the store: Add hardcoded ID to viewer field

    Misc

  • v4.0.0

    April 30, 2019

    Commits: v3.0.0...v4.0.0

    πŸ’₯ Breaking

    • Fragment Container, Refetch Container, Pagination Container now always expect an object as the fragment declaration (single graphql tag is no longer valid input), since graphql tags no longer implicitly produce object wrappers during our babel transform: 1f26086.
    • ConnectionTransform will generate additional selections under the existing edges/pageInfo fields. A side-effect of this is that if edges/pageInfo were aliased, the generated fields now show up under the alias rather than as non-aliased sibling selections: 50008ab -
    • Compiler no longer allows directives to be used in locations not defined in the schema. Previously the compiler doesn't check the directives' locations, it causes directives being used on wrong places, e.g. @connection on a fragment definition.
    • Compiler now validates that all @arguments are defined on the callee

    πŸ‘Œ Improved

    ⚑️ Updates in testing tools:

    • There are two main modules that you may use in your tests:
      • createMockEnvironment(options): RelayMockEnvironment
      • MockPayloadGenerator and @relay_test_operation directive
    • With createMockEnvironment, you will be able to create an instance of RelayMockEnvironment, a Relay environment specifically for your tests. The instance created by createMockEnvironment is implementing the Relay Environment Interface and it also has an additional Mock layer, with methods that allow to resolve/reject and control the flow of operations (queries/mutations/subscriptions).

    - The main purpose of MockPayloadGenerator is to improve the process of creating and maintaining the mock data for tested components.

    βž• Added full support for client schema extensions: now full GraphQL types can be defined in the client schema (as opposed to just extending existing server types), and they will be properly retained during garbage collection when rendered.

    Using new fetchQuery implementation inside QueryRenderer which de-dupes identical requests in flight.

    βž• Add config support for babel-plugin-relay/macro (#2646) @sgwilym

    πŸ›  Fixed

    • πŸ›  Fixed compiler error when watchman cli was missing: 2958b97

    Misc

    • πŸ”„ Changed main entry point in package.json for react-relay and relay-test-utils
    • πŸ“¦ createRelayContext now in relay-runtime package to prevent multiple instances of packages that have "peerDependencies".
    • 🚚 RelayCompat is removed.

    Experimental

    • βž• Added experimental support from @stream and @stream_connection
    • πŸ‘Œ Improved support for @match directive
    • πŸ›  Fixed passing down and comparing fragment owners in a few places that were missing.
    • βž• Added experimental scheduler to QueryExecutor.
  • v3.0.0

    February 23, 2019

    3.0.0

    Commits: v2.0.0...v3.0.0

    πŸ’₯ Breaking

    • βœ‚ Removed Relay Classic and Compat.
    • 🚚 react-relay/modern has been moved to react-relay/.

    πŸ›  Fixed

    • πŸ›  Fixes an issue with schemas with internal enum values (ie, printing as a string but internally represented as an int), these enum values will now correctly print as the enum name instead of the internal value. #2638
    • πŸ”„ Changes commitMutation() to call onCompleted with null errors if there were no errors (instead of an empty array). c80a0fa
    • πŸ›  Fixed issue with sequential optimistic mutation payloads: 55ce137
    • Disabled a built-in graphql-js validation rule (checking that variables are used in allowed positions) in the compiler which could incorrectly report errors when an argument in the @arguments directive conflicted with the nearest parent field argument. Relay-compiler already implements the same validation internally and is aware of @arguments/@argumentDefinitions.

    πŸ‘Œ Improved

    • βœ‚ Remove validateNames option in compiler which was always true.
    • Flow types are properly generated for refetchable queries.

    Experimental

    • βž• Added partial support @stream and @defer in QueryExecutor. Note that this feature is experimental and subject to change. No public API is provided yet.
    • βž• Added support for using @module outside of @match, enabling new use-cases for data-driven dependencies. No public API is provided yet.
    • βž• Added fragment ownership under a feature flag. Fragment ownership is a new constraint that we're rolling out in the internal model of Relay where every instantiation of a fragment at runtime (i.e. a fragment for a given dataID) is associated with an operation that "owns" it; this operation will usually be a query. This is similar to how fragments work in GraphQL, where they need to be a part of a query in order to actually be fetched. This has a few benefits:
      • It allows us to stop relying on React Context to propagate query variables through the tree (which are needed in order to read fragments), and instead can be accessed directly on the fragment owner associated with a fragment.
      • Not using React Context also allows fragment results to be context-free and allows us to deal better with complicated edge cases like nested context (which occurred with refetch and pagination containers). E.g. if you pass a fragment reference from "above" a RefetchContainer/PaginationContainer/QueryRenderer and try to use it somewhere within one of those, it will probably not do what you expect since the variables will be wrong. With ownership, you always get the right variables.
      • This in turn also allows us to specify behavior like refetching (which has historically been confusing) more precisely: refetching a fragment simply means reparenting it under a new owning operation.
  • v2.0.0

    January 26, 2019

    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

    January 22, 2019

    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

    October 31, 2018

    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

    October 31, 2018

    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