repo stringlengths 5 53 | pr_number int32 1 321k | task_type stringclasses 2
values | issue_text stringlengths 0 81.2k | pr_title stringlengths 1 319 | pr_body stringlengths 0 105k | base_sha stringlengths 40 40 | head_sha stringlengths 40 40 | gold_diff stringlengths 0 202M | changed_files listlengths 0 100 | review_threads listlengths 0 100 | test_patch stringlengths 0 23.4M | merged bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
TanStack/query | 10,917 | issue_to_patch | test(solid-query/mutationOptions): centralize 'queryClient' setup with 'beforeEach' | ## 🎯 Changes
Centralize the per-test `new QueryClient()` setup into a shared `let queryClient` declared at the `describe` level and created in `beforeEach`, matching the pattern already used by `useMutation.test.tsx`. `afterEach` now calls `queryClient.clear()`.
All 12 cases that previously created their own `new Qu... | f6c654266820225334245d946d6fb45815325b6b | d2b54d3ceaf47570370c009d4147ec2779b3b291 | [
"packages/solid-query/src/__tests__/mutationOptions.test.tsx"
] | [] | diff --git a/packages/solid-query/src/__tests__/mutationOptions.test.tsx b/packages/solid-query/src/__tests__/mutationOptions.test.tsx
index ea0e568f6a..ac02ac2a46 100644
--- a/packages/solid-query/src/__tests__/mutationOptions.test.tsx
+++ b/packages/solid-query/src/__tests__/mutationOptions.test.tsx
@@ -13,12 +13,16 ... | true | ||
TanStack/query | 10,916 | issue_to_patch | test(solid-query/useIsFetching): centralize 'queryClient' setup with 'beforeEach' and rename injected client to 'customClient' | ## 🎯 Changes
Centralize the per-test `new QueryClient()` setup into a shared `let queryClient` declared at the `describe` level and created in `beforeEach`, matching the pattern already used by `useMutation.test.tsx`. `afterEach` now calls `queryClient.clear()`.
- 4 cases now use the centralized client.
- The `shoul... | f6c654266820225334245d946d6fb45815325b6b | f0113070c425c722ba202ad2f2cf82086accbbc3 | [
"packages/solid-query/src/__tests__/useIsFetching.test.tsx"
] | [] | diff --git a/packages/solid-query/src/__tests__/useIsFetching.test.tsx b/packages/solid-query/src/__tests__/useIsFetching.test.tsx
index 19edce5e08..797c8aaccd 100644
--- a/packages/solid-query/src/__tests__/useIsFetching.test.tsx
+++ b/packages/solid-query/src/__tests__/useIsFetching.test.tsx
@@ -12,18 +12,22 @@ impor... | true | ||
TanStack/query | 10,915 | issue_to_patch | test(solid-query/useMutation): add 'mutateAsync' callback tests for when 'useMutation' has no callbacks | ## 🎯 Changes
Port the `mutateAsync` "no callbacks" tests from `react-query` to `solid-query` to bring the two adapters to behavioral parity. These cases assert that callbacks passed directly to `mutateAsync(variables, { onSuccess, onError, onSettled })` are invoked even when `useMutation` itself declares no callbacks... | 969a556b42a8ea190edb51c3618e3ea1949ad77e | c8af56c79846b38379c0ee119bf3a73f8925f9a5 | [
"packages/solid-query/src/__tests__/useMutation.test.tsx"
] | [] | diff --git a/packages/solid-query/src/__tests__/useMutation.test.tsx b/packages/solid-query/src/__tests__/useMutation.test.tsx
index c80c8f020d..692a4b5503 100644
--- a/packages/solid-query/src/__tests__/useMutation.test.tsx
+++ b/packages/solid-query/src/__tests__/useMutation.test.tsx
@@ -295,6 +295,190 @@ describe('u... | true | ||
TanStack/query | 10,914 | issue_to_patch | test(solid-query/useMutation): add 'mutate' callback tests for when 'useMutation' has no callbacks | ## 🎯 Changes
Port the `mutate` "no callbacks" tests from `react-query` to `solid-query` to bring the two adapters to behavioral parity. These cases assert that callbacks passed directly to `mutation.mutate(variables, { onSuccess, onError, onSettled })` are invoked even when `useMutation` itself declares no callbacks.... | 763782a2403aefaa52ce76601cf0f4912045be34 | 89264056f3ded086d203ac294de641bd4715aff1 | [
"packages/solid-query/src/__tests__/useMutation.test.tsx"
] | [] | diff --git a/packages/solid-query/src/__tests__/useMutation.test.tsx b/packages/solid-query/src/__tests__/useMutation.test.tsx
index 4d22e0ae298..c80c8f020d1 100644
--- a/packages/solid-query/src/__tests__/useMutation.test.tsx
+++ b/packages/solid-query/src/__tests__/useMutation.test.tsx
@@ -108,6 +108,193 @@ describe(... | true | ||
TanStack/query | 1 | issue_to_patch | Bump eslint-utils from 1.3.1 to 1.4.2 | Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2.
<details>
<summary>Commits</summary>
- [`4e1bc07`](https://github.com/mysticatea/eslint-utils/commit/4e1bc077c2a6bb00538d66b69a63c24de3463bed) 1.4.2
- [`e4cb014`](https://github.com/mysticatea/eslint-utils/commit/e4cb01498df6096b66ed... | 9aa54baafe5807b46ee893e72dec3e88f950565b | 2354207204e7af9dcdaa5a80d3242854e0ce355f | diff --git a/yarn.lock b/yarn.lock
index 83326d40721..44525abdf96 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1760,14 +1760,16 @@ eslint-scope@^4.0.3:
estraverse "^4.1.1"
eslint-utils@^1.3.0, eslint-utils@^1.3.1:
- version "1.3.1"
- resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9... | [
"yarn.lock"
] | [] | true | ||
TanStack/query | 314 | issue_to_patch | Bump acorn from 5.7.3 to 5.7.4 in /examples/suspense | [//]: # (dependabot-start)
⚠️ **Dependabot is rebasing this PR** ⚠️
If you make any changes to it yourself then they will take precedence over the rebase.
---
[//]: # (dependabot-end)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https:... | f6178773f0bafc3327863378fc4214c38a887551 | a09a33a5ce44860644de8b304a9ccbbe58c04ffb | diff --git a/examples/suspense/yarn.lock b/examples/suspense/yarn.lock
index 755ea044669..1d5902c09b9 100644
--- a/examples/suspense/yarn.lock
+++ b/examples/suspense/yarn.lock
@@ -1588,9 +1588,9 @@ acorn-walk@^6.0.1:
integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiI... | [
"examples/suspense/yarn.lock"
] | [] | true | ||
TanStack/query | 694 | issue_to_patch | Update global suspense configuration in example | This updates the Suspense example in the readme to use the version 2 global configuration schema where suspense is no longer a top level config option. | 6e6ccfc4809d9e81b563df380be557e3834403ea | 470f18a836ecc48c2fd2c9a6d22fd44f8ca1e26d | diff --git a/README.md b/README.md
index a0cce55a7db..9cc955b65d4 100644
--- a/README.md
+++ b/README.md
@@ -1039,7 +1039,9 @@ Global configuration:
import { ReactQueryConfigProvider } from 'react-query'
const queryConfig = {
- suspense: true,
+ shared: {
+ suspense: true,
+ }
}
function App() {
| [
"README.md"
] | [] | true | ||
TanStack/query | 10,908 | issue_to_patch | test(svelte-query): align 'advanceTimersByTimeAsync' with 'sleep' duration in wait-for-fire cases | ## 🎯 Changes
Where a test advances fake timers solely to wait for a `sleep(N)` timer to fire and deliver data/state, align the `vi.advanceTimersByTimeAsync(...)` value with the corresponding `sleep` duration:
- `sleep(10)` → `advanceTimersByTimeAsync(10)` (was `11`)
- `sleep(20)` → `advanceTimersByTimeAsync(20)` (wa... | 2a4c2c9f1f1c3e139e92db381957bdeb69667884 | 5e2363514e88fbea8e02b36063fca0a890466159 | [
"packages/svelte-query/tests/HydrationBoundary/HydrationBoundary.svelte.test.ts",
"packages/svelte-query/tests/QueryClientProvider/QueryClientProvider.svelte.test.ts",
"packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.svelte.test.ts",
"packages/svelte-query/tests/createQueries/createQueries... | [] | diff --git a/packages/svelte-query/tests/HydrationBoundary/HydrationBoundary.svelte.test.ts b/packages/svelte-query/tests/HydrationBoundary/HydrationBoundary.svelte.test.ts
index 42e3a371c34..3a767232555 100644
--- a/packages/svelte-query/tests/HydrationBoundary/HydrationBoundary.svelte.test.ts
+++ b/packages/svelte-qu... | true | ||
TanStack/query | 10,903 | issue_to_patch | test(svelte-query/createQuery): replace 'Promise.resolve' with 'sleep' in render-based 'queryFn' | ## 🎯 Changes
Replace immediate `Promise.resolve(...)` with `sleep(10).then(() => ...)` in the `queryFn` of render-based tests in `createQuery.svelte.test.ts`, and adjust the corresponding `vi.advanceTimersByTimeAsync(...)` values to advance by the same `10`ms the `queryFn` now sleeps for.
This makes these tests reso... | 3c77cd082652feb48287c007dc1d513e78b4859f | 175977d9fbe5a632ef8a79473d715c480d33278e | [
"packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts"
] | [] | diff --git a/packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts b/packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts
index 07cbbb507c..0e1ce5d9c3 100644
--- a/packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts
+++ b/packages/svelte-query/tests/createQuery/createQuery.svel... | true | ||
TanStack/query | 313 | issue_to_patch | Fix `quiries` typo in docs. | Noticed when reading through the documentation two instances of `queries` spelled incorrectly :+1: | c444286ab5991693d3053bace18fa245bb889c19 | b7459a58b8be0213d428110872e3bba70b211af0 | diff --git a/README.md b/README.md
index 1edc62f4a82..ea10231d914 100644
--- a/README.md
+++ b/README.md
@@ -2496,7 +2496,7 @@ queryCache.clear()
## `useIsFetching`
-`useIsFetching` is an optional hook that returns the `number` of the quiries that your application is loading or fetching in the background (useful f... | [
"README.md"
] | [] | true | ||
TanStack/query | 693 | issue_to_patch | Enable partial makeQueryCache configs | This will allow to call makeQueryCache({ defaultConfig: {enabled: false} }); | 406524d55240d2f122b9aefc08ab70a91e273c78 | 6ef34dcbc985073e6906f43222e1b245cfb08815 | diff --git a/src/core/queryCache.js b/src/core/queryCache.js
index 4f85deec8b0..4b34fc0f215 100644
--- a/src/core/queryCache.js
+++ b/src/core/queryCache.js
@@ -17,7 +17,7 @@ export function makeQueryCache({ frozen = isServer, defaultConfig } = {}) {
const globalListeners = []
const configRef = defaultConfig
- ... | [
"src/core/queryCache.js"
] | [] | true | ||
TanStack/query | 10,902 | issue_to_patch | test(svelte-query/createQuery): migrate suitable tests to render with reusable fixtures | ## 🎯 Changes
Migrates suitable `createQuery` tests from the `withEffectRoot` + `$effect(states.push(...))` pattern to a `render` + reusable `.svelte` fixture pattern (matching the existing `useMutationState`/`createMutation` test style).
Each fixture takes the query options as an accessor prop and exposes query stat... | 4077908fbdb80735715aed349b8a24e9c06a7ded | 6f6806515c71deb4ce283e90de87bd31b3f59d3f | [
"packages/svelte-query/tests/createQuery/Base.svelte",
"packages/svelte-query/tests/createQuery/Counter.svelte",
"packages/svelte-query/tests/createQuery/Select.svelte",
"packages/svelte-query/tests/createQuery/TwoQueries.svelte",
"packages/svelte-query/tests/createQuery/createQuery.svelte.test.ts"
] | [] | diff --git a/packages/svelte-query/tests/createQuery/Base.svelte b/packages/svelte-query/tests/createQuery/Base.svelte
new file mode 100644
index 00000000000..38744d12790
--- /dev/null
+++ b/packages/svelte-query/tests/createQuery/Base.svelte
@@ -0,0 +1,41 @@
+<script lang="ts">
+ import { onDestroy, onMount } from 's... | true | ||
TanStack/query | 547 | issue_to_patch | fix: default TError type | after adding the TError generic throughout the codebase, there are now several places where typescript gets cross. QueryOptions<string> for example used to work fine, but now demands that you provide an error type. In other places it's defaulted to Error.
It seems like a logical solution to just add this default every... | b528564f20c6993483032a4638664ccfce9be8b8 | 838aa3e301d9ecf64c72a938e7249d93673f59a4 | diff --git a/types/index.d.ts b/types/index.d.ts
index 4679deb8a44..02393d8070f 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -407,18 +407,18 @@ export interface BaseQueryOptions<TError = Error> {
isDataEqual?: (oldData: unknown, newData: unknown) => boolean
}
-export interface QueryOptions<TResult, TEr... | [
"types/index.d.ts"
] | [] | true | ||
TanStack/query | 132 | issue_to_patch | revise mutate typo | typed too fast :)
https://github.com/tannerlinsley/react-query/commit/bfca6122ee394a5425b5c0edaacb58ed97959bf2#r37367012 | f11920e3b9db21ab925d21e3e10816d5cf64b6e6 | 800ed36842d3c1598e4a35ee867f2c03c4337c17 | diff --git a/README.md b/README.md
index 58020fdbff2..b424eb36f79 100644
--- a/README.md
+++ b/README.md
@@ -954,7 +954,7 @@ It's sometimes the case that you need to clear the `error` or `data` of a mutati
```js
const CreateTodo = () => {
const [title, setTitle] = useState('')
- const [mutate, { error, mutate }] ... | [
"README.md"
] | [] | true | ||
TanStack/query | 312 | issue_to_patch | bug: prefetchQuery does not respect force option when initialData is used
When using `prefetchQuery` and `initialData`, calling `prefetchQuery` will always return the `initialData`, like so:
```js
const fetchFn = () => Promise.resolve('fresh')
const first = await prefetchQuery('test', fetchFn, { initialData: 'ini... | fix(prefetchQuery): Support force option when calling query.fetch | Fixes #311
## Changes
- prefetchQuery: Passthru `force` option when calling `query.fetch`
- Add test coverage | df536e8f2f3a4597c790979a2b5b83b850cdf695 | 28c660fbdeff30331deebaef037df55689d6071a | diff --git a/src/queryCache.js b/src/queryCache.js
index 69d8a636dd8..20a2399887b 100644
--- a/src/queryCache.js
+++ b/src/queryCache.js
@@ -160,7 +160,7 @@ export function makeQueryCache() {
if (query.state.isStale || force) {
// Trigger a fetch and return the promise
try {
- const res = awai... | [
"src/queryCache.js",
"src/tests/queryCache.test.js"
] | [] | diff --git a/src/tests/queryCache.test.js b/src/tests/queryCache.test.js
index 5acaa918463..ab7b7a21a0d 100644
--- a/src/tests/queryCache.test.js
+++ b/src/tests/queryCache.test.js
@@ -24,6 +24,16 @@ describe('queryCache', () => {
expect(second).toBe(first)
})
+ test('prefetchQuery should force fetch', async... | true |
TanStack/query | 10,900 | issue_to_patch | test(query-core/queryObserver): add tests for 'notifyOnChangeProps' as a function controlling listener notification | ## 🎯 Changes
Adds two tests in `queryObserver.test.tsx` covering the function form of `notifyOnChangeProps`.
`queryObserver.test.tsx` previously had no `notifyOnChangeProps` tests at all. These verify that when `notifyOnChangeProps` is a function, its returned value controls whether listeners are notified:
- listen... | 01616c69b391725b7ac28fe1fe5e4f08117e5527 | fc9e1609402017a61a9be64954bc1a7ffa6cbf40 | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [
{
"comment": "_⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_\n\n**Reset listener call history before `refetch` to avoid false-positive/false-negative assertions.**\n\nBoth tests currently assert against total call history after `subscribe`, so they don’t reliably isolate `refetch`-driven notifications. Clear... | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index a1e6e5f4ba..93946f289a 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -781,6 +781,52 @@ describe... | true | ||
TanStack/query | 10,900 | comment_to_fix | test(query-core/queryObserver): add tests for 'notifyOnChangeProps' as a function controlling listener notification | _⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_
**Reset listener call history before `refetch` to avoid false-positive/false-negative assertions.**
Both tests currently assert against total call history after `subscribe`, so they don’t reliably isolate `refetch`-driven notifications. Clear the mock after subscribin... | 01616c69b391725b7ac28fe1fe5e4f08117e5527 | fc9e1609402017a61a9be64954bc1a7ffa6cbf40 | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index a1e6e5f4ba..93946f289a 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -781,6 +781,52 @@ describe... | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [
{
"comment": "_⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_\n\n**Reset listener call history before `refetch` to avoid false-positive/false-negative assertions.**\n\nBoth tests currently assert against total call history after `subscribe`, so they don’t reliably isolate `refetch`-driven notifications. Clear... | true | ||
TanStack/query | 10,901 | issue_to_patch | test(query-core/queryObserver): add test for 'refetchInterval' as a function called with the query | ## 🎯 Changes
Adds a test in `queryObserver.test.tsx` verifying that when `refetchInterval` is a function, it is called with the query.
This complements the existing test covering the function form of `refetchInterval`, which only asserts the returned interval is applied. This one asserts the query is passed to the f... | 84cbbdb320aa8d3a7a8e77d10c0b558ad468f1db | 9197aa26e0c341ca02edf97b61e4641a442d3048 | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [] | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index f81aeb56f7..a1e6e5f4ba 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -765,6 +765,22 @@ describe... | true | ||
TanStack/query | 10,899 | issue_to_patch | test(query-core/queryObserver): add test for 'refetchInterval' as a function refetching at the returned interval | ## 🎯 Changes
Adds a test in `queryObserver.test.tsx` covering the function form of `refetchInterval`.
Existing `refetchInterval` tests only use the number form (`refetchInterval: 10`). This test verifies that when `refetchInterval` is a function, the returned interval is actually applied, asserting the query refetch... | 413fdc5101bb3daef06fe19e94b8aa2d52b6c594 | 1eaac1d25218bc2ab28a27a0d6d60d777466cfd8 | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [] | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index db456896631..f81aeb56f7a 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -747,6 +747,24 @@ descri... | true | ||
TanStack/query | 10,898 | issue_to_patch | test(query-core/queryObserver): add tests for 'refetchOnWindowFocus' as a function in 'shouldFetchOnWindowFocus' | ## 🎯 Changes
Add tests covering `refetchOnWindowFocus` as a function in `shouldFetchOnWindowFocus`.
The existing tests only cover the value forms (`true`, `false`, `"always"`), which all take the `: field` branch of `typeof field === "function" ? field(query) : field`. These add the function forms so the `field(quer... | 708d9c5b835c037f7324a2d9b44dcfdd72a5d477 | e6644a85aa57b904dbb5f71ac1dfc8b074327c87 | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [] | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index 0349c72c21a..db456896631 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -1337,6 +1337,61 @@ desc... | true | ||
TanStack/query | 10,896 | issue_to_patch | test(query-core/queryObserver): add test for 'refetchOnWindowFocus' as "always" in 'shouldFetchOnWindowFocus' | ## 🎯 Changes
Add a test covering the `refetchOnWindowFocus: 'always'` case in `shouldFetchOnWindowFocus`.
The existing tests only cover `true` and `false`. With a stale query, an `'always'` test would pass even if the `value === 'always'` branch were removed, since the `value !== false && isStale(query, options)` co... | 1d12194a901e0afb8734f3623b73e8ab99a36bfc | 1757cf48c720c7345e57c6bc33c5bd4ca0378757 | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [
{
"comment": "_⚠️ Potential issue_ | _🟠 Major_ | _⚡ Quick win_\n\n**Await prefetch completion to truly isolate the `'always'` branch.**\n\n`prefetchQuery` is not awaited, so the query may still be unresolved when `shouldFetchOnWindowFocus()` is evaluated. That can let the stale-path satisfy the assertion and m... | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index 09738b9960f..0349c72c21a 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -1318,6 +1318,25 @@ desc... | true | ||
TanStack/query | 10,897 | issue_to_patch | test(query-core/queryObserver): unify all test descriptions to start with 'should' | ## 🎯 Changes
Unify all test descriptions in `queryObserver.test.tsx` to start with `should`, so every `it` follows the same convention.
- Method-name prefixes are rewritten as `should ...`, keeping the method name where it identifies the behavior (`from getCurrentQuery`, `when setOptions is called`, `via fetchOptimi... | ba7fbc443ba5a528434b0695ccd70d12b67e2a87 | c132b0fa11012c8ef75720952332ce82dc0f95d2 | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [] | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index 315c37b160b..09738b9960f 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -747,7 +747,7 @@ describ... | true | ||
TanStack/query | 180 | issue_to_patch | Update usePaginatedQuery example | 8c890b708967f97c7f9ecc5b8a4bd0f5af45bb1c | 4a01a9e3493f7093c3c2d40e87b44d2e13515aa7 | diff --git a/README.md b/README.md
index a7dcc530567..757632da291 100644
--- a/README.md
+++ b/README.md
@@ -590,7 +590,7 @@ function Todos() {
latestData,
error,
isFetching,
- } = usePaginatedQuery(['todos', page], fetchProjects)
+ } = usePaginatedQuery(['projects', page], fetchProjects)
return (... | [
"README.md",
"examples/pagination/pages/index.js"
] | [] | true | |||
TanStack/query | 10,889 | issue_to_patch | test(query-core/queryObserver): split 'shouldFetchOnWindowFocus' test by 'refetchOnWindowFocus' value | ## 🎯 Changes
Splits the single `shouldFetchOnWindowFocus should respect refetchOnWindowFocus option` test into two focused tests, one per `refetchOnWindowFocus` value:
- `shouldFetchOnWindowFocus` returns `true` when `refetchOnWindowFocus` is `true`
- `shouldFetchOnWindowFocus` returns `false` when `refetchOnWi... | b63da8a294a3b5580aca2e5cf7e1b5f717970845 | c8b8e4464e39cef7a86fe7ef7e4216bf71aa6597 | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [] | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index 00f37048caf..315c37b160b 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -1294,22 +1294,28 @@ des... | true | ||
TanStack/query | 310 | issue_to_patch | bug: prefetchQuery does not throw error when throwOnError is true
According to the documentation, when `prefetchQuery` is called with the config option `throwOnError` set to `true`, the query should throw when encountering an error. Instead, the error is still swallowed (and since `onSuccess` / `onError` callbacks are... | fix(prefetchQuery): Throw error when throwOnError is set | Fixes #309
The previous test added for #167 still passes, so I would assume this is safe.
## Changes
- prefetchQuery: Add test case for `throwOnError` set to `true`
- Uncomment `throw error` that was commented in #167 | ce64708f0e095edbed16e4ff117a42897ac6dd10 | e6b05d7dbb9aeaf416b506fc8f427cc1fc8890e5 | diff --git a/src/queryCache.js b/src/queryCache.js
index 00dc91a4fc1..69d8a636dd8 100644
--- a/src/queryCache.js
+++ b/src/queryCache.js
@@ -413,7 +413,7 @@ export function makeQueryCache() {
instance.onSettled && instance.onSettled(undefined, error)
)
- // throw error
+... | [
"src/queryCache.js",
"src/tests/queryCache.test.js"
] | [] | diff --git a/src/tests/queryCache.test.js b/src/tests/queryCache.test.js
index 03d1577aabc..5acaa918463 100644
--- a/src/tests/queryCache.test.js
+++ b/src/tests/queryCache.test.js
@@ -24,6 +24,20 @@ describe('queryCache', () => {
expect(second).toBe(first)
})
+ test('prefetchQuery should throw error when th... | true |
TanStack/query | 10,888 | issue_to_patch | test(query-core/queryCache): add test for 'remove' only deleting the instance currently stored under its 'queryHash' | ## 🎯 Changes
Adds a test for `QueryCache.remove` covering the `queryInMap === query` guard.
When a stale `Query` reference is removed after a new instance has taken its place under the same `queryHash`, `remove` must only delete the instance currently stored in the cache — not the newer one. The test builds a qu... | bd0a264e5e4d89badeede873531b908df9248c57 | e244afe857384bc352c3221901fe51e3bff439ac | [
"packages/query-core/src/__tests__/queryCache.test.tsx"
] | [] | diff --git a/packages/query-core/src/__tests__/queryCache.test.tsx b/packages/query-core/src/__tests__/queryCache.test.tsx
index 1238bcf44a9..c404c1f942b 100644
--- a/packages/query-core/src/__tests__/queryCache.test.tsx
+++ b/packages/query-core/src/__tests__/queryCache.test.tsx
@@ -380,6 +380,22 @@ describe('queryCac... | true | ||
TanStack/query | 690 | issue_to_patch | Fix fetch abort example | **Very minor tweak to the README:**
Passing `controller.abort` directly as a callback breaks the "this" function context. | 0b50b7564d061c453a3da490e9df9b5e7d84ca01 | fa443ae71295f1a7e1620b3e31dbcaba08dd8dec | diff --git a/README.md b/README.md
index e43876f9b74..a0cce55a7db 100644
--- a/README.md
+++ b/README.md
@@ -1138,7 +1138,7 @@ const query = useQuery('todos', () => {
})
// Cancel the request if React Query calls the `promise.cancel` method
- promise.cancel = controller.abort
+ promise.cancel = () => controll... | [
"README.md"
] | [] | true | ||
TanStack/query | 10,887 | issue_to_patch | test(query-core/queryObserver): add test for promise not rejecting when 'experimental_prefetchInRender' is enabled | ## 🎯 Changes
Adds a unit test for `QueryObserver.trackResult` covering the case where `experimental_prefetchInRender` is enabled: reading the tracked `promise` resolves with the data instead of rejecting.
This complements the existing test that asserts the promise rejects when the flag is disabled, covering the othe... | 92d9e2c01ac4341d09542e874dc0a363db04369f | 94e021300400d8f3a80ae72ce42fdc802af43696 | [
"packages/query-core/src/__tests__/queryObserver.test.tsx"
] | [] | diff --git a/packages/query-core/src/__tests__/queryObserver.test.tsx b/packages/query-core/src/__tests__/queryObserver.test.tsx
index c814314da13..00f37048caf 100644
--- a/packages/query-core/src/__tests__/queryObserver.test.tsx
+++ b/packages/query-core/src/__tests__/queryObserver.test.tsx
@@ -1462,6 +1462,24 @@ desc... | true | ||
TanStack/query | 10,886 | issue_to_patch | test(query-core/onlineManager): add test for online status updates from window events | ## 🎯 Changes
Adds a unit test for `OnlineManager` covering the default window event listeners: dispatching the browser `offline` and `online` events updates the online status accordingly.
The existing tests only assert that the listeners are registered/removed; this covers the listener callbacks actually reacting to... | 3270e09ac0f11e804c400db01c2afd6393ce3c6f | e2df09b71a95e94111df152e94aa3ddb04b29c1b | [
"packages/query-core/src/__tests__/onlineManager.test.tsx"
] | [
{
"comment": "_⚠️ Potential issue_ | _🟡 Minor_ | _⚡ Quick win_\n\n**Make the offline assertion transition-based, not state-based.**\n\nAt Line 164, `toBe(false)` can pass even if the manager already started offline, so this may not prove the `offline` event changed state. Precondition to online first (or asser... | diff --git a/packages/query-core/src/__tests__/onlineManager.test.tsx b/packages/query-core/src/__tests__/onlineManager.test.tsx
index 9d4ab713b02..d9219e01970 100644
--- a/packages/query-core/src/__tests__/onlineManager.test.tsx
+++ b/packages/query-core/src/__tests__/onlineManager.test.tsx
@@ -157,6 +157,20 @@ descri... | true | ||
TanStack/query | 10,886 | comment_to_fix | test(query-core/onlineManager): add test for online status updates from window events | _⚠️ Potential issue_ | _🟡 Minor_ | _⚡ Quick win_
**Make the offline assertion transition-based, not state-based.**
At Line 164, `toBe(false)` can pass even if the manager already started offline, so this may not prove the `offline` event changed state. Precondition to online first (or assert listener calls) before d... | 3270e09ac0f11e804c400db01c2afd6393ce3c6f | e2df09b71a95e94111df152e94aa3ddb04b29c1b | diff --git a/packages/query-core/src/__tests__/onlineManager.test.tsx b/packages/query-core/src/__tests__/onlineManager.test.tsx
index 9d4ab713b02..d9219e01970 100644
--- a/packages/query-core/src/__tests__/onlineManager.test.tsx
+++ b/packages/query-core/src/__tests__/onlineManager.test.tsx
@@ -157,6 +157,20 @@ descri... | [
"packages/query-core/src/__tests__/onlineManager.test.tsx"
] | [
{
"comment": "_⚠️ Potential issue_ | _🟡 Minor_ | _⚡ Quick win_\n\n**Make the offline assertion transition-based, not state-based.**\n\nAt Line 164, `toBe(false)` can pass even if the manager already started offline, so this may not prove the `offline` event changed state. Precondition to online first (or asser... | true | ||
TanStack/query | 177 | issue_to_patch | chore: add tests.yml build action to run tests on PR / master. | after this I'd like to add a status badge to the reademe. :) | 3724af2686b3c8edcbaef3c692fd718c3e402a94 | 85178744590c456c116b014308aac30f8b1fab9a | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000000..a3b6e0dd070
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,26 @@
+name: react-query tests
+
+on:
+ push:
+ branches:
+ - 'master'
+ pull_request:
+
+jobs:
+ test:
+ name: 'node ${{ matri... | [
".github/workflows/test.yml",
"jest.config.js",
"package.json"
] | [
{
"comment": "note, i moved this into jest.config.js",
"path": "package.json",
"hunk": "@@ -13,9 +13,8 @@\n \"scripts\": {\n \"test\": \"is-ci \\\"test:ci\\\" \\\"test:dev\\\"\",\n \"test:dev\": \"jest --watch\",\n- \"test:ci\": \"yarn test:jest\",\n- \"test:jest\": \"jest --coverage\","... | true | ||
TanStack/query | 130 | issue_to_patch | reset error state when calling useMutation's `reset` | continuing off of https://github.com/tannerlinsley/react-query/pull/122, `reset` should also reset the error state as well.
- Resets `error` when calling `reset`
- Adds a test for the error case
- Updates the CHANGELOG and README for the `reset` API
- Also as promised, made a PR for TS types: https://github.com/D... | 9f3b2e99dfcb1c8e13260fa2e677e3b160d32695 | a0a7c445e84aa0bd3aba9dcf740ee0e1c878645c | diff --git a/.size-snapshot.json b/.size-snapshot.json
index 991a8c0f94a..89ac2495f43 100644
--- a/.size-snapshot.json
+++ b/.size-snapshot.json
@@ -1,13 +1,13 @@
{
"dist/index.js": {
- "bundled": 31764,
- "minified": 16087,
- "gzipped": 4618
+ "bundled": 31777,
+ "minified": 16088,
+ "gzipped": 4... | [
".size-snapshot.json",
"CHANGELOG.md",
"README.md",
"src/__tests__/useMutation-test.js",
"src/index.js"
] | [
{
"comment": "While I believe this got merged as `v0.3.26` in https://github.com/tannerlinsley/react-query/commit/3a8bda84423ef8dd6ea1e37b9cc1b418698a7329, this would be more of a feature in semver terms. Let me know if you want me to move this to the `v0.3.26` section",
"path": "CHANGELOG.md",
"hunk": ... | diff --git a/src/__tests__/useMutation-test.js b/src/__tests__/useMutation-test.js
index 07afa9d42b1..96e50d9907d 100644
--- a/src/__tests__/useMutation-test.js
+++ b/src/__tests__/useMutation-test.js
@@ -5,7 +5,6 @@ import {
waitForElement,
} from '@testing-library/react'
import * as React from 'react'
-import { ... | true | |
TanStack/query | 531 | issue_to_patch | fix: do not suspend on subsequent page loads | As described in #503, `usePaginatedQuery` shouldn't suspend during subsequent page loads, but it currently does.
`handleSuspense` suspend on `status === 'loading'`.
`usePaginatedQuery` changes returned `status` from `'loading'` to `'success'` if `resolvedData` is available, but passes to `handleSuspense` an object ... | 9e0e7913b1c3a32d9612c8929dc4c377503ac598 | 2a585f7a967470464396865e08de0df7e9e84022 | diff --git a/src/usePaginatedQuery.js b/src/usePaginatedQuery.js
index 52960a8a3ff..6dccecb54b8 100644
--- a/src/usePaginatedQuery.js
+++ b/src/usePaginatedQuery.js
@@ -39,12 +39,14 @@ export function usePaginatedQuery(...args) {
status = 'success'
}
- handleSuspense(query)
-
- return {
+ const paginatedQu... | [
"src/tests/usePaginatedQuery.test.js",
"src/usePaginatedQuery.js"
] | [] | diff --git a/src/tests/usePaginatedQuery.test.js b/src/tests/usePaginatedQuery.test.js
index 91afda3f57d..422f9e21945 100644
--- a/src/tests/usePaginatedQuery.test.js
+++ b/src/tests/usePaginatedQuery.test.js
@@ -192,4 +192,39 @@ describe('usePaginatedQuery', () => {
rendered.getByText('Data second-search 1')
... | true | |
TanStack/query | 701 | issue_to_patch | docs: update return for useQuery | Adds documentation for `clear()` on `useQuery` | 76bb1115c950ed6d733fc8d7d98528d378b4b743 | 664d5f6f407a99cb62a8e268acc655bb64ab53f2 | diff --git a/README.md b/README.md
index 6a7e3726f63..cbdeb6dd29f 100644
--- a/README.md
+++ b/README.md
@@ -1729,6 +1729,7 @@ const {
isFetching,
failureCount,
refetch,
+ clear,
} = useQuery(queryKey, queryFn?, {
suspense,
queryKeySerializerFn,
@@ -1860,6 +1861,8 @@ const queryInfo = useQuery({
- A... | [
"README.md"
] | [] | true | ||
TanStack/query | 10,884 | issue_to_patch | docs(reference/QueryCache): correct the 'find' and 'findAll' options to match their filter types | ## 🎯 Changes
Corrects the options listed for `find` and `findAll` in the QueryCache reference to match their actual filter types:
- `find(filters: WithRequired<QueryFilters, 'queryKey'>)` — both `filters` and its `queryKey` are required, so `filters` is no longer marked optional and `queryKey` is documented as a req... | 525e3168b5cac62a44107059650fa2f61e4116e8 | d4e651df9ad5d79fb6443a92789129451e19ff6c | diff --git a/docs/reference/QueryCache.md b/docs/reference/QueryCache.md
index 2c34da50881..5c7251540eb 100644
--- a/docs/reference/QueryCache.md
+++ b/docs/reference/QueryCache.md
@@ -57,7 +57,8 @@ const query = queryCache.find({ queryKey })
**Options**
-- `filters?: QueryFilters`: [Query Filters](../framework/re... | [
"docs/reference/QueryCache.md"
] | [] | true | ||
TanStack/query | 10,873 | issue_to_patch | docs(reference/QueryCache): use the v5 filters-object form in 'find' and 'findAll' examples | ## Description
The `QueryCache` reference examples call `find` / `findAll` with a **positional** query key — the v4 signature. In v5, both take a single **filters object**, which is what this page's own Options already document (`filters?: QueryFilters`). The examples are therefore out of date and won't type-check / b... | 8f6f9235d7738f0985d26045540e8bb018c7f25a | 98b4c28f898769145f3831b50ebebadef6bffe9b | diff --git a/docs/reference/QueryCache.md b/docs/reference/QueryCache.md
index 09a9c8e5357..2c34da50881 100644
--- a/docs/reference/QueryCache.md
+++ b/docs/reference/QueryCache.md
@@ -22,7 +22,7 @@ const queryCache = new QueryCache({
},
})
-const query = queryCache.find(['posts'])
+const query = queryCache.find(... | [
"docs/reference/QueryCache.md"
] | [] | true | ||
Tarmil/FSharp.SystemTextJson | 213 | issue_to_patch | chore: Update build and tests to net10.0 | 4ef5999ecc9c0caab002a71201abe20fe7d93a99 | db5063c7535b71a9232324c2edc5e414b26cfd01 | diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index b1d8726..8caadee 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"paket": {
- "version": "9.0.2",
+ "version": "10.3.1",
"commands": [
"paket"
... | [
".config/dotnet-tools.json",
".github/workflows/build.yml",
".paket/Paket.Restore.targets",
"benchmarks/FSharp.SystemTextJson.Benchmarks/FSharp.SystemTextJson.Benchmarks.fsproj",
"build/build.fsproj",
"global.json",
"paket.dependencies",
"paket.lock",
"src/FSharp.SystemTextJson/FSharp.SystemTextJson... | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj b/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj
index fa99936..4c6f66b 100644
--- a/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj
+++ b/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.... | true | ||
Tarmil/FSharp.SystemTextJson | 202 | issue_to_patch | Allow overriding property and union case attributes in options
Allow specifying which attributes should apply to a given property or union case in the options. This is useful to override the format of a type that is not under the developer's control, or simply to keep DTOs lean.
Example:
```fsharp
type MyRecord... | Allow overriding property and union case attributes in options | Fixes #181.
Add member WithOverrideMembers taking `IDictionary<string, seq<Attribute>>` to `JsonFSharpOptions`.
Example uses:
* Override attributes on record fields:
```fsharp
type MyRecord = { x: int }
let options =
JsonFSharpOptions.Default()
.WithOverrides(fun o -> d... | 01b26f846c930b7a9ddbbcdf277e63cf21d73a30 | ac780bcc057d7083d443cc545a68cdfe4b3785b3 | diff --git a/src/FSharp.SystemTextJson/Options.fs b/src/FSharp.SystemTextJson/Options.fs
index 59ac890..50a837f 100644
--- a/src/FSharp.SystemTextJson/Options.fs
+++ b/src/FSharp.SystemTextJson/Options.fs
@@ -185,6 +185,7 @@ type internal JsonFSharpOptionsRecord =
MapFormat: MapFormat
Types: JsonFSharpTyp... | [
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 8d737f0..ba11e69 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -497,6 +497,26 @@ module NonStruct =
JsonSerializer... | true |
Tarmil/FSharp.SystemTextJson | 201 | issue_to_patch | Specialize tuple converter up to size 4 | Implement specialized converters for struct and ref pairs, triplets and quadruplets. This avoids reflection, saving all extraneous allocations and some time too.
For example when deserializing an `(int * bool)` pair:
| Method | Mean | Error | StdDev | Gen0 | Allocated |
|------------------ |-... | b0483ad7cf49bbfe62e262c06e4e8c0443a79467 | 1631bc259dab8981b68e6c158acd98e5841be393 | diff --git a/benchmarks/FSharp.SystemTextJson.Benchmarks/Program.fs b/benchmarks/FSharp.SystemTextJson.Benchmarks/Program.fs
index 141ca6f..b4159f1 100644
--- a/benchmarks/FSharp.SystemTextJson.Benchmarks/Program.fs
+++ b/benchmarks/FSharp.SystemTextJson.Benchmarks/Program.fs
@@ -94,6 +94,30 @@ type ReflectionCompariso... | [
"benchmarks/FSharp.SystemTextJson.Benchmarks/Program.fs",
"src/FSharp.SystemTextJson/Tuple.fs"
] | [] | true | ||
Tarmil/FSharp.SystemTextJson | 196 | issue_to_patch | NotSupported exception when dictionary key is union (DU)
Hi!
I would like to achieve the following serialization result for maps, when key is DU (case sensitivity for keys does not matter).
```
{
"key-values": {
"Key1": {
"string-value": "A",
"int-value": 1
},
"Key2": {
"s... | Enum-like unions can be used as dictionary keys | Fixes #177. | 4f93c6c9134c0f9a48a59bdd2d4b2e87e55d169e | fc9484cba575e9c0cded9fd3662fbe760ab7f87e | diff --git a/src/FSharp.SystemTextJson/Helpers.fs b/src/FSharp.SystemTextJson/Helpers.fs
index d42db5c..dfb13a8 100644
--- a/src/FSharp.SystemTextJson/Helpers.fs
+++ b/src/FSharp.SystemTextJson/Helpers.fs
@@ -56,6 +56,11 @@ let isSkippableType (fsOptions: JsonFSharpOptionsRecord) (ty: Type) =
let isValueOptionType (ty... | [
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
index 25d00ac..a337fd0 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
@@ -1,5 +1,6 @@
module Tests.Union
+open System.Collections.Generic
... | true |
Tarmil/FSharp.SystemTextJson | 198 | issue_to_patch | Faster type comparisons | Faster type comparisons. More work on compile time than runtime.
See:
https://sharplab.io/#v2:DYLgZgzgNALiCGEC2AfA9gBwKYDsAEAygJ4QxZICwAUNdcFjHjEdgMJpIbwBOAlhGhwFgaAO4AKAJR4AvHnHNsaMAB4wI+DAB8spiyzK1G7ZNo1z9RoqztOPfoIBiiGFN0AVfQDpxMyQv1DdTRNLSg9JVVg0NNzMzMgA
| 4348d6aa391dc2bb1b3e23c2bd2b8d6a8ea24b64 | b88bca3c949df5dc9775e036427aa70396ab16f2 | diff --git a/src/FSharp.SystemTextJson/Collection.fs b/src/FSharp.SystemTextJson/Collection.fs
index 3770b01..4ccd7a3 100644
--- a/src/FSharp.SystemTextJson/Collection.fs
+++ b/src/FSharp.SystemTextJson/Collection.fs
@@ -197,7 +197,7 @@ type JsonMapConverter(fsOptions: JsonFSharpOptions) =
| MapFormat.Object -... | [
"src/FSharp.SystemTextJson/Collection.fs",
"src/FSharp.SystemTextJson/Helpers.fs"
] | [] | true | ||
Tarmil/FSharp.SystemTextJson | 194 | issue_to_patch | Bump dawidd6/action-download-artifact from 2 to 6 in /.github/workflows | Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 2 to 6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dawidd6/action-download-artifact/releases">dawidd6/action-download-artifact's releases</a>.</em></p>
<blockquote>
<h2>v6</... | 593c269ed97cab81ba7f1959d4ad564312ce217a | fae478b86243a3acb37def331494c9462adaaecc | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index bf8d490..e856b9f 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download nupkg
- uses: dawidd6/action-download-artifact@v2
... | [
".github/workflows/publish.yml"
] | [] | true | ||
Tarmil/FSharp.SystemTextJson | 193 | issue_to_patch | Allow overriding generic types
Allow using `typedefof` to override options for all instances of a generic type. Example:
```fsharp
let options =
FSharpJsonOptions()
.WithOverrides(fun o -> dict [ typedefof<Result<_, _>>, o.WithUnionTagName("Result") ])
.ToJsonSerializerOptions()
JsonSeria... | Allow overriding generic types | Fixes #180. | c96f4142c21336f4345005ce61bb143d87006882 | 48499ca5886d40969de31ece4d81fa0f13cde326 | diff --git a/src/FSharp.SystemTextJson/Helpers.fs b/src/FSharp.SystemTextJson/Helpers.fs
index 97d00a6..baf76fc 100644
--- a/src/FSharp.SystemTextJson/Helpers.fs
+++ b/src/FSharp.SystemTextJson/Helpers.fs
@@ -3,6 +3,7 @@
#nowarn "44" // JsonSerializerOptions.IgnoreNullValues is obsolete for users but still relevant fo... | [
"src/FSharp.SystemTextJson/Helpers.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
index 3fd8573..25d00ac 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
@@ -1248,6 +1248,39 @@ module NonStruct =
.ToJsonSeria... | true |
Tarmil/FSharp.SystemTextJson | 191 | issue_to_patch | Bump actions/download-artifact from 1 to 4.1.7 in /.github/workflows | Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 1 to 4.1.7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/download-artifact/releases">actions/download-artifact's releases</a>.</em></p>
<blockquote>
<h2>v4.1.7</h2>
<h2>What's Chang... | f068310c770c1ca3a70d9a99dac321ec9c8088a3 | fb05d146d71968bf1d674cbd85904aaafe04ff3a | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 65fb896..33c08f0 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -41,7 +41,7 @@ jobs:
DOTNET_RUNTIME_IDENTIFIER=linux-x64 ./build.ps1
- name: Upload nupkg
- uses: actions/upload-artifact... | [
".github/workflows/build.yml"
] | [] | true | ||
Tarmil/FSharp.SystemTextJson | 184 | issue_to_patch | Inconsistent behavior of nulls?
Now that `WithSkippableOptionFields` is implemented (thank you!) I can generate what looks like confusing results:
```
The structure I'm deserializing:
{ "stringOption": null,
"seqOfStringOption1": [null],
"seqOfStringOption2": []
}
Deserializing ... | [#151] Add option to deserialize both null and missing as None | Add optional argument `deserializeNullAsNone: bool` to option `.WithSkippableOptionFields(SkippableOptionFields)`.
```fsharp
let options =
JsonFSharpOptions.Default()
.WithSkippableOptionFields(SkippableOptionFields.Always, deserializeNullAsNone = true)
.ToJsonSerializerOptions()
JsonSeria... | 1b6dbd9f6fd5cfe46d8ec9c52bf1a99f8ef0395a | f47c39dbd7e335c082be4a2b07b9e8c24f5ef977 | diff --git a/src/FSharp.SystemTextJson/Helpers.fs b/src/FSharp.SystemTextJson/Helpers.fs
index f2d7bae..97d00a6 100644
--- a/src/FSharp.SystemTextJson/Helpers.fs
+++ b/src/FSharp.SystemTextJson/Helpers.fs
@@ -155,6 +155,8 @@ type FieldHelper
let nullValue = tryGetNullValue fsOptions ty
let isSkippableWrappe... | [
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Options.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
index 0795941..3fd8573 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
@@ -1363,6 +1363,25 @@ module NonStruct =
)
)
+... | true |
Tarmil/FSharp.SystemTextJson | 159 | issue_to_patch | Disallow null if not option-wrapped everywhere, not just for record fields
The document [Customizing the serialization format](https://github.com/Tarmil/FSharp.SystemTextJson/blob/master/docs/Customizing.md) says:
> By default, FSharp.SystemTextJson throws an exception when the following conditions are met:
>
> ... | Explicitly handle null values to throw an exception | Fixes #158.
Throw a `JsonException` when trying to deserialize `null` into the following types:
* [x] Unions (unless explicitly allowed, eg. with `CompilationRepresentationFlags.UseNullAsTrueValue`)
* [x] Records
* [x] Tuples
* [x] Lists
* [x] Sets
* [x] Maps | 740cd062d71097fd501c523b156cec316b8ad0aa | 759191b400d68aec199339d60ca685b28b988f2a | diff --git a/src/FSharp.SystemTextJson/Collection.fs b/src/FSharp.SystemTextJson/Collection.fs
index 6c4d542..4c7f97f 100644
--- a/src/FSharp.SystemTextJson/Collection.fs
+++ b/src/FSharp.SystemTextJson/Collection.fs
@@ -11,7 +11,8 @@ type JsonListConverter<'T> internal (fsOptions) =
let tIsNullable = isNullableFi... | [
"src/FSharp.SystemTextJson/Collection.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Tuple.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Collection.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs",
"tests/FSharp.SystemTextJson.Tests/Tes... | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
index c376dbb..77dd6b4 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
@@ -227,3 +227,52 @@ let ``serialize struct 8-tuple... | true |
Tarmil/FSharp.SystemTextJson | 174 | issue_to_patch | Fix NullReferenceException when serializing null record-typed record field | Fixes #172 and supersedes #173. | cfa75d31949a802fddc68f6254836be16d0adae6 | 29f4847285b45f3ca075f33e88af18c3edc79101 | diff --git a/src/FSharp.SystemTextJson/Record.fs b/src/FSharp.SystemTextJson/Record.fs
index d5ca23d..e159768 100644
--- a/src/FSharp.SystemTextJson/Record.fs
+++ b/src/FSharp.SystemTextJson/Record.fs
@@ -205,8 +205,11 @@ type JsonRecordConverter<'T> internal (options: JsonSerializerOptions, fsOptions
ctor fie... | [
"src/FSharp.SystemTextJson/Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Regression.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Regression.fs b/tests/FSharp.SystemTextJson.Tests/Test.Regression.fs
index 7016d09..c8b6198 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Regression.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Regression.fs
@@ -111,3 +111,12 @@ let ``regression #154`` () =
... | true | |
Tarmil/FSharp.SystemTextJson | 179 | issue_to_patch | Run build and tests in net8.0 | 76ed9aeceb54e6a42f3552d9eea3ad03a7e078b0 | 42274d7faa3936f90c5f2e849753c61f7a2cba57 | diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 03dadcf..4f308f7 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"paket": {
- "version": "7.2.1",
+ "version": "8.0.3",
"commands": [
"paket"
... | [
".config/dotnet-tools.json",
".github/workflows/build.yml",
".gitignore",
".paket/Paket.Restore.targets",
"Directory.Build.props",
"Directory.Build.targets",
"benchmarks/FSharp.SystemTextJson.Benchmarks/FSharp.SystemTextJson.Benchmarks.fsproj",
"build.ps1",
"build/build.fs",
"build/build.fsproj",
... | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj b/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj
index 38f4f0d..edb5581 100644
--- a/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj
+++ b/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.... | true | ||
Tarmil/FSharp.SystemTextJson | 169 | issue_to_patch | Allow handling arbitrary Map keys as JSON object properties
Since .NET 6, the handling of dictionary keys can be customized using [`JsonConverter.Write/ReadAsPropertyName`](https://github.com/dotnet/runtime/pull/57302). Our Map converter should try use these methods in the same way, and only fall back to array-of-pair... | [#162] Allow choosing the map format as object or array-of-pairs | This fixes #162 by introducing the following format option:
```fsharp
type MapFormat =
/// Always serialize Maps as JSON objects.
/// Only supports the same key types as the built-in serializer for Dictionary.
/// Requires System.Text.Json 8.0 or newer.
| Object = 0
/// Always serialize Map... | 48cfa5bd0505665fefc7c990bbf9c3a1427f5315 | e2314e3384d32fb16a2bcaaa459160a34c866dd7 | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index 9dc1e66..e1c8929 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -43,7 +43,7 @@ type JsonFSharpConverter(fsOptions: JsonFSharpOptions, [<Optional>] overrides: I
match TypeCache.getKind... | [
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Collection.fs",
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Collection.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
index 77eac13..6c9114f 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
@@ -1,5 +1,6 @@
module Tests.Collection
+open Sy... | true |
Tarmil/FSharp.SystemTextJson | 168 | issue_to_patch | #161 Allow using single-case unions as dictionary keys | For example:
```fsharp
open System.Text.Json
open System.Text.Json.Serialization
type CountryCode = CountryCode of string
let d = dict [
CountryCode "fr", 1
CountryCode "us", 2
]
JsonSerializer.Serialize(d, JsonFSharpOptions().ToJsonSerializerOptions())
// Returns: {"fr":1,"us":2}
```
Note... | 9feeda699538c9cef10b27430fe8b3bf6b98fa0d | 1596b2fa174551c47af75b52eed49fe0d1d83ebf | diff --git a/paket.dependencies b/paket.dependencies
index ed92a91..08a3319 100644
--- a/paket.dependencies
+++ b/paket.dependencies
@@ -15,7 +15,7 @@ source https://api.nuget.org/v3/index.json
nuget FSharp.Core >= 5.0
nuget FsCheck.XUnit
nuget Microsoft.NET.Test.Sdk ~> 16.3.0
-nuget System.Text.Json >= 6.0
+nuget S... | [
"paket.dependencies",
"paket.lock",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Collection.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
index 77dd6b4..77eac13 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
@@ -98,6 +98,24 @@ let ``serialize newtype-string-k... | true | |
Tarmil/FSharp.SystemTextJson | 160 | issue_to_patch | using DefaultIgnoreCondition = WhenWritingNull deserializes missing fields as null
This issue was in fact not fixed.
Effectively what we want is the following (optionally while also having WhenWritingNull enabled for our C# code):
- When a record property has type `Skippable<DateTime option>` this means the prop... | Allow non-skippable option fields regardless of DefaultIgnoreCondition | Fixes #154.
* [x] Fix SkippableOptionFields = false not working for voption
* [x] Add overload on WithSkippableOptionFields that ignores DefaultIgnoreCondition | e1361347864466a3bacc8ba51a054e51013f750b | 6cebf2eb636061b35cc4d3a4cb1da075bc7026d4 | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index 66b9d4e..9dc1e66 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -130,7 +130,7 @@ type JsonFSharpConverterAttribute(fsOptions: JsonFSharpOptions) =
member _.UnionFieldNamesFromTypes
... | [
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Regression.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 7429051..ecb3438 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -223,6 +223,39 @@ module NonStruct =
)
Ass... | true |
Tarmil/FSharp.SystemTextJson | 167 | issue_to_patch | feat: Add structural comparison to Skippable<_> | cc @xperiandri | c63b2072ff4d95027df8e6df55dd0927c7d64a38 | d37ec05a49edf35bbb41b0b6601b293ce3488cb0 | diff --git a/src/FSharp.SystemTextJson/Skippable.fs b/src/FSharp.SystemTextJson/Skippable.fs
index 28682f4..5c62769 100644
--- a/src/FSharp.SystemTextJson/Skippable.fs
+++ b/src/FSharp.SystemTextJson/Skippable.fs
@@ -2,7 +2,7 @@ namespace System.Text.Json.Serialization
/// Represents a value that can be represented ... | [
"src/FSharp.SystemTextJson/Skippable.fs"
] | [] | true | ||
Tarmil/FSharp.SystemTextJson | 166 | issue_to_patch | Record deserialization throws NRE if ignore null values is on
Hello!
It seems there is some issue with the `JsonRecordConverter`: when `ignoreNullValues` is on (e.g. set with option `DefaultIgnoreCondition = Serialization.JsonIgnoreCondition.WhenWritingNull`), attempting to deserialize an empty json object throws a... | fix #164: NRE on deserializing missing field with JsonIgnoreCondition.WhenWritingNull | Fixes #164.
This MR includes the regression test from #165.
It also fixes a few tests that should have been failing, but passed thanks to this bug.
cc @mlaily | 00cf5fb0980d4f6f015e56334a29f8f5f6e604d0 | 7070c4bb6372098280f2cfe7b0507555ff99f320 | diff --git a/src/FSharp.SystemTextJson/Record.fs b/src/FSharp.SystemTextJson/Record.fs
index 9585a43..6927bee 100644
--- a/src/FSharp.SystemTextJson/Record.fs
+++ b/src/FSharp.SystemTextJson/Record.fs
@@ -27,7 +27,8 @@ type private RecordField
let isSkippableType = isSkippableType fsOptions p.PropertyType
- ... | [
"src/FSharp.SystemTextJson/Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs"
] | [
{
"comment": "```\r\n<@ JsonSerializer.Deserialize<A>(\"{}\", options) |> ignore @> |> \r\nraisesWith<Exception>(fun e -> <@ e.Message.Contains(\"Missing field for record type\" @>) ()\r\n```\r\nor something similar.\r\nedit: Pardon my assuming the world is using unquote...\r\n```\r\nlet ex = Record.Exception(... | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 0b760b0..f5370c8 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -14,6 +14,16 @@ module NonStruct =
let actual = JsonSer... | true |
Tarmil/FSharp.SystemTextJson | 165 | issue_to_patch | Add failing unit test demonstrating an issue | The record converter throws a NRE when trying to deserialize an empty json object, if the ignore nulls option is enabled. | 00cf5fb0980d4f6f015e56334a29f8f5f6e604d0 | c08a9e31845c0cadb79f610a8b33932ed56644b9 | [
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 0b760b0..25a4ee9 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -14,6 +14,15 @@ module NonStruct =
let actual = JsonSer... | true | ||
Tarmil/FSharp.SystemTextJson | 84 | issue_to_patch | docs: errors in Giraffe 5.x example | c0614a98d26a6008dd8417a45a557c509aef4f07 | b76eb48e0e71274690993f279c9ec3a865cf43c2 | diff --git a/docs/Using.md b/docs/Using.md
index d86cf76..0b690c9 100644
--- a/docs/Using.md
+++ b/docs/Using.md
@@ -116,11 +116,12 @@ To use FSharp.SystemTextJson in Giraffe (for example with the `json` function):
open Giraffe
let configureServices (services: IServiceCollection) =
+ services.AddGira... | [
"docs/Using.md"
] | [] | true | |||
Tarmil/FSharp.SystemTextJson | 143 | issue_to_patch | remove invalid argument | netcoreapp was [replaced](https://learn.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-frameworks) with net since v5, but it looks like we don't need it here for fake dontet. | 09b380dfcf809ed6248e1fbd3ff1a53eedc7b4a1 | 9d197c4f51ef10ac12e0c6cf50296f9e0402ddfd | diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 387a667..748a67f 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -8,12 +8,6 @@
"paket"
]
},
- "fake-cli": {
- "version": "5.22.0",
- "commands": [
- "fake"
- ]
- },
"n... | [
".config/dotnet-tools.json",
".fantomasignore",
".github/workflows/build.yml",
".gitignore",
"CHANGELOG.md",
"FSharp.SystemTextJson.sln",
"FSharp.SystemTextJson.sln.DotSettings",
"benchmarks/FSharp.SystemTextJson.Benchmarks/FSharp.SystemTextJson.Benchmarks.fsproj",
"benchmarks/FSharp.SystemTextJson.... | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj b/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj
index 1d64c9a..38f4f0d 100644
--- a/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj
+++ b/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.... | true | |
Tarmil/FSharp.SystemTextJson | 145 | issue_to_patch | Use fluent options in all documentation | 9334acd93c1b00ead75ad380e928162fcd4bc9de | 3cb7107c79f58094350a98df497a1e2c72132582 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index c267119..ce91e07 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,20 @@
# Changelog
+## 1.1
+
+* [#141](https://github.com/Tarmil/FSharp.SystemTextJson/issues/141): Add fluent options builder. `JsonFSharpOptions` has the following new methods:
+ * static metho... | [
"CHANGELOG.md",
"docs/Customizing.md",
"docs/Using.md"
] | [] | true | |||
Tarmil/FSharp.SystemTextJson | 149 | issue_to_patch | Test on .NET 7 and use a build project instead of fake-cli | 5e63e95d50947b036b004ab39591629b5d03c8ad | 895d6458ff2717e6ac45f39177f3edffe5039723 | diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 387a667..748a67f 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -8,12 +8,6 @@
"paket"
]
},
- "fake-cli": {
- "version": "5.22.0",
- "commands": [
- "fake"
- ]
- },
"n... | [
".config/dotnet-tools.json",
".fantomasignore",
".github/workflows/build.yml",
".gitignore",
"FSharp.SystemTextJson.sln",
"FSharp.SystemTextJson.sln.DotSettings",
"benchmarks/FSharp.SystemTextJson.Benchmarks/FSharp.SystemTextJson.Benchmarks.fsproj",
"build.cmd",
"build.fsx.lock",
"build.ps1",
"b... | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj b/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj
index 1d64c9a..38f4f0d 100644
--- a/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.Tests.fsproj
+++ b/tests/FSharp.SystemTextJson.Tests/FSharp.SystemTextJson.... | true | ||
Tarmil/FSharp.SystemTextJson | 146 | issue_to_patch | Add SkippableOptionFields that allows skipping option and voption fields | This adds a new option `.WithSkippableOptionFields()` that essentially restores the pre-1.0 behavior of fields of type `option` and `voption`: during deserialization, a missing field is deserialized as `None` / `ValueNone`.
See #138 and #140. | 681d3c14eec4b5e5764251c78edcf59b622015fc | 5ddfb1d2f0b46e4737fb3f8a947b9798ae7f974e | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index fbaf224..66b9d4e 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -129,6 +129,8 @@ type JsonFSharpConverterAttribute(fsOptions: JsonFSharpOptions) =
with set v = fsOptions <- fsOptions.... | [
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index bb18a6a..02c5a1d 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -74,15 +74,19 @@ module NonStruct =
Assert.Equal("M... | true | |
Tarmil/FSharp.SystemTextJson | 142 | issue_to_patch | Fix #137: empty anonymous records | 1bda46b6ca6ec99eff5c758a4214b5cc37e65053 | 5641d8b406e64292d921b75d6451296567eb0bcd | diff --git a/src/FSharp.SystemTextJson/Record.fs b/src/FSharp.SystemTextJson/Record.fs
index 247236d..dda3584 100644
--- a/src/FSharp.SystemTextJson/Record.fs
+++ b/src/FSharp.SystemTextJson/Record.fs
@@ -33,7 +33,7 @@ type JsonRecordConverter<'T>(options: JsonSerializerOptions, fsOptions: JsonFSha
let allPubl... | [
"src/FSharp.SystemTextJson/Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 96b05aa..dbe0f23 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -162,6 +162,16 @@ module NonStruct =
let actual = JsonS... | true | ||
Tarmil/FSharp.SystemTextJson | 124 | issue_to_patch | Use JsonIgnoreCondition.WhenWritingNull as synonym for IgnoreNullValues | 33f95060aad18370c509695b895eabefcba43db7 | a4893db12c4052d7042a0df61c8a00493e32ec59 | diff --git a/src/FSharp.SystemTextJson/Helpers.fs b/src/FSharp.SystemTextJson/Helpers.fs
index 58d9192..406f5b1 100644
--- a/src/FSharp.SystemTextJson/Helpers.fs
+++ b/src/FSharp.SystemTextJson/Helpers.fs
@@ -1,5 +1,7 @@
module internal System.Text.Json.Serialization.Helpers
+#nowarn "44" // JsonSerializerOptions.I... | [
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Regression.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index b2bb8ff..a374b09 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -176,6 +176,11 @@ module NonStruct =
let ignoreNullOptions ... | true | ||
Tarmil/FSharp.SystemTextJson | 128 | issue_to_patch | Allow disabling the handling of types already handled by System.Text.Json
As of .NET 6, a number of F# types [are now handled as built-in by System.Text.Json](https://github.com/dotnet/runtime/tree/main/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp):
* Records: serialization ha... | Add JsonFSharpTypes to restrict the types used by JsonFSharpConverter | Fixes #126 | 0bd7de5b55dfb5ebdbf3021f61ca63308159ae13 | e60b6e5bc1e13793b7c150f5a9cb7877abd75458 | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index bc6b1d0..e044728 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -13,7 +13,24 @@ type JsonFSharpConverter(fsOptions: JsonFSharpOptions, [<Optional>] overrides: I
member _.Overrides = overr... | [
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Options.fs"
] | [] | true | |
Tarmil/FSharp.SystemTextJson | 127 | issue_to_patch | [#89] Add JsonName attribute for union cases with int or bool tags | * [x] Create `JsonNameAttribute` which can be constructed with a string, an int or a bool.
* [x] Support `JsonNameAttribute` on union cases to enable int or bool tags.
```fsharp
type MyUnion =
| [<JsonName 1>] One of name: string
| [<JsonName 2>] Two of string
// eg: One "test" --> {"C... | edddea4b885962f2164137058a734b85ce18fc8a | a1cce1722a7edf14eba2773d78c488c90524d1b0 | diff --git a/FSharp.SystemTextJson.sln b/FSharp.SystemTextJson.sln
index 4ae75d6..dc48cd9 100644
--- a/FSharp.SystemTextJson.sln
+++ b/FSharp.SystemTextJson.sln
@@ -6,7 +6,6 @@ MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{CB1D506A-0E4B-4D73-9B71-A7... | [
"FSharp.SystemTextJson.sln",
"src/FSharp.SystemTextJson/Collection.fs",
"src/FSharp.SystemTextJson/FSharp.SystemTextJson.fsproj",
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/JsonName.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.... | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index a374b09..cd12a96 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -6,10 +6,6 @@ open System.Text.Json
module NonStruct =
- ... | true | |
Tarmil/FSharp.SystemTextJson | 125 | issue_to_patch | [#106] Deserialize null field representing wrapped nullable value | 23c4d950ffeb09a43d0d7c38351cb8ecb3fd668e | 7fb0e07b619168996a37ec98b970c6058b7132b1 | diff --git a/src/FSharp.SystemTextJson/Helpers.fs b/src/FSharp.SystemTextJson/Helpers.fs
index 36c89d8..169011e 100644
--- a/src/FSharp.SystemTextJson/Helpers.fs
+++ b/src/FSharp.SystemTextJson/Helpers.fs
@@ -2,7 +2,9 @@
open System
open System.Collections.Generic
+open System.Reflection
open System.Text.Json
+ope... | [
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Regression.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Regression.fs b/tests/FSharp.SystemTextJson.Tests/Test.Regression.fs
index 8c86a31..53aabd8 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Regression.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Regression.fs
@@ -53,3 +53,13 @@ let ``regression #100`` () =
... | true | ||
Tarmil/FSharp.SystemTextJson | 122 | issue_to_patch | Add options to serialize record properties | Add ways to include record properties (rather than just fields) in serialized JSON.
* Add option `includeRecordProperties: bool` to serialize properties of record types (unless ignored with `JsonIgnoreAttribute`).
* Serialize properties of record types that have `JsonIncludeAttribute` (even with `includeRecordPrope... | a26161da3e7ec8d03b2265bb7076a277d5421c4d | c86e0df0057e5baf08b9c63cb8ffa12493bd0542 | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index a9000fd..bc6b1d0 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -37,6 +37,7 @@ type JsonFSharpConverter(fsOptions: JsonFSharpOptions, [<Optional>] overrides: I
[<Optional; DefaultPara... | [
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 9dd7b03..b2bb8ff 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -287,6 +287,56 @@ module NonStruct =
FirstName = ... | true | |
Tarmil/FSharp.SystemTextJson | 59 | issue_to_patch | Support records with read only members | Currently record members are ignored during serialization. I'm not sure if that's something you want to support, but if so, I thought I could at least provide the failing test. I've already tried to implement it myself but couldn't find a way without rewriting quite a bit of code, so maybe you've a better idea how to f... | 0f7ca4b25707e66d904721b831892a7d655fc7fc | 159abd635dd723102ef2e2fe9249ef6f05c956ce | [
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 95b4142..0712603 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -442,3 +442,15 @@ module Struct =
let ``serialize with prop... | true | ||
Tarmil/FSharp.SystemTextJson | 121 | issue_to_patch | Format code with Fantomas | * [x] Format all F# with Fantomas
* [x] Check formatting in CI build
* [x] Check formatting in git pre-commit hook | b58187089268f4a269fd0b4eb3c2b56445599c53 | b49b93b32d1285818d089b6863ee462f2f2aaa86 | diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 2eaa086..387a667 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -19,6 +19,12 @@
"commands": [
"nbgv"
]
+ },
+ "fantomas": {
+ "version": "5.0.0-alpha-009",
+ "commands": [
+ ... | [
".config/dotnet-tools.json",
".editorconfig",
".fantomasignore",
".git-blame-ignore-revs",
".githooks/hooks/pre-commit",
".githooks/install.ps1",
".githooks/pre-commit-script.ps1",
".github/workflows/build.yml",
"FSharp.SystemTextJson.sln",
"benchmarks/FSharp.SystemTextJson.Benchmarks/Program.fs",... | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Program.fs b/tests/FSharp.SystemTextJson.Tests/Program.fs
index c36cf8f..6b1ddf3 100644
--- a/tests/FSharp.SystemTextJson.Tests/Program.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Program.fs
@@ -1,2 +1,6 @@
namespace FSharp.SystemTextJson.Tests
-module Program = let [<Entr... | true | |
Tarmil/FSharp.SystemTextJson | 120 | issue_to_patch | [#111] Support JsonKnownNamingPolicy in attributes | 1139ee43a59c4821f36f9bc5c2e2be848bed4acb | 01fdab7a0b0f0c3ba24df82d339d1c5ab475b0d9 | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index 50949d0..5bd85e4 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -73,6 +73,10 @@ type JsonFSharpConverterAttribute
unionTagName: JsonUnionTagName,
[<Optional; DefaultParameter... | [
"src/FSharp.SystemTextJson/All.fs"
] | [] | true | |||
Tarmil/FSharp.SystemTextJson | 119 | issue_to_patch | [#112] Add Options and Overrides Properties to JsonFSharpConverter | 08e7149beba8a04f235dc4d5265530b924ed53b7 | 051cc7bb512418d127b6cd3efbb1dee1aebcc32c | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index 4582145..50949d0 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -13,6 +13,10 @@ type JsonFSharpConverter
) =
inherit JsonConverterFactory()
+ member _.Options = fsOptions
+
+ ... | [
"src/FSharp.SystemTextJson/All.fs"
] | [] | true | |||
Tarmil/FSharp.SystemTextJson | 114 | issue_to_patch | Fix typos | a03eadff85d57fb826d603a6ef933fc965fd0c8b | 972635c6b96a86666b3046ddde6bdb44c74f2a27 | diff --git a/docs/Customizing.md b/docs/Customizing.md
index a0d34ac..300486a 100644
--- a/docs/Customizing.md
+++ b/docs/Customizing.md
@@ -423,7 +423,7 @@ JsonFSharpConverter(
JsonUnionEncoding.InternalTag |||
JsonUnionEncoding.NamedFields |||
JsonUnionEncoding.UnionFieldNamesFromTypes)
-|> options.Con... | [
"docs/Customizing.md"
] | [] | true | |||
Tarmil/FSharp.SystemTextJson | 110 | issue_to_patch | [#108] Add UnionFieldNamesFromTypes | * [x] Add `JsonUnionEncoding.UnionFieldNamesFromTypes` so that union fields that don't have an explicit name are named after their type instead. If a union case has several fields with the same type, a suffix `1`, `2`, etc is added.
* [x] Add `unionFieldNamingPolicy` option to specify the policy used to name JSON fiel... | 2fc5b39545e2916fa6f0e82befaa61534c394d73 | ab70a9ab7970c9b685808322d01ea06d8a6e9986 | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index 11052f7..8a3980e 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -45,6 +45,8 @@ type JsonFSharpConverter
unionFieldsName: JsonUnionFieldsName,
[<Optional; DefaultParam... | [
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
index afedbab..602b85a 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
@@ -637,6 +637,52 @@ module NonStruct =
o.Converters.Add(JsonF... | true | |
Tarmil/FSharp.SystemTextJson | 109 | issue_to_patch | Add .xml with documentation comments to nupkg | Adds `GenerateDocumentationFile` Property to fsproj file. F# compiler
does not generate the .xml file by default, so
FSharp.SystemTextJson nuget packages didn't show any documentation in autocompletion.
Before:
>]
type Foo = Foo of x: int * y: string
// Default behavior:
let options = JsonSerializerOptions()
options.Converters.Add(JsonFSharpConverter(JsonUnionEncoding.InternalTag))
JsonSerializer.Serialize(Foo(1, "a")) // = {"Case":"Foo","x":1,"y":"a"]}
... | 35c7b524325901d8b649a6d3f3600504fd01b48c | 7d632339e55d3a53a868363bd95ddef3e6171fef | diff --git a/CHANGELOG.md b/CHANGELOG.md
index bd700e5..8eace7f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+## 0.13
+
+* [#69](https://github.com/Tarmil/FSharp.SystemTextJson/issues/69): Allow overriding `JsonFSharpConverter` options with `JsonFSharpConverterAttribute` by passing `allow... | [
"CHANGELOG.md",
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.U... | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 95b4142..f34641f 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -229,6 +229,25 @@ module NonStruct =
with
| :?... | true | |
Tarmil/FSharp.SystemTextJson | 73 | issue_to_patch | Fix #71: add explicit overrides to JsonFSharpConverter | 5283b7998bff4706df919e348e84e941c29c3526 | 32eeaecd12ee9c2b79c9651ef0aa28996ed9478b | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 1641ec7..e79f438 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -28,7 +28,9 @@ jobs:
- name: Build
run: |
- git checkout "$(echo ${{github.ref}} | sed -E 's|^refs/heads/||')"
+ ... | [
".github/workflows/build.yml",
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
index 2c6411a..6ea2ed0 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
@@ -618,6 +618,24 @@ module NonStruct =
o.Converters.Add(JsonF... | true | ||
Tarmil/FSharp.SystemTextJson | 99 | issue_to_patch | Fix for Giraffe 5.0.0 API change | https://github.com/giraffe-fsharp/Giraffe/blob/master/RELEASE_NOTES.md#500-rc-3 | 0f7ca4b25707e66d904721b831892a7d655fc7fc | 55040c0461e63e78b13dcda55959cf14042f9d8e | diff --git a/docs/Using.md b/docs/Using.md
index cf42b20..4458011 100644
--- a/docs/Using.md
+++ b/docs/Using.md
@@ -102,13 +102,13 @@ To use FSharp.SystemTextJson in Giraffe (for example with the `json` function):
```fsharp
open System.Text.Json
open System.Text.Json.Serialization
- open Giraffe.Seri... | [
"docs/Using.md"
] | [] | true | ||
Tarmil/FSharp.SystemTextJson | 76 | issue_to_patch | Update documentation and move it to the docs folder | 02ac1e37c588b918eac50902fd3ce3d59647240e | 9dc039d65e09eb7f82041eb08d93ec8edc0813ec | diff --git a/README.md b/README.md
index b41df6f..a7b9f32 100644
--- a/README.md
+++ b/README.md
@@ -3,363 +3,31 @@
[](https://github.com/Tarmil/FSharp.SystemTextJson/actions?query=workflow%3ABuild)
[>] DU =
| [<JsonPropertyName "3">] T3 of {| CommonProp:in... | Implemented ability to deserialize discriminated unions regardless of union tag position | I create a snapshot of a reader (a copy of structure) and parse it into a `JsonDocument` (which is a lazy operation) and do a union case lookup.
I have not added new tests but played with modification of existing (not committed) so add tests as appropriate.
Fixes #93 | bebdc81394b4aef3b56a0d293994d7980f809e1a | bf04dce1447a005bb4b3fbdde5d3e8e3275c9ee1 | diff --git a/build.fsx b/build.fsx
index 07ad4ae..b540905 100644
--- a/build.fsx
+++ b/build.fsx
@@ -93,7 +93,7 @@ Target.create "TestTrim" <| fun _ ->
/// project(s) as part of the run.
Target.create "Benchmark" (fun _ ->
DotNet.exec (fun o -> { o with
- WorkingDirectory = Paths.... | [
"build.fsx",
"docs/Customizing.md",
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
index 6ea2ed0..3bb3ede 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
@@ -17,6 +17,7 @@ module NonStruct =
Assert.Equal(Aa, JsonSeri... | true |
Tarmil/FSharp.SystemTextJson | 90 | issue_to_patch | Point to updated docs page | 9367191e2210b78f12aec92f77bc2301ea2baf0c | c1e1be4ec3643f418c844dea111fbf4581659062 | diff --git a/docs/Customizing.md b/docs/Customizing.md
index b111360..678b534 100644
--- a/docs/Customizing.md
+++ b/docs/Customizing.md
@@ -481,7 +481,7 @@ JsonSerializer.Serialize(WithArgs (123, "Hello, world!"), options)
## `unionTagNamingPolicy`
This option sets the naming policy for union case names.
-See [the... | [
"docs/Customizing.md"
] | [] | true | |||
Tarmil/FSharp.SystemTextJson | 91 | issue_to_patch | Unknow -> Unknown | 9367191e2210b78f12aec92f77bc2301ea2baf0c | 5631c77d553a41d34b5b92e3ab21667a0b2b8fb4 | diff --git a/src/FSharp.SystemTextJson/Union.fs b/src/FSharp.SystemTextJson/Union.fs
index abba7a9..f721ac5 100644
--- a/src/FSharp.SystemTextJson/Union.fs
+++ b/src/FSharp.SystemTextJson/Union.fs
@@ -172,7 +172,7 @@ type JsonUnionConverter<'T>
| false, _ -> ValueNone
match found with
... | [
"src/FSharp.SystemTextJson/Union.fs"
] | [] | true | |||
Tarmil/FSharp.SystemTextJson | 78 | issue_to_patch | trim workaround (issue #77) | This is a workaround for issue #77 as describe in https://github.com/dotnet/runtime/issues/43222#issuecomment-706438221
Publish with trimming now works as expected.
This PR convert Serializer.Serialize<> and Serializer.Deserialize<> to non-generic counterparts.
NOTE: no performance impact has been done. This pro... | 999fbbc53241f2a38a691965c3e2d92b1a0c655c | 708c4e8e1db93e66b75ec0acf07adcb0a4b75f57 | diff --git a/src/FSharp.SystemTextJson/Collection.fs b/src/FSharp.SystemTextJson/Collection.fs
index 7df9778..b87aeee 100644
--- a/src/FSharp.SystemTextJson/Collection.fs
+++ b/src/FSharp.SystemTextJson/Collection.fs
@@ -12,7 +12,7 @@ type JsonListConverter<'T>(fsOptions) =
let needsNullChecking = not tIsNullable ... | [
"src/FSharp.SystemTextJson/Collection.fs",
"tests/FSharp.SystemTextJson.TrimTest/Program.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.TrimTest/Program.fs b/tests/FSharp.SystemTextJson.TrimTest/Program.fs
index 64d9b99..23cad4a 100644
--- a/tests/FSharp.SystemTextJson.TrimTest/Program.fs
+++ b/tests/FSharp.SystemTextJson.TrimTest/Program.fs
@@ -6,7 +6,8 @@ open Xunit
let ``Regression #77`` () =
let option... | true | |
Tarmil/FSharp.SystemTextJson | 39 | issue_to_patch | More consistent naming of options
Right now we have union encoding options called `BareFieldlessTags`, `SuccintOption`, `EraseSingleCaseUnions`. Even ignoring the spelling mistake in `Succinct` (#34), these are 3 different verbs/adjectives for options that do something similar: make the JSON less verbose by removing a... | [#38] Rename options to consistently use Unwrap | Fixes #38.
I'm open to suggestions if someone has a better name than `Unwrap` though! | c183c673f8b051317a5a5c971bbc9bbcc6a6b935 | 789bf81fd8a3191b0f7ec76f6a1e570da09c932b | diff --git a/CHANGELOG.md b/CHANGELOG.md
index acde866..54e844e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,12 @@
## 0.8
* [#32](https://github.com/Tarmil/FSharp.SystemTextJson/issues/32): Add `JsonUnionEncoding.UnwrapSingleFieldCases`, which encodes the field of single-field cases as `x` instead of `[x... | [
"CHANGELOG.md",
"README.md",
"src/FSharp.SystemTextJson/Helpers.fs",
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
index da1af26..8039dfd 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
@@ -317,46 +317,46 @@ module NonStruct =
type O = { o: option<int>... | true |
Tarmil/FSharp.SystemTextJson | 64 | issue_to_patch | Fixes unit field deserialization | I was getting the error: `Unexpected null inside tuple-array. Expected type Unit, but got null.` when deserializing a type like `int * unit`. This PR removes null-checking for `unit` types inside a tuple and adds a test.
## Use case
It's an odd thing to serialize, but I use `TenantId * RequestParameters` across all... | c4f7c08f37cc82ef013636bd86e7ae500266e1d8 | 6cb3116695079ea4d243638b9bd22d27d307d406 | diff --git a/src/FSharp.SystemTextJson/Helpers.fs b/src/FSharp.SystemTextJson/Helpers.fs
index b5ee06c..9a77171 100644
--- a/src/FSharp.SystemTextJson/Helpers.fs
+++ b/src/FSharp.SystemTextJson/Helpers.fs
@@ -46,6 +46,7 @@ let rec isNullableFieldType (fsOptions: JsonFSharpOptions) (ty: Type) =
&& ty.IsGenericT... | [
"src/FSharp.SystemTextJson/Helpers.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Collection.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
index 46f6ac1..f675dc6 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
@@ -160,6 +160,14 @@ let ``deserialize 2-tuple`` ((... | true | |
Tarmil/FSharp.SystemTextJson | 60 | issue_to_patch | [#56] Unwrap single-field record cases | c8ff4ae9b6643d94a29163ac80e1f658bc095cd3 | 3debc0cb061563c5a4ee928eba4d38301aadb093 | diff --git a/src/FSharp.SystemTextJson/Options.fs b/src/FSharp.SystemTextJson/Options.fs
index 790d941..6cf1655 100644
--- a/src/FSharp.SystemTextJson/Options.fs
+++ b/src/FSharp.SystemTextJson/Options.fs
@@ -60,6 +60,10 @@ type JsonUnionEncoding =
/// rather than a single-value array or object.
| UnwrapSingl... | [
"src/FSharp.SystemTextJson/Options.fs",
"src/FSharp.SystemTextJson/Record.fs",
"src/FSharp.SystemTextJson/Union.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Union.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
index c43bb18..562a052 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Union.fs
@@ -510,6 +510,82 @@ module NonStruct =
let actual = JsonSeria... | true | ||
Tarmil/FSharp.SystemTextJson | 54 | issue_to_patch | Fix bug: no exception for missing required field | If an optional field is provided while a required field is missing for a record, it won't raise an exception and leave the required field null. I created a PR to fix it, and with a test case. | 96234c7a96427b4400acb09eacd039f52668c267 | babb183fc5258aaeb95bf33a1e8ade50348f3c8e | diff --git a/src/FSharp.SystemTextJson/Record.fs b/src/FSharp.SystemTextJson/Record.fs
index 457db46..f28035a 100644
--- a/src/FSharp.SystemTextJson/Record.fs
+++ b/src/FSharp.SystemTextJson/Record.fs
@@ -95,7 +95,7 @@ type JsonRecordConverter<'T>(options: JsonSerializerOptions, fsOptions: JsonFSha
let field... | [
"src/FSharp.SystemTextJson/Record.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs"
] | [] | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
index 890e84b..946adee 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Record.fs
@@ -215,6 +215,20 @@ module NonStruct =
let actual = JsonS... | true | |
Tarmil/FSharp.SystemTextJson | 58 | issue_to_patch | Forbid nulls inside arrays, sets and tuples unless 'T isNullableFieldType | ~Work in progress.~
~Need to implement the same behaviour for Sets, and perhaps `JsonStringMapConverter` and `JsonMapConverter`?~
~I need some feedback before implementing the same behaviour there though.~ (Done!)
------
Ready for merge if everything checks out and looks ok 😁
| 96234c7a96427b4400acb09eacd039f52668c267 | 35d470765141f0a9c69ef5901d0d162d093cc775 | diff --git a/src/FSharp.SystemTextJson/All.fs b/src/FSharp.SystemTextJson/All.fs
index 69d4127..03b94d4 100644
--- a/src/FSharp.SystemTextJson/All.fs
+++ b/src/FSharp.SystemTextJson/All.fs
@@ -13,13 +13,13 @@ type JsonFSharpConverter(fsOptions: JsonFSharpOptions) =
static member internal CreateConverter(typeToConv... | [
"src/FSharp.SystemTextJson/All.fs",
"src/FSharp.SystemTextJson/Collection.fs",
"src/FSharp.SystemTextJson/Tuple.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Collection.fs",
"tests/FSharp.SystemTextJson.Tests/Test.Record.fs"
] | [
{
"comment": "I think we should also check `tType.IsValueType`: if it is a value type, then there is no need to check, `box elem` will never be `null`.",
"path": "src/FSharp.SystemTextJson/Collection.fs",
"hunk": "@@ -5,34 +5,41 @@ open System.Text.Json\n open System.Text.Json.Serialization.Helpers\n op... | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
index 9d3cd29..46f6ac1 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
@@ -28,6 +28,33 @@ let ``deserialize set of ints`` ... | true | |
Tarmil/FSharp.SystemTextJson | 58 | comment_to_fix | Forbid nulls inside arrays, sets and tuples unless 'T isNullableFieldType | I think we should also check `tType.IsValueType`: if it is a value type, then there is no need to check, `box elem` will never be `null`. | 96234c7a96427b4400acb09eacd039f52668c267 | 35d470765141f0a9c69ef5901d0d162d093cc775 | diff --git a/src/FSharp.SystemTextJson/Collection.fs b/src/FSharp.SystemTextJson/Collection.fs
index 5d508dc..7df9778 100644
--- a/src/FSharp.SystemTextJson/Collection.fs
+++ b/src/FSharp.SystemTextJson/Collection.fs
@@ -5,37 +5,48 @@ open System.Text.Json
open System.Text.Json.Serialization.Helpers
open FSharp.Refle... | [
"src/FSharp.SystemTextJson/Collection.fs"
] | [
{
"comment": "I think we should also check `tType.IsValueType`: if it is a value type, then there is no need to check, `box elem` will never be `null`.",
"path": "src/FSharp.SystemTextJson/Collection.fs",
"hunk": "@@ -5,34 +5,41 @@ open System.Text.Json\n open System.Text.Json.Serialization.Helpers\n op... | true | ||
Tarmil/FSharp.SystemTextJson | 58 | comment_to_fix | Forbid nulls inside arrays, sets and tuples unless 'T isNullableFieldType | We should also add a similar test with a nullable type and `allowNullFields = true`, which shouldn't throw either. | 96234c7a96427b4400acb09eacd039f52668c267 | 35d470765141f0a9c69ef5901d0d162d093cc775 | diff --git a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
index 9d3cd29..46f6ac1 100644
--- a/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
+++ b/tests/FSharp.SystemTextJson.Tests/Test.Collection.fs
@@ -28,6 +28,33 @@ let ``deserialize set of ints`` ... | [
"tests/FSharp.SystemTextJson.Tests/Test.Collection.fs"
] | [
{
"comment": "We should also add a similar test with a nullable type and `allowNullFields = true`, which shouldn't throw either.",
"path": "tests/FSharp.SystemTextJson.Tests/Test.Collection.fs",
"hunk": "@@ -28,6 +28,25 @@ let ``deserialize set of ints`` (s: Set<int>) =\n let actual = JsonSerializer... | true | ||
TauricResearch/TradingAgents | 487 | issue_to_patch | refactor(graph): add analyst execution planning and timing hooks | ## Summary
This PR implements a small Phase 1 step toward #433 by extracting analyst execution planning into a dedicated module and adding per-analyst wall-time tracking.
It does **not** parallelize analyst execution yet. Instead, it prepares the graph and CLI for a later concurrency change while keeping the curr... | 879e2bb5da53b0a3f78de014bb165ba7de55e83b | 249caba06fde88a2fade075ad584845a555e9884 | diff --git a/cli/main.py b/cli/main.py
index 043c2311fb..d6683e88b3 100644
--- a/cli/main.py
+++ b/cli/main.py
@@ -21,6 +21,12 @@
from rich.rule import Rule
from tradingagents.graph.trading_graph import TradingAgentsGraph
+from tradingagents.graph.analyst_execution import (
+ AnalystWallTimeTracker,
+ build_a... | [
"cli/main.py",
"tests/test_analyst_execution.py",
"tradingagents/default_config.py",
"tradingagents/graph/analyst_execution.py",
"tradingagents/graph/setup.py",
"tradingagents/graph/trading_graph.py"
] | [] | diff --git a/tests/test_analyst_execution.py b/tests/test_analyst_execution.py
new file mode 100644
index 0000000000..7d4e851a9c
--- /dev/null
+++ b/tests/test_analyst_execution.py
@@ -0,0 +1,84 @@
+import unittest
+
+from tradingagents.graph.analyst_execution import (
+ AnalystWallTimeTracker,
+ build_analyst_ex... | true | |
TauricResearch/TradingAgents | 567 | issue_to_patch | feat: add analysis-only crypto asset mode | ## Summary
This PR adds a small analysis-only crypto MVP so TradingAgents can handle symbols like `BTC-USD` and `ETH-USD` more cleanly without pretending that stock-only fundamentals are available.
The scope is intentionally limited:
- detect crypto-style symbols in the CLI
- carry `asset_type` through the grap... | 879e2bb5da53b0a3f78de014bb165ba7de55e83b | a2f343bb546fde4d2fc9f0a276ff44aa53f88442 | diff --git a/cli/main.py b/cli/main.py
index 043c2311fb..2edd98087f 100644
--- a/cli/main.py
+++ b/cli/main.py
@@ -504,6 +504,10 @@ def create_question_box(title, prompt, default=None):
)
)
selected_ticker = get_ticker()
+ asset_type = detect_asset_type(selected_ticker)
+ console.print(
+ ... | [
"cli/main.py",
"cli/models.py",
"cli/utils.py",
"tests/__init__.py",
"tests/test_crypto_asset_mode.py",
"tradingagents/agents/analysts/market_analyst.py",
"tradingagents/agents/analysts/news_analyst.py",
"tradingagents/agents/researchers/bear_researcher.py",
"tradingagents/agents/researchers/bull_re... | [
{
"comment": "\n\nThe `system_message` variable is being defined as a tuple due to the trailing comma at the end of line 21. This will cause issues when it is passed to `prompt.partial(system_message=system_message)` later in the function, as the... | diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000000..8b13789179
--- /dev/null
+++ b/tests/__init__.py
@@ -0,0 +1,1 @@
+
diff --git a/tests/test_crypto_asset_mode.py b/tests/test_crypto_asset_mode.py
new file mode 100644
index 0000000000..d9b5497253
--- /dev/null
+++ b/tests/test_cry... | true | |
Textualize/rich | 4,070 | issue_to_patch | perf: reduce Console and RichHandler import time by deferring unused imports | ## E2E Results
| Import | master | This PR | Speedup |
|---|---|---|---|
| `from rich.console import Console` | 78.1ms | 52.2ms | **1.50x faster** |
| `from rich.logging import RichHandler` | 99.4ms | 56.9ms | **1.75x faster** |
| `import rich` | 18.2ms | 18.3ms | (already lean) |
## Summary
Defer module-level impor... | fc41075a3206d2a5fd846c6f41c4d2becab814fa | 6729c6f6c4ee24a13a94d825cb7ce66b52206db2 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index bdd4f15974..68e439e28c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semanti... | [
"CHANGELOG.md",
"CONTRIBUTORS.md",
"rich/_emoji_replace.py",
"rich/console.py",
"rich/emoji.py",
"rich/logging.py",
"rich/protocol.py",
"rich/repr.py",
"rich/segment.py",
"rich/syntax.py",
"rich/theme.py",
"tests/test_console.py",
"tests/test_syntax.py"
] | [
{
"comment": "`zlib` is now imported inside `Console.export_svg()`, but the module-level helper `_svg_hash()` (defined later in this file) still references `zlib` and will raise `NameError` (and should also fail static checks). Either keep a module-level `import zlib`, or add a local `import zlib` inside `_svg_... | diff --git a/tests/test_console.py b/tests/test_console.py
index 499043b312..ef82987394 100644
--- a/tests/test_console.py
+++ b/tests/test_console.py
@@ -400,9 +400,9 @@ def fake_input(prompt, stream=None):
console.file.write(prompt)
return "bar"
- import rich.console
+ import getpass
- ... | true | |
Textualize/rich | 3,180 | issue_to_patch | Incorrect word wrapping for Static widget with Chinese / Japanese characters
## Description
Word wrapping for Static widget seems not working properly with Chinese and Japanese characters.
Please continue reading for more details.
## Reproducible Example
```Python
from textual.app import App, ComposeResult
f... | Fix double-width characters disappearing when wrapping | ## Type of changes
- [x] Bug fix
- [ ] New feature
- [ ] Documentation / docstrings
- [ ] Tests
- [ ] Other
## Checklist
- [x] I've run the latest [black](https://github.com/psf/black) with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [x] I've added t... | e76f3c3ea78481342e21a7b3328075462ab69c2b | 05c5dfc8fcbb1c967490540cc080c3d534a91a12 | diff --git a/.gitignore b/.gitignore
index b291d4c2a5..4d0a1d3a87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -117,3 +117,5 @@ venv.bak/
# airspeed velocity
benchmarks/env/
benchmarks/html/
+
+sandbox/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3562f6df62..64bcc56065 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
... | [
".gitignore",
"CHANGELOG.md",
"rich/_wrap.py",
"rich/cells.py",
"tests/test_cells.py",
"tests/test_text.py"
] | [
{
"comment": "Is this a micro optimisation to bring `cell_len` into the current scope?",
"path": "rich/_wrap.py",
"hunk": "@@ -17,40 +20,71 @@ def words(text: str) -> Iterable[Tuple[int, int, str]]:\n word_match = re_word.match(text, end)\n \n \n-def divide_line(text: str, width: int, fold: bool... | diff --git a/tests/test_cells.py b/tests/test_cells.py
index 50fa52192e..fe451fa577 100644
--- a/tests/test_cells.py
+++ b/tests/test_cells.py
@@ -1,4 +1,5 @@
from rich import cells
+from rich.cells import chop_cells
def test_cell_len_long_string():
@@ -40,3 +41,21 @@ def test_set_cell_size_infinite():
... | true |
Textualize/rich | 3,180 | comment_to_fix | Fix double-width characters disappearing when wrapping | Is this a micro optimisation to bring `cell_len` into the current scope? | e76f3c3ea78481342e21a7b3328075462ab69c2b | 05c5dfc8fcbb1c967490540cc080c3d534a91a12 | diff --git a/rich/_wrap.py b/rich/_wrap.py
index c45f193f74..2e94ff6f43 100644
--- a/rich/_wrap.py
+++ b/rich/_wrap.py
@@ -1,5 +1,7 @@
+from __future__ import annotations
+
import re
-from typing import Iterable, List, Tuple
+from typing import Iterable
from ._loop import loop_last
from .cells import cell_len, cho... | [
"rich/_wrap.py"
] | [
{
"comment": "Is this a micro optimisation to bring `cell_len` into the current scope?",
"path": "rich/_wrap.py",
"hunk": "@@ -17,40 +20,71 @@ def words(text: str) -> Iterable[Tuple[int, int, str]]:\n word_match = re_word.match(text, end)\n \n \n-def divide_line(text: str, width: int, fold: bool... | true | ||
Textualize/rich | 3,180 | comment_to_fix | Fix double-width characters disappearing when wrapping | Why didn't you make the comparison directly?
```suggestion
word_fits_remaining_space = remaining_space >= word_length
```
(Which could also go directly in the `if` statement, as `if remaining_space >= word_length`...) | e76f3c3ea78481342e21a7b3328075462ab69c2b | 05c5dfc8fcbb1c967490540cc080c3d534a91a12 | diff --git a/rich/_wrap.py b/rich/_wrap.py
index c45f193f74..2e94ff6f43 100644
--- a/rich/_wrap.py
+++ b/rich/_wrap.py
@@ -1,5 +1,7 @@
+from __future__ import annotations
+
import re
-from typing import Iterable, List, Tuple
+from typing import Iterable
from ._loop import loop_last
from .cells import cell_len, cho... | [
"rich/_wrap.py"
] | [
{
"comment": "Why didn't you make the comparison directly?\r\n\r\n```suggestion\r\n word_fits_remaining_space = remaining_space >= word_length\r\n```\r\n\r\n(Which could also go directly in the `if` statement, as `if remaining_space >= word_length`...)",
"path": "rich/_wrap.py",
"hunk": "@@ -17,4... | true | ||
Textualize/rich | 3,180 | comment_to_fix | Fix double-width characters disappearing when wrapping | The first time I read the function name & docstring, I immediately expected the function to take a string like
```py
"Hey how are you"
#0123456789012345678901234
```
And produce something like `(0, 2, "Hey"), (7, 9, "how"), ...` so I didn't even bother checking the regex pattern.
This, in turn, made ... | e76f3c3ea78481342e21a7b3328075462ab69c2b | 05c5dfc8fcbb1c967490540cc080c3d534a91a12 | diff --git a/rich/_wrap.py b/rich/_wrap.py
index c45f193f74..2e94ff6f43 100644
--- a/rich/_wrap.py
+++ b/rich/_wrap.py
@@ -1,5 +1,7 @@
+from __future__ import annotations
+
import re
-from typing import Iterable, List, Tuple
+from typing import Iterable
from ._loop import loop_last
from .cells import cell_len, cho... | [
"rich/_wrap.py"
] | [
{
"comment": "The first time I read the function name & docstring, I immediately expected the function to take a string like\r\n\r\n```py\r\n\"Hey how are you\"\r\n#0123456789012345678901234\r\n```\r\n\r\nAnd produce something like `(0, 2, \"Hey\"), (7, 9, \"how\"), ...` so I didn't even bother checkin... | true | ||
Textualize/rich | 3,180 | comment_to_fix | Fix double-width characters disappearing when wrapping | I mixed it up a bit more to be less regular.
(I did this by hand and didn't run the test after! I also just copied and pasted some characters, maybe there was some meaning in here that I butchered... 😬)
```suggestion
text = "あ1り2がり34とりう56"
assert chop_cells(text, 3) == ["あ1", "り2", "が", "り3", "4と", "り", ... | e76f3c3ea78481342e21a7b3328075462ab69c2b | 05c5dfc8fcbb1c967490540cc080c3d534a91a12 | diff --git a/tests/test_cells.py b/tests/test_cells.py
index 50fa52192e..fe451fa577 100644
--- a/tests/test_cells.py
+++ b/tests/test_cells.py
@@ -1,4 +1,5 @@
from rich import cells
+from rich.cells import chop_cells
def test_cell_len_long_string():
@@ -40,3 +41,21 @@ def test_set_cell_size_infinite():
... | [
"tests/test_cells.py"
] | [
{
"comment": "I mixed it up a bit more to be less regular.\r\n(I did this by hand and didn't run the test after! I also just copied and pasted some characters, maybe there was some meaning in here that I butchered... 😬)\r\n\r\n```suggestion\r\n text = \"あ1り2がり34とりう56\"\r\n assert chop_cells(text, 3) == [... | true | ||
Textualize/rich | 1,643 | issue_to_patch | [BUG] Need better detection of terminal color capabilities
**Describe the bug**
The terminal 'rxvt-unicode-256color' is not correctly identified as having 256 color support, because the code doesn't expect the base terminal name (rxvt-unicode) to have a hyphen (https://github.com/willmcgugan/rich/blob/master/rich/con... | fix detect color | Closes https://github.com/willmcgugan/rich/issues/1640 | eb673d1204340738d3084ebc2e4c789a35a4e49b | e1c105b8f0ab182dae6814b632bc80acc5c6090f | diff --git a/rich/console.py b/rich/console.py
index 7c4be7fcf8..b188dc98e0 100644
--- a/rich/console.py
+++ b/rich/console.py
@@ -770,7 +770,7 @@ def _detect_color_system(self) -> Optional[ColorSystem]:
if color_term in ("truecolor", "24bit"):
return ColorSystem.TRUECOLOR
ter... | [
"rich/console.py",
"tests/test_console.py"
] | [] | diff --git a/tests/test_console.py b/tests/test_console.py
index 0f88436ca8..fe3ce5b0db 100644
--- a/tests/test_console.py
+++ b/tests/test_console.py
@@ -709,3 +709,9 @@ def _mock_isatty():
console.file.isatty = _mock_isatty
assert console.is_terminal == False
+
+
+@pytest.mark.skipif(sys.platform == "win3... | true |
Textualize/rich | 3,845 | issue_to_patch | Use faster generator for link IDs | ## Type of changes
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation / docstrings
- [ ] Tests
- [x] Other
## Checklist
- [x] I've run the latest [black](https://github.com/psf/black) with default args on new code.
- [ ] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [ ] I've added t... | fc41075a3206d2a5fd846c6f41c4d2becab814fa | 9ac7e797cc731429603cdebd21c1746e5984c7b6 | diff --git a/rich/style.py b/rich/style.py
index 5294241892..3806a8c4b9 100644
--- a/rich/style.py
+++ b/rich/style.py
@@ -1,8 +1,9 @@
import sys
from functools import lru_cache
+from itertools import count
from operator import attrgetter
from pickle import dumps, loads
-from random import randint
+from random impo... | [
"rich/style.py"
] | [
{
"comment": "Why round down, then shift right by 4? What does that achieve?\n\nIf two instances are started within a second of each other, then they will produce the same IDs, won't they?\n\nHow about we get more granularity out of the time, and add a random element? Something like this:\n\n```python\nint(time... | true | ||
Textualize/rich | 3,845 | comment_to_fix | Use faster generator for link IDs | Why round down, then shift right by 4? What does that achieve?
If two instances are started within a second of each other, then they will produce the same IDs, won't they?
How about we get more granularity out of the time, and add a random element? Something like this:
```python
int(time() * 65536 + randint(0, 99999... | fc41075a3206d2a5fd846c6f41c4d2becab814fa | 9ac7e797cc731429603cdebd21c1746e5984c7b6 | diff --git a/rich/style.py b/rich/style.py
index 5294241892..3806a8c4b9 100644
--- a/rich/style.py
+++ b/rich/style.py
@@ -1,8 +1,9 @@
import sys
from functools import lru_cache
+from itertools import count
from operator import attrgetter
from pickle import dumps, loads
-from random import randint
+from random impo... | [
"rich/style.py"
] | [
{
"comment": "Why round down, then shift right by 4? What does that achieve?\n\nIf two instances are started within a second of each other, then they will produce the same IDs, won't they?\n\nHow about we get more granularity out of the time, and add a random element? Something like this:\n\n```python\nint(time... | true | ||
Textualize/rich | 4,077 | issue_to_patch | `FileProxy.isatty()` always returns `False` instead of delegating to the proxied file
- [x] I've checked [docs](https://rich.readthedocs.io/en/latest/introduction.html) and [closed issues](https://github.com/Textualize/rich/issues?q=is%3Aissue+is%3Aclosed) for possible solutions.
- [x] I can't find my issue in the [FA... | proxy isatty | Fixes https://github.com/Textualize/rich/issues/4041 | 58ac15120fe254886c10d6253667733c83604cb4 | 494b795031782c694297d2db78bd04fb8c82f590 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index f4c27de5f6..d2e7906004 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed empty print ignoring the `end` parameter
- Fixed `Text.from_ansi` removing newlines https://gi... | [
"CHANGELOG.md",
"rich/file_proxy.py",
"tests/test_file_proxy.py"
] | [] | diff --git a/tests/test_file_proxy.py b/tests/test_file_proxy.py
index 2ec4d789e3..c73b23fe17 100644
--- a/tests/test_file_proxy.py
+++ b/tests/test_file_proxy.py
@@ -35,3 +35,20 @@ def test_new_lines():
assert file.getvalue() == "-\n"
file_proxy.flush()
assert file.getvalue() == "-\n-\n"
+
+
+def test_i... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.