From 3c15e784fb5942786aed0c6ae40d31ef253c7939 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 12 Jul 2024 11:05:24 +0000 Subject: [PATCH] Version Packages --- .changeset/cold-bikes-sit.md | 22 ----------------- .changeset/pink-items-join.md | 16 ------------- .changeset/strong-melons-sip.md | 9 ------- packages/opa-react/CHANGELOG.md | 42 +++++++++++++++++++++++++++++++++ packages/opa-react/package.json | 2 +- 5 files changed, 43 insertions(+), 48 deletions(-) delete mode 100644 .changeset/cold-bikes-sit.md delete mode 100644 .changeset/pink-items-join.md delete mode 100644 .changeset/strong-melons-sip.md diff --git a/.changeset/cold-bikes-sit.md b/.changeset/cold-bikes-sit.md deleted file mode 100644 index 0ed88c75..00000000 --- a/.changeset/cold-bikes-sit.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -"@styra/opa-react": minor ---- - -Support batching requests sent to the backend (optional) - -When used with [Enterprise OPA's Batch API](https://docs.styra.com/enterprise-opa/reference/api-reference/batch-api), this mode allows for sending much -fewer requests to the backend. It's enabled by setting `batch={true}` on ``. - -Note that the Batch API has no notion of "default query", so it's not possible -to use batching without having either `defaultPath` (``) or -`path` (`useAuthz()`, ``) set. - -Please note that `fromResult` is exempt from the cache key, so multiple requests -with the same path and input, but different `fromResult` settings will lead to -unforeseen results. -This is on par with the regular (non-batching) caching, and we'll revisit this -if it becomes a problem for users. Please create an issue on Github if it is -problematic for you. - -Furthermore, batching queries are not wired up with `AbortController` like the -non-batching equivalents are. diff --git a/.changeset/pink-items-join.md b/.changeset/pink-items-join.md deleted file mode 100644 index 42ad312c..00000000 --- a/.changeset/pink-items-join.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -"@styra/opa-react": minor ---- - -Introduce `@tanstack/react-query` for policy evaluation request caching - -With this release, multiple uses of `useAuthz` and `` with the same inputs no longer unconditionally lead to API requests. -Using `@tanstack/react-query` underneath, `useAuthz` will now return cached results when applicable. - -Furthermore, API requests are retried on transient errors. -You can control the retry count via `AuthzProvider`'s `retry` property. - -**NOTE** The `fromResult` property/argument is currently exempt from the cache key -- so two requests with the same `path` and `input` will produce the same result even if their `fromResult` differs. -We believe that this is quite uncommon, please file an issue if it is a problem in your use case. - -For details on how and when the cache is invalidated, please refer to the docs here: https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults diff --git a/.changeset/strong-melons-sip.md b/.changeset/strong-melons-sip.md deleted file mode 100644 index edeefca7..00000000 --- a/.changeset/strong-melons-sip.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@styra/opa-react": minor ---- - -change exported interfaces names, and AuthzProvider property - -The export iterface `SDK` is now called `OPAClient` for consistency with `@styra/opa`. - -It is used in `AuthzProviderContext` and `AuthzProviderProps`, and has been renamed from `sdk` to `opaClient`. diff --git a/packages/opa-react/CHANGELOG.md b/packages/opa-react/CHANGELOG.md index 3106a5e9..d680c545 100644 --- a/packages/opa-react/CHANGELOG.md +++ b/packages/opa-react/CHANGELOG.md @@ -1,5 +1,47 @@ # @styra/opa-react +## 0.5.0 + +### Minor Changes + +- 12f1e98: Support batching requests sent to the backend (optional) + + When used with [Enterprise OPA's Batch API](https://docs.styra.com/enterprise-opa/reference/api-reference/batch-api), this mode allows for sending much + fewer requests to the backend. It's enabled by setting `batch={true}` on ``. + + Note that the Batch API has no notion of "default query", so it's not possible + to use batching without having either `defaultPath` (``) or + `path` (`useAuthz()`, ``) set. + + Please note that `fromResult` is exempt from the cache key, so multiple requests + with the same path and input, but different `fromResult` settings will lead to + unforeseen results. + This is on par with the regular (non-batching) caching, and we'll revisit this + if it becomes a problem for users. Please create an issue on Github if it is + problematic for you. + + Furthermore, batching queries are not wired up with `AbortController` like the + non-batching equivalents are. + +- dd082b5: Introduce `@tanstack/react-query` for policy evaluation request caching + + With this release, multiple uses of `useAuthz` and `` with the same inputs no longer unconditionally lead to API requests. + Using `@tanstack/react-query` underneath, `useAuthz` will now return cached results when applicable. + + Furthermore, API requests are retried on transient errors. + You can control the retry count via `AuthzProvider`'s `retry` property. + + **NOTE** The `fromResult` property/argument is currently exempt from the cache key -- so two requests with the same `path` and `input` will produce the same result even if their `fromResult` differs. + We believe that this is quite uncommon, please file an issue if it is a problem in your use case. + + For details on how and when the cache is invalidated, please refer to the docs here: https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults + +- f9d7ac2: change exported interfaces names, and AuthzProvider property + + The export iterface `SDK` is now called `OPAClient` for consistency with `@styra/opa`. + + It is used in `AuthzProviderContext` and `AuthzProviderProps`, and has been renamed from `sdk` to `opaClient`. + ## 0.4.0 ### Minor Changes diff --git a/packages/opa-react/package.json b/packages/opa-react/package.json index a3c6b477..f3d17fde 100644 --- a/packages/opa-react/package.json +++ b/packages/opa-react/package.json @@ -1,6 +1,6 @@ { "name": "@styra/opa-react", - "version": "0.4.0", + "version": "0.5.0", "repository": { "type": "git", "url": "https://github.com/StyraInc/opa-typescript.git",