@tanstack/solid-query 5.27.1 → 5.27.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-query",
3
- "version": "5.27.1",
3
+ "version": "5.27.3",
4
4
  "description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  ],
49
49
  "dependencies": {
50
50
  "solid-js": "^1.8.14",
51
- "@tanstack/query-core": "5.27.1"
51
+ "@tanstack/query-core": "5.27.3"
52
52
  },
53
53
  "devDependencies": {
54
54
  "tsup-preset-solid": "^2.2.0",
@@ -1259,7 +1259,7 @@ describe('createQuery', () => {
1259
1259
  data: undefined,
1260
1260
  isFetching: false,
1261
1261
  isSuccess: false,
1262
- isStale: true,
1262
+ isStale: false,
1263
1263
  })
1264
1264
  })
1265
1265
 
@@ -1305,7 +1305,7 @@ describe('createQuery', () => {
1305
1305
  data: undefined,
1306
1306
  isFetching: false,
1307
1307
  isSuccess: false,
1308
- isStale: true,
1308
+ isStale: false,
1309
1309
  })
1310
1310
  })
1311
1311
 
@@ -1890,22 +1890,17 @@ describe('createQuery', () => {
1890
1890
  rendered.getByText('Second Status: success')
1891
1891
  })
1892
1892
 
1893
- it('should not override query configuration on render', async () => {
1893
+ it('should update query options', async () => {
1894
1894
  const key = queryKey()
1895
1895
 
1896
- const queryFn1 = async () => {
1896
+ const queryFn = async () => {
1897
1897
  await sleep(10)
1898
1898
  return 'data1'
1899
1899
  }
1900
1900
 
1901
- const queryFn2 = async () => {
1902
- await sleep(10)
1903
- return 'data2'
1904
- }
1905
-
1906
1901
  function Page() {
1907
- createQuery(() => ({ queryKey: key, queryFn: queryFn1 }))
1908
- createQuery(() => ({ queryKey: key, queryFn: queryFn2 }))
1902
+ createQuery(() => ({ queryKey: key, queryFn, retryDelay: 10 }))
1903
+ createQuery(() => ({ queryKey: key, queryFn, retryDelay: 20 }))
1909
1904
  return null
1910
1905
  }
1911
1906
 
@@ -1915,7 +1910,7 @@ describe('createQuery', () => {
1915
1910
  </QueryClientProvider>
1916
1911
  ))
1917
1912
 
1918
- expect(queryCache.find({ queryKey: key })!.options.queryFn).toBe(queryFn1)
1913
+ expect(queryCache.find({ queryKey: key })!.options.retryDelay).toBe(20)
1919
1914
  })
1920
1915
 
1921
1916
  it('should batch re-renders', async () => {
@@ -3380,9 +3375,9 @@ describe('createQuery', () => {
3380
3375
  <div>
3381
3376
  <div>FetchStatus: {query.fetchStatus}</div>
3382
3377
  <h2>Data: {query.data || 'no data'}</h2>
3383
- {query.isStale ? (
3378
+ {shouldFetch() ? null : (
3384
3379
  <button onClick={() => setShouldFetch(true)}>fetch</button>
3385
- ) : null}
3380
+ )}
3386
3381
  </div>
3387
3382
  )
3388
3383
  }
@@ -3506,10 +3501,11 @@ describe('createQuery', () => {
3506
3501
  ))
3507
3502
 
3508
3503
  await sleep(50)
3509
- expect(results.length).toBe(2)
3504
+ expect(results.length).toBe(3)
3510
3505
  expect(results[0]).toMatchObject({ data: 'initial', isStale: true })
3511
3506
  expect(results[1]).toMatchObject({ data: 'fetched data', isStale: true })
3512
- // Wont render 3rd time, because data is still the same
3507
+ // disabled observers are not stale
3508
+ expect(results[2]).toMatchObject({ data: 'fetched data', isStale: false })
3513
3509
  })
3514
3510
 
3515
3511
  it('it should support enabled:false in query object syntax', async () => {
@@ -4554,13 +4550,13 @@ describe('createQuery', () => {
4554
4550
  isPending: true,
4555
4551
  isFetching: false,
4556
4552
  isSuccess: false,
4557
- isStale: true,
4553
+ isStale: false,
4558
4554
  })
4559
4555
  expect(states[1]).toMatchObject({
4560
4556
  isPending: true,
4561
4557
  isFetching: true,
4562
4558
  isSuccess: false,
4563
- isStale: true,
4559
+ isStale: false,
4564
4560
  })
4565
4561
  expect(states[2]).toMatchObject({
4566
4562
  data: 1,
@@ -4573,7 +4569,7 @@ describe('createQuery', () => {
4573
4569
  isPending: true,
4574
4570
  isFetching: false,
4575
4571
  isSuccess: false,
4576
- isStale: true,
4572
+ isStale: false,
4577
4573
  })
4578
4574
  })
4579
4575