relay

Relay is a JavaScript framework for building data-driven React applications.

MIT License

Downloads
25.4M
Stars
18.4K
Committers
848

Bot releases are visible (Hide)

relay - v11.0.2

Published by alunyov over 3 years ago

Added

  • Add Relay CodeSandbox to website [f71d1e2261]
  • Add onSubscribe to CacheConfig [04518570ee]
  • Create operation description with correct cache config in usePreloadedQuery [e0713aa613]

Improvements

  • Documentation Improvements: (#3446), (#3444), (#3440), [1a502697b8], [e24c5b3235], (#3424), (#3434), (#3420), [509f72b9e0], [6ff941313e], [954681ddb8], (#3435), (#3436), (#3439), [cacce8c5aa], (#3456), (#3453)
  • Improve suspense promise displayName [47be7d6827]
  • Make operationTracker required in QueryExecutor
  • Reduce some boilerplate in RelayModernEnvironment
  • Improved warning reporting in Relay Unit-tests
  • Batch store updates to once per event [07d5f49972]

Fixed

  • Fix onNext callback in requestSubscription [579b8f257a]

Misc

  • Rename QueryExecutor to OperationExecutor
  • Remove RelayProfiler from RelayResponseNormalizer.normalize [629419596c]
  • Drop RelayModern prefix from QueryExecutor [edef218ee6]
  • Remove RelayProfiler from RelayModernStore.prototype.lookup and RelayProfiler.instrumentMethods [f4866537ca]
  • RelayProfiler no longer skips methods starting with @ [1bfa996f99]
  • Remove RelayProfiler.instrument [cc2758b88d]
  • Remove support for "*" profile event [6e18b9654d]
  • Rename areEqual{OSS => ArgValues} [b8d2694dbe]
  • Remove fbjs/lib/ErrorUtils Dependency [5ed076ee7a]
  • Remove mapObject [4645888162]
  • Export type for RequiredFieldLogger [5a5f5c7ccb]
  • Replace fbjs/lib/invariant with invariant (#3448) [3982f9dca4]
relay - v11.0.1

Published by alunyov over 3 years ago

Fixed

  • Fixed several broken website redirects
  • Store updater directives: do not insert existing node again in connection (#3373)

Documentation Improvements:

This release contains a set of updates to the new Relay website. Some of the PRs are listed here explicitly.
Thank you for your contributions.

  • Replace preloadQuery with loadQuery (#3412)
  • Remove mutation from the server specification (#3381)
  • Fix markdown issue in fragments.md (#3408)
  • Fix typos in loading-states.md (#3411)
  • Fix typos in docs (#3400)
  • Fix typo in the code example in "Introducing Relay Hooks" (#3399)
  • Update use-mutation.md (#3393)
  • Updated load-query.md (#3391)
  • Update use-pagination-fragment.md (#3392)
  • Fix typos in the "Introducing Relay Hooks" blog post (#3394)
  • Thinking-in-graphql.md small typo (#3386)
  • Fixes typo in docs (#3389)
  • Switch text under headings to be <p> (#3385)
  • Fix markdown issue in use-preloaded-query.md (#3384)
  • Use updated Flow object syntax (#3387)
relay - v11.0.0

Published by jstejada over 3 years ago

For our announcement on Relay Hooks, check out our blog posts on relay.dev and Facebook Open Source. For docs, see our updated docs website at relay.dev/docs, and for an update on our upcoming releases, see this issue.

Breaking

  • New version of fetchQuery:
    • New: New version of fetchQuery now returns a lazy Observable which you can subscribe to. It will perform in-flight request de-duping of identical requests. Ignores any Network Layercaching by default, but supports a [fetchPolicy](https://relay.dev/docs/en/experimental/a-guided-tour-of-relay#fetch-policies) to check data cached in the Relay Store.
    • Deprecated: Previous version of fetchQuery renamed to **** fetchQuery_DEPRECATED. Previous behavior returns a Promise (can’t be observed). No request de-duping.
    • Changes in Exports:
      • react-relay: fetchQuery exported from react-relay now has updated behavior and function signature. To access previous version of fetchQuery, import fetchQuery_DEPRECATED from react-relay or react-relay/legacy.
      • relay-runtime: fetchQuery exported from relay-runtime now has updated behavior and function signature. To access previous version of fetchQuery, import fetchQuery_DEPRECATED from relay-runtime.
  • getDataID was renamed from UNSTABLE_DO_NOT_USE_getDataID. This config option is now stable. It can be passed to the Relay Environment and Relay Store as an option that will be used to compute the Data ID for the given record.
  • Default value for gcReleaseBufferSize is now 10 (previously 0).
    • When a query is manually released, for example when a query component unmounts (QueryRenderer or useLazyLoadQuery), Relay will temporarily retain the query in the “release buffer” until the buffer is full. With a buffer size of 0, released queries would not go into the buffer and would be immediately removed from the store cache.
    • With a default buffer size of 10, this means that queries will remained cached in the store for a longer period of time after they unmount, which allows fetch policies like store-or-network. to actually reuse cached data when navigating back to previously visited views.

If upgrading from experimental release

  • The default UNSTABLE_renderPolicy is now always “partial”. We don’t expect this to produce any issues, and will only affect you if you are upgrading from an experimental release. This option can still be configured, but we will completely remove it in the upcoming releases.

Added

Relay Hooks

  • New Relay Hooks APIs added to react-relay and react-relay/hooks. See this issue for more details.
    • relay-experimental has been removed from the source code, and no new experimental builds will be published to npm.
    • We will share more external communications with the community as well as publish our updated docs once a stable release is published.
  • New version of fetchQuery added. See description in Breaking Changes.

General

Improvements

If upgrading from experimental release

  • Hooks are now resilient to React effects being re-invoked (e.g. during Fast Refresh).
  • Un-actionable warning that fired when fragment data was missing without being fetched has been removed.
  • loadQuery accepts a fetchPolicy of 'store-only'
  • loadQuery now warns, instead of throwing, if called during the render phase.

General

  • getDataID is now a stable config option. See description in Breaking Changes.
  • Default value for gcReleaseBufferSize is now 10. See description in Breaking Changes.
  • ConnectionHandler will no longer create edges with an undefined cursor field. This also applies to edges created via @appendNode or @prependNode. (https://github.com/facebook/relay/pull/3278)
  • Several tests migrated to be compile their graphql with Rust Compiler.

Fixed

If upgrading from experimental release

  • If loadQuery is called and no network request is made (i.e. if the data is available in the store and the fetch policy allows it), the query is retained in the environment.
  • loadQuery now includes the network cache config in the operation descriptor that is executed against the environment.
relay - v11.0.0-rc.0

Published by jstejada over 3 years ago

To install, run:

npm install react-relay@dev relay-runtime@dev
npm install relay-compiler@dev babel-plugin-relay@dev --dev

See this issue for more details on upcoming releases. We will publish our updated docs and website with the next stable release, along with additional external communications with the community.

The new docs will be more comprehensive, and are still are ongoing updates. In the meantime, in order to access some documentation for the APIs in this RC, you can access our current experimental docs, or manually build the docs in website-v2.

Breaking

  • New version of fetchQuery:
    • New: New version of fetchQuery now returns a lazy Observable which you can subscribe to. It will perform in-flight request de-duping of identical requests. Ignores any Network Layer caching by default, but supports a fetchPolicy to check data cached in the Relay Store.
    • Deprecated: Previous version of fetchQuery renamed to fetchQuery_DEPRECATED. Previous behavior returns a Promise (can’t be observed). No request de-duping.
    • Changes in Exports:
      • react-relay: fetchQuery exported from react-relay now has updated behavior and function signature. To access previous version of fetchQuery, import fetchQuery_DEPRECATED from react-relay or react-relay/legacy.
      • relay-runtime: fetchQuery exported from relay-runtime now has updated behavior and function signature. To access previous version of fetchQuery, import fetchQuery_DEPRECATED from relay-runtime.
  • getDataID was renamed from UNSTABLE_DO_NOT_USE_getDataID. This config option is now stable. It can be passed to the Relay Environment and Relay Store as an option that will be used to compute the Data ID for the given record.
  • Default value for gcReleaseBufferSize is now 10 (previously 0).
    • When a query is manually released, for example when a query component unmounts (QueryRenderer or useLazyLoadQuery), Relay will temporarily retain the query in the “release buffer” until the buffer is full. With a buffer size of 0, released queries would not go into the buffer and would be immediately removed from the store cache.
    • With a default buffer size of 10, this means that queries will remained cached in the store for a longer period of time after they unmount, which allows fetch policies like store-or-network to actually reuse cached data when navigating back to previously visited views.

If upgrading from experimental release

  • The default UNSTABLE_renderPolicy is now always “partial”. We don’t expect this to produce any issues, and will only affect you if you are upgrading from an experimental release. This option can still be configured, but we will completely remove it in the upcoming stable release.

Added

Relay Hooks

  • New Relay Hooks APIs added to react-relay and react-relay/hooks. See this issue for more details.
    • relay-experimental has been removed from the source code, and no new experimental builds will be published to npm.
    • We will share more external communications with the community as well as publish our updated docs once a stable release is published.
  • New version of fetchQuery added. See description in Breaking Changes.

General

Improvements

If upgrading from experimental release

  • Hooks are now resilient to React effects being re-invoked (e.g. during Fast Refresh).
  • Un-actionable warning that fired when fragment data was missing without being fetched has been removed.
  • loadQuery accepts a fetchPolicy of 'store-only'
  • loadQuery now warns, instead of throwing, if called during the render phase.

General

  • getDataID is now a stable config option. See description in Breaking Changes.
  • Default value for gcReleaseBufferSize is now 10. See description in Breaking Changes.
  • ConnectionHandler will no longer create edges with an undefined cursor field. This also applies to edges created via @appendNode or @prependNode. (https://github.com/facebook/relay/pull/3278)
  • Several tests migrated to be compile their graphql with Rust Compiler.

Fixed

If upgrading from experimental release

  • If loadQuery is called and no network request is made (i.e. if the data is available in the store and the fetch policy allows it), the query is retained in the environment.
  • loadQuery now includes the network cache config in the operation descriptor that is executed against the environment.
relay - 10.1.3

Published by poteto over 3 years ago

Improvements

  • Improve testing documentation grammar (#3296)
  • Support multiple edges in @appendEdge and @prependEdge [2425572b1]

Fixed

  • Display code context for single error, fixes #3318 (#3322)
  • Fix accidental cancelation of network request when using loadQuery APIs [20e8b6b14]
  • loadQuery dedupes requests even before AST is available [4527a5bac]

Misc

  • Documentation fixes and improvements (#3327)
  • Remove "use strict" directive from ES modules [5d555a4db]
  • Bump node-notifier from 8.0.0 to 8.0.1 (#3301)
  • Convert RelayReader-test.js to use new compiler [c0f0f1088]
  • Convert ReactRelayFragmentContainer-WithFragmentOwnership-test.js to use the new compiler [ff0ad178f]
  • Convert ReactRelayPaginationContainer-test.js to use the new compiler [bede32d3d]
  • Convert ReactRelayRefetchContainer-WithFragmentOwnership-test to use the new compiler [20051f61f]
relay - 10.1.2

Published by alunyov almost 4 years ago

Improvements

  • Avoid throwing in the DeclarativeMutationHandler when the server returns null [9d31dfbd5]
  • Remove old network event names [5075851cb]

Fixed

  • Bump ini from 1.3.5 to 1.3.7 (#3293)
  • Bump ini from 1.3.5 to 1.3.7 in /website (#3292)
  • Fix code example typo in homepage (#3290)
relay - 10.1.1

Published by alunyov almost 4 years ago

Improvements

Fixed

Misc

relay - 10.1.0

Published by alunyov almost 4 years ago

Added

  • Added @appendNode and @prependNode declarative mutation directives for inserting a node to connections (#3155) [0fe732dab]
    • Usage: comments @appendNode(connections: $connections, edgeTypeName: "CommentEdgeType") { id }
  • Added @deleteEdge directive for removing the edge from connections (#3177) [01d65b3]
    • Usage: deletedCommentId @deleteEdge(connections: $connections)
  • Added plural support for @deleteRecord directive (#3135) [27f938c2a]
    • Usage: deletedCommentIds @deleteRecord
  • Made scheduleGC a public function inside RelayModernStore (#3167) [97401cb]
  • Added cacheConfig in RequestDescriptor (#3070) … [eb256a3]

Improvements

  • Remove fragment naming enforcement from JS compiler [ff1c10bc6]

Fixed

  • Docs: fix typos of the 'A Guided Tour' page (#3236) [e4413bfd0]
  • Fix prependNode and prependEdge in declarative connection [7c836dfc4]
  • Fix warning for plural fragment ref pointing to null data [c1a6831e4]
  • Don't setTimeout in loadQuery in SSR [2da0325e5]
  • Fix @match with __typename: other in MatchContainer [92c8d6821]
  • Fix conflicting field value warning [7e3deb415]
  • Bugfix for validating optimistic updates containing undefined fields … [6a1586d]
  • Dispose nested entrypoints when calling dispose() [d5352a2c9]

Misc

  • In @relay/react-relay, we now use ^16.9.0 || ^17 as a peerDependency.

Experimental

  • Added various minor improvements and fixes to the loadQuery API.
  • useQueryLoader now accepts an initial query reference.
  • Prevent usePreloadedQuery from consuming stale cached query refs
  • Stop caching errors at fragment boundaries, which prevented
  • Warn when attempting to use an already disposed PreloadedQuery or PreloadedEntryPoint [187bd3489]
  • Make sure loadQuery requests are deduped when started (vs at render time) [a21b1cb0b]
  • Add Relay log event for when an EntryPointContainer uses an entrypoint component resource [7818bfb2c]
  • Create type utility EntryPointElementConfig [7d0224003]
  • Unsubscribe network requests when releasing temporary retains [933b2800b]
  • Optimize getFragmentIdentifier [ac3a252b6]
  • holdGC for incremental responses in QueryExecutor [b3ecce2da]

Relay Compiler in Rust

The Relay team is actively working on the new compiler implemented in Rust. The majority of recent changes you can see in the repo are related to the compiler. This new version won't be included in the release, as we are still working on the migration strategies for our OSS customers.

Thank you for all outstanding contribution to the Relay compiler (https://github.com/facebook/relay/pull/3182)

relay - v10.0.1

Published by rbalicki2 about 4 years ago

Experimental

relay -

Published by rbalicki2 over 4 years ago

Breaking

  • Change missing field handlers for “linked” fields to treat null as null. Previously, returning either null or undefined indicated that a value could not be determined, and there was no way to indicate that the field value should be set to null. To indicate "no value can be provided", return undefined instead (f106ca0a4)

Added

  • New Declarative connection mutations: we added several directives to make common store updates in mutations easier. An updater is no longer required for following cases: @deleteRecord (applied to a field of type ID) will delete the record with the given id from the store. @appendEdge and @prependEdge (applied to a connection edge field) will append or prepend the edge to the listed connections (07ccab7cc, 687d89b4b, 271932432)
  • Precise type refinement: gated by RelayFeatureFlags.ENABLE_PRECISE_TYPE_REFINEMENT. With this feature enabled Relay more accurately models GraphQL semantics around inline fragments and fragment spreads which have a different type than their parent selection. This helps Relay to more accurately determine if a query can be fulfilled from the cache (ie with the ‘store-or-network’ fetch policy) and also more accurately determine if data is missing and that a component should suspend. Generally speaking, the change is observable as fewer false positives where Relay thinks data is “missing” when it isn’t. This feature will be enabled by default in a subsequent release; we recommend enabling it now. (00985e11c, 11bf467ab, ef93983a5, 1e0dba0c6, 331871932, f7ba97018, 08ba6f062, 7c67b4750, 2cf9ac982)
  • Warn if a single GraphQL response contains conflicting values for a given field on the same entity (same DataID) (87520d3ef)
  • Optimize RequestIdentifier. Previously if the query was not persisted this used the full query text, now a hash of the query is used instead (a3acc08d3)
  • Enable parsing of Flow enums (bcd7a81b2)
  • Add the referenced DataIDs in the store.gc log event (adb64b7f0)
  • Garbage collection is now yieldy: the GC mark/sweep yields after processing each unit, restarting if a write to the store occurs (687e332e8)
  • PreloadableQueryRegistry is moved from experimental to relay-runtime (6fe43238a)

Fixed

  • Fixed fatal in joinArgumentDefinitions (85b44e7e5)
  • Generate a static storageKey on field nodes for lists and objects whose values are all static (34b1dc032)
  • Fix @refetchable query generation for interfaces without own id field (d307b37aa)
  • Avoid a memory leak that can occur in some JS runtimes where Error objects can retain data on the call stack until its stack property is evaluated (2859aa8df)
  • Fix bug with treatMissingFieldsAsNull flag and client extensions (5085aeaf7)
  • Fix a memory leak (8c1e91b22)

Misc

  • Added internal utility types PreloadPropsOf and VariablesOf (796950edc, f1f784f62)
  • Use isMountedRef internal hook in query and EntryPoint loaders (61c862739)
  • Emit LogEvents for Store publish/notify (60b339ba7)
  • Flow updates: add codes to error suppressions, don’t mix import/require in flowtests (fba793099, 232dd9518)
  • Removed unused request parameter in ResponseNormalizer options (651ced50a)
  • Make RelayError messages parameterized (0e7285428)
  • Print the @defer and @stream directives last (this helps with parity between the JS and Rust compiler output) (7271283f5)
  • Run the SkipRedundantNodes transform on SplitOperation nodes (used for data-driven dependencies) (1bc049e8c)
  • Sort test metadata object keys (9a5cd5c78)
  • Use scheduler to schedule consistency updates outside of QueryExecutor (8af33554d, 315bcf93e)
  • Fixed spelling mistakes: (564310dbf, c472ba337)
  • Cleanup unused code: (fba7c8a47, 92b110b40, 56dc1d680, 681f0cdbf, a9cbabe77, 37ae1e7ff, 292b1e819, 8bb58096c)
  • Update generated label for defer/stream nodes (2ae19c307)
  • Sort keys of objects appearing as default values in arguments (3b8a288a1)
  • Remove plural: false metadata in generated artifacts (487016f6f)
  • Sort type spreads in the generate id transform (3de995a87)
  • Sort metadata on generated artifacts by key (bf5484c36)
  • Remove nonStrictEnums setting for defaultValues (78847c68c)
  • Sort argumentDefinitions in queries generated by RefetchableTransform (c4ec34b8a)
  • Add environmentProviderOptions to PreloadedQuery (2365b0101)
  • Remove unused type in argument definitions (812e0f466)
  • Sort fragment arguments, updated artifacts (b065ae242)
  • Remove number of arguments check for fetch queries (9e292990b)
  • Generated ID fields now have the type from the schema (b63815b82)
  • Rename cacheTime property to fetchTime (57719ccd0)
  • Remove unused fragmentRefPathInResponse argument (251703eae)
  • Ensure cursor/count metadata check is limited to extraVariables in getPaginationVariables (84565d41e)
  • GenerateTypeNameTransform generates non-nullable String type for __typename (b128d82bc)
  • Fix check for whether a type is client type (1ccf069dd)
  • Fix printing indentation of conditions (cdd2c4783)
  • Apply fragment arguments on Defer/Stream node (8d8ba8b3e)
  • Remove ValidateServerOnlyDirectivesTransform from IRTransforms (9593d5736)
  • Remove label arg from @stream_connection (2e2be4cac)
  • Strip compiler-only metadata from generated files (229987890, fddd31b08)
  • Also create a proxy for executeWithSource in RelayModernMockEnvironment (8b3df8c86)
  • fetchQueryDeduped accepts a RequestIdentifier instead of an OperationDescriptor (041c6ecf7)
  • remove type condition from @defer fragments (23300a90c)
  • Add onLoad support to PreloadableQueryRegistry (8242adca0)

Experimental

  • New useQueryLoader() and useEntryPointLoader() hooks for loading queries and EntryPoints from a component. These hooks wrap the internal loadQuery() and loadEntryPoint() APIs to manage the lifecycle of returned resources (ie, disposing the resources when the component un-mounts) (676660dc8, f512c9f6b, c819d414d, d64fe2664)
  • Misc
    • Relay Hooks: useDebugValue to show fragment/query values (e9135791c)
    • Expose networkCacheConfig in preloaded query references (605ac7fe3)
    • Handle case where loadQuery result is rendered under a different environment (08bb2d2db)
    • Don't expose preloadQuery from relay-experimental (d1c8cb59e)
    • Remove PreloadableQueryRegistry from relay-experimental (not a public API) (52ccd2671)
    • prepareEntryPoint returns void and is deprecated (a5534ea95)
    • Removed (internal) variant of PreloadedEntryPoint (09b823699)
relay - v9.1.0

Published by rbalicki2 over 4 years ago

9.1.0

Added

  • Add option in Environment to handle stripped nulls in payload by [email protected], 2020-04-21 (7a798d16)
  • Added queryCacheExpirationTime option to RelayModernStore. Query data in the Relay store will be treated as stale after expiration (add maxTtl to relay store by [email protected], 2020-04-06 (bb888069c))
  • Change toPromise to complete Observable by [email protected], 2020-04-02 (9ef158d08)
  • make the relay environment not responsible for determining whether it is a server environment by [email protected], 2020-04-01 (d11e6497c)
  • sort object keys alphabetically by [email protected], 2020-03-19 (d3ccdf0e7)
  • Allow duplicate 3D selections w identical fragment+module by [email protected], 2020-03-19 (7b4870f5b)
  • Expose query id in preloaded query references by [email protected], 2020-03-10 (98e5cb66f)
  • MockPayloadGenerator: do not generate data for CLIENT_EXTENSIONS by [email protected], 2020-03-04 (b9f14dbab)

Fixed

  • rework persisted query re-using by [email protected], 2020-04-02 (adaa938c5)
  • Visit SplitOperation in ApplyFragmentArgumentTransform and SkipUnreachableNodeTransform by [email protected], 2020-04-02 (8cfd01d0f)
  • sort object keys in missing cases by [email protected], 2020-03-31 (3d218a7c5)
  • Move SplitModuleImport transform to Relay Query Transforms Pipeline by [email protected], 2020-03-31 (eb0618472)
  • remove loggerProvider from RelayModernMockEnvironment by [email protected], 2020-03-27 (fa1320c6f)
  • Relay Modern Store: always update the root entry fetch time in notify by [email protected], 2020-03-27 (62a229a75)
  • fix inverted case of sorted object keys rollout by [email protected], 2020-03-25 (6d1d83045)
  • fix missing sort of operation object keys by [email protected], 2020-03-24 (4d62e24d0)
  • Avoid removing directives on inlineFragment in FlattenTransform for printing by [email protected], 2020-03-24 (3b188979b)
  • Stop wrapping FragmentSpread on client type in ClientExtension by [email protected], 2020-03-24 (e8e99c910)
  • Fixed feature flag for containers suspending which should be off by default by [email protected], 2020-03-23 (061a6800b)
  • Fix generated aliases for 3D fields with keys by [email protected], 2020-03-20 (84df7a47b)
  • Enforce that multiple 3D selections per document use a unique key by [email protected], 2020-03-18 (0ace9d3fb)
  • Fix validation of handler arg in @connection validation by [email protected], 2020-03-09 (62a10d806)
  • Add flow types for ReactTestRenderer by [email protected], 2020-03-05 (7be1a84ee)
  • Allow client-side schema extensions in optimisticResponse by [email protected], 2020-03-03 (b00736ea2)
  • Remove existingFragmentNames compat feature by [email protected], 2020-02-27 (a49b2086a)
  • Refactor store release buffer management by [email protected], 2020-02-20 (c8471bf76)
  • Disallow typename on Root by [email protected], 2020-02-18 (793729e7a)

Misc

  • cleanup @relayRequestID header rollout by [email protected], 2020-04-02 (8d71ae1a2)
  • remove redundant check for node type by [email protected], 2020-04-02 (2edce9f6a)
  • remove sort-object-keys rollout by [email protected], 2020-04-02 (640cf9ce0)
  • Use React.useTransition for relay-experimental tests instead of copied version by [email protected], 2020-03-26 (1befdc085)
  • easy: fix typos in relay modern store by [email protected], 2020-03-23 (a9d891093)
  • add test for explicit null argument (#3047) by [email protected], 2020-03-13 (027fbd10e)
  • Add more snapshots for printing conditions to match Rust tests by [email protected], 2020-03-06 (24180d758)
  • Add 2 JS snapshot tests to SkipRedundantNodesTransform by [email protected], 2020-03-06 (9883c8161)
  • add profilerContext to queryresource.fetch event by [email protected], 2020-02-28 (ac226710b)
  • update getModuleName to skip all extra suffixes in the filename by [email protected], 2020-02-14 (4370cac47)

Experimental

  • add useSubscription hook by [email protected], 2020-02-26 (42056a786)
  • add fetchPolicy support in fetchQuery by [email protected], 2020-04-06 (7395010b0)
  • Remove unsafe cancelation of query in flight in concurrent mode by [email protected], 2020-04-03 (b96441bdc)
  • Fix recycling of data in FragmentResource::subscribe by [email protected], 2020-02-19 (2093478c8)
  • Fix unsafe tracking of refetch generation in useRefetchableFragment for concurrent mode by [email protected], 2020-04-06 (a8614dd12)
  • Clean up useBlockingPaginationFragment tests for latest React Suspense fixes by [email protected], 2020-03-31 (baa11ce62)
  • Minor cleanup of useBlockingPagination w/ Suspense test by [email protected], 2020-03-31 (754c64ff1)
  • Re-enable Suspense useBlockingPagination test which was accidentally disabled by [email protected], 2020-03-30 (dc47d6f5f)
  • Disallow user defined object to be used in fragmentRef arguments by [email protected], 2020-03-18 (084e16592)
  • Disallow user defined object to be used as key in useFragment by [email protected], 2020-03-17 (b1442b990)
  • Minor refactor of useLazyLoadQuery test by [email protected], 2020-03-06 (5ec8737a6)
  • Fix useMutation with fast refresh by [email protected], 2020-02-24 (86f5456af)
  • Rename useIsParentQueryInFlight to useIsParentQueryActive by [email protected], 2020-02-19 (3794f0bcd)
  • Fix concurrent mode data race when calling loadNext and checking for active request by [email protected], 2020-02-19 (251701d46)
  • Remove extraneous extraOptions field. by [email protected], 2020-02-12 (2b8697733)
  • add queryresource.retain event by [email protected], 2020-03-30 (cc5728744)
relay - v9.0.0

Published by jstejada over 4 years ago

9.0.0

Breaking

  • Rename getModernOperationVariables to getOperationVariables

Added

Fixed

Misc

  • DataChecker::check now returns the operation fetch time.
  • Removed getRelayDefaultMissingFieldHandlers.js

Experimental

  • Fix leaking environments when using Relay Hooks (https://github.com/facebook/relay/pull/3014).
  • Fix support of Fast Refresh when used with Relay Hooks.
  • Fix recycling data for plural fragments; i.e. return an array with the sam object identity if the data hasn’t changed.
  • Add support for batched @stream’ed responses.
  • Internally renamed useLegacyPaginationFragment to usePaginationFragment.
  • Potentially Breaking
    • preloadQuery will error if called during render.
    • Remove new connection model experimental code.
    • We know check for “active” instead of queries in “flight” when determining when to suspend. An operation may be indefinitely in flight (e.g. a live query, or a GraphQL Subscription), but it’s only “active” if it’s actively receiving payloads, e.g. during @streaming or @defer.
relay - v8.0.0

Published by jstejada almost 5 years ago

8.0.0

Commits: https://github.com/facebook/relay/compare/v7.1.0...v8.0.0

Breaking

  • Relay Compiler no longer relies on the graphql-js schema representation. And consumes only SDL file that represents the schema. This means that all custom implementations relay compiler runners that were depended on the specifics of the graphql-js may not work as expected. Specifically, custom Enum values are no longer available in the relay-compiler - as they cannot be expressed via SDL. Also, custom function parseValue, parseLiteral and serialize that can be defined for a graphql type via graphql-js primitives are not accessible in the relay compiler: this may break serialization of custom scalars. https://github.com/facebook/relay/commit/860c23cbb445e04fd14e5d05ed53a026d4f63357
  • Babel plugin no longer produces thunks: https://github.com/facebook/relay/commit/490c89dfea7513e5624bc7b8c66204078d3b5911
  • Mutations are committed to unique root ids https://github.com/facebook/relay/pull/2349. In mutation updaters, fields in the mutation will no longer be available in the store root returned from store.getRoot. Usages like store.getRoot().getLinkedRecord('create_comment_mutation') will break.
  • Removed internally unused RelayRecordSourceProxy::commitPayload(). Note that this method was not part of the public interface.
  • Signature of RelayStore.retain() changed to directly accept an OperationDescriptor. An operation descriptor to pass to RelayStore.retain()can be constructed usingcreateOperationDescriptoravailable inrelay-runtime`.

Added

Fixed

Misc

Experimental

relay - v7.1.0

Published by alunyov almost 5 years ago

7.1.0

Added

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

Fixed

Misc

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

Experimental

relay - v7.0.0

Published by jstejada almost 5 years ago

7.0.0

Commits: https://github.com/facebook/relay/compare/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 (https://github.com/facebook/relay/commit/15e8d2201fdad47596e1acfb3a5daa3fb7511a8e). Additionally, we've removed the concept of RelayIRValidations (https://github.com/facebook/relay/commit/da01bf3fc18774115821fc4a33558b51e04a82e4), 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 (https://github.com/facebook/relay/commit/3dd79e859144030158fe996e714ebfd7b16751fd) @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

Misc

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.
relay - v6.0.0

Published by jstejada about 5 years ago

Commits: https://github.com/facebook/relay/compare/v5.0.0...v6.0.0

Breaking

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

Fixed

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 https://github.com/facebook/relay/commit/6f0129531caac238b5dc5725819be543c5672388. 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)
relay - v5.0.0

Published by alunyov over 5 years ago

Commits: https://github.com/facebook/relay/compare/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

Misc

relay - v4.0.0

Published by alunyov over 5 years ago

Commits: https://github.com/facebook/relay/compare/v3.0.0...v4.0.0

Breaking

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

Misc

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.
relay - v3.0.0

Published by jstejada over 5 years ago

3.0.0

Commits: https://github.com/facebook/relay/compare/v2.0.0...v3.0.0

Breaking

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

Fixed

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.
relay - v2.0.0

Published by jstejada over 5 years ago

2.0.0

Commits: https://github.com/facebook/relay/compare/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.
Package Rankings
Top 0.37% on Npmjs.org
Top 21.21% on Repo1.maven.org
Top 10.87% on Bower.io
Top 3.57% on Proxy.golang.org
Badges
Extracted from project README
GitHub license npm version