From b2bc861ffeee1b639c0a63cc8ac1255233cd6906 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 Dec 2021 16:05:09 +0100 Subject: [PATCH] chore(release): update monorepo packages versions (#852) Co-authored-by: github-actions[bot] --- .changeset/blue-countries-whisper.md | 7 -- .changeset/cool-mice-float.md | 5 -- .changeset/many-cooks-walk.md | 5 -- .changeset/strange-kangaroos-change.md | 62 ----------------- .../package.json | 2 +- .../CHANGELOG.md | 8 +++ .../package.json | 4 +- .../graphql-live-query-patch/CHANGELOG.md | 6 ++ .../graphql-live-query-patch/package.json | 2 +- .../in-memory-live-query-store/CHANGELOG.md | 67 +++++++++++++++++++ .../in-memory-live-query-store/package.json | 2 +- 11 files changed, 86 insertions(+), 84 deletions(-) delete mode 100644 .changeset/blue-countries-whisper.md delete mode 100644 .changeset/cool-mice-float.md delete mode 100644 .changeset/many-cooks-walk.md delete mode 100644 .changeset/strange-kangaroos-change.md diff --git a/.changeset/blue-countries-whisper.md b/.changeset/blue-countries-whisper.md deleted file mode 100644 index 8bcbfdf6..00000000 --- a/.changeset/blue-countries-whisper.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@n1ru4l/in-memory-live-query-store": minor ---- - -The source returned from execute is now lazy and will only start emitting values once it is consumed. This prevents memory leaks. - -**BREAKING**: If the wrapped `execute` function returns a stream (e.g. because you forgot to add the `NoLiveMixedWithDeferStreamRule` validation rule) it causes the `execute` function to reject instead of publishing a ExecutionResult error payload. This change has been made in order to treat the error as unexpected and not leak any implementation details to the clients. diff --git a/.changeset/cool-mice-float.md b/.changeset/cool-mice-float.md deleted file mode 100644 index 9b0ec51e..00000000 --- a/.changeset/cool-mice-float.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@n1ru4l/graphql-live-query-patch": patch ---- - -fix memory leak cause by AsyncIterables not being disposed properly. diff --git a/.changeset/many-cooks-walk.md b/.changeset/many-cooks-walk.md deleted file mode 100644 index 538422a6..00000000 --- a/.changeset/many-cooks-walk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@n1ru4l/graphql-live-query-patch-json-patch": patch ---- - -unpin `fast-json-patch` dependency. diff --git a/.changeset/strange-kangaroos-change.md b/.changeset/strange-kangaroos-change.md deleted file mode 100644 index 85aa0b78..00000000 --- a/.changeset/strange-kangaroos-change.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -"@n1ru4l/in-memory-live-query-store": minor ---- - -Allow setting custom invalidation indices. - -Until now doing granular or very specific index invalidations wasn't possible. Thus invalidation might not have been efficient enough, as either too many or too few live query operation "subscriptions" got invalidated. - -The new `indexBy` configuration option for the `InMemoryLiveQueryStore`, allows configuring specific indices suitable for the consumed GraphQL schema, resulting more granular and efficient invalidations. - -**Invalidate by single field with arguments:** - -```ts -const store = new InMemoryLiveQueryStore({ - includeIdentifierExtension: true, - indexBy: [ - { - field: "Query.posts", - args: ["needle"], - }, - ], -}); - -const execute = store.makeExecute(executeImplementation); - -const document = parse(/* GraphQL */ ` - query @live { - posts(needle: "skrrrrt") { - id - title - } - } -`); - -const executionResult = execute({ document, schema }); - -let result = await executionResult.next(); -expect(result.value).toEqual({ - data: { - posts: [], - }, - extensions: { - liveResourceIdentifier: ["Query.posts", 'Query.posts(needle:"skrrrrt")'], - }, - isLive: true, -}); -``` - -**Invalidation by single field with specific arguments:** - -```ts -const store = new InMemoryLiveQueryStore({ - includeIdentifierExtension: true, - indexBy: [ - { - field: "Query.posts", - // index will only be used if the needle argument value equals "brrrrt" - args: [["needle", "brrrrt"]], - }, - ], -}); -``` diff --git a/packages/graphql-live-query-patch-json-diff/package.json b/packages/graphql-live-query-patch-json-diff/package.json index e8e6af8a..288f495f 100644 --- a/packages/graphql-live-query-patch-json-diff/package.json +++ b/packages/graphql-live-query-patch-json-diff/package.json @@ -20,7 +20,7 @@ ], "dependencies": { "@n1ru4l/json-patch-plus": "^0.1.4", - "@n1ru4l/graphql-live-query-patch": "^0.6.0" + "@n1ru4l/graphql-live-query-patch": "^0.6.1" }, "devDependencies": { "graphql": "16.0.0-experimental-stream-defer.5", diff --git a/packages/graphql-live-query-patch-json-patch/CHANGELOG.md b/packages/graphql-live-query-patch-json-patch/CHANGELOG.md index fde481ba..a6df0405 100644 --- a/packages/graphql-live-query-patch-json-patch/CHANGELOG.md +++ b/packages/graphql-live-query-patch-json-patch/CHANGELOG.md @@ -1,5 +1,13 @@ # @n1ru4l/graphql-live-query-patch-json-patch +## 0.6.1 + +### Patch Changes + +- 727e806: unpin `fast-json-patch` dependency. +- Updated dependencies [727e806] + - @n1ru4l/graphql-live-query-patch@0.6.1 + ## 0.6.0 ### Minor Changes diff --git a/packages/graphql-live-query-patch-json-patch/package.json b/packages/graphql-live-query-patch-json-patch/package.json index 904fd34f..501117b2 100644 --- a/packages/graphql-live-query-patch-json-patch/package.json +++ b/packages/graphql-live-query-patch-json-patch/package.json @@ -1,6 +1,6 @@ { "name": "@n1ru4l/graphql-live-query-patch-json-patch", - "version": "0.6.0", + "version": "0.6.1", "author": "n1ru4l ", "license": "MIT", "repository": { @@ -19,7 +19,7 @@ "real-time" ], "dependencies": { - "@n1ru4l/graphql-live-query-patch": "^0.6.0", + "@n1ru4l/graphql-live-query-patch": "^0.6.1", "fast-json-patch": "^3.1.0" }, "devDependencies": { diff --git a/packages/graphql-live-query-patch/CHANGELOG.md b/packages/graphql-live-query-patch/CHANGELOG.md index 4efb8b58..0e2d3b34 100644 --- a/packages/graphql-live-query-patch/CHANGELOG.md +++ b/packages/graphql-live-query-patch/CHANGELOG.md @@ -1,5 +1,11 @@ # @n1ru4l/graphql-live-query-patch +## 0.6.1 + +### Patch Changes + +- 727e806: fix memory leak cause by AsyncIterables not being disposed properly. + ## 0.6.0 ### Minor Changes diff --git a/packages/graphql-live-query-patch/package.json b/packages/graphql-live-query-patch/package.json index 56e2c862..c9937daa 100644 --- a/packages/graphql-live-query-patch/package.json +++ b/packages/graphql-live-query-patch/package.json @@ -1,6 +1,6 @@ { "name": "@n1ru4l/graphql-live-query-patch", - "version": "0.6.0", + "version": "0.6.1", "author": "n1ru4l ", "license": "MIT", "repository": { diff --git a/packages/in-memory-live-query-store/CHANGELOG.md b/packages/in-memory-live-query-store/CHANGELOG.md index 564bb9f9..48cceef6 100644 --- a/packages/in-memory-live-query-store/CHANGELOG.md +++ b/packages/in-memory-live-query-store/CHANGELOG.md @@ -1,5 +1,72 @@ # @n1ru4l/in-memory-live-query-store +## 0.9.0 + +### Minor Changes + +- 727e806: The source returned from execute is now lazy and will only start emitting values once it is consumed. This prevents memory leaks. + + **BREAKING**: If the wrapped `execute` function returns a stream (e.g. because you forgot to add the `NoLiveMixedWithDeferStreamRule` validation rule) it causes the `execute` function to reject instead of publishing a ExecutionResult error payload. This change has been made in order to treat the error as unexpected and not leak any implementation details to the clients. + +- aee5d58: Allow setting custom invalidation indices. + + Until now doing granular or very specific index invalidations wasn't possible. Thus invalidation might not have been efficient enough, as either too many or too few live query operation "subscriptions" got invalidated. + + The new `indexBy` configuration option for the `InMemoryLiveQueryStore`, allows configuring specific indices suitable for the consumed GraphQL schema, resulting more granular and efficient invalidations. + + **Invalidate by single field with arguments:** + + ```ts + const store = new InMemoryLiveQueryStore({ + includeIdentifierExtension: true, + indexBy: [ + { + field: "Query.posts", + args: ["needle"] + } + ] + }); + + const execute = store.makeExecute(executeImplementation); + + const document = parse(/* GraphQL */ ` + query @live { + posts(needle: "skrrrrt") { + id + title + } + } + `); + + const executionResult = execute({ document, schema }); + + let result = await executionResult.next(); + expect(result.value).toEqual({ + data: { + posts: [] + }, + extensions: { + liveResourceIdentifier: ["Query.posts", 'Query.posts(needle:"skrrrrt")'] + }, + isLive: true + }); + ``` + + **Invalidation by single field with specific arguments:** + + ```ts + const store = new InMemoryLiveQueryStore({ + includeIdentifierExtension: true, + indexBy: [ + { + field: "Query.posts", + // index will only be used if the needle argument value equals "brrrrt" + args: [["needle", "brrrrt"]] + } + ] + }); + ``` + ## 0.8.0 ### Minor Changes diff --git a/packages/in-memory-live-query-store/package.json b/packages/in-memory-live-query-store/package.json index 95ca6989..51f725cd 100644 --- a/packages/in-memory-live-query-store/package.json +++ b/packages/in-memory-live-query-store/package.json @@ -1,6 +1,6 @@ { "name": "@n1ru4l/in-memory-live-query-store", - "version": "0.8.0", + "version": "0.9.0", "author": "n1ru4l ", "license": "MIT", "repository": {