Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/swr
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.4
Choose a base ref
...
head repository: vercel/swr
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.2.5
Choose a head ref
  • 11 commits
  • 69 files changed
  • 8 contributors

Commits on Nov 13, 2023

  1. Update bundler (#2830)

    huozhi authored Nov 13, 2023

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1d81109 View commit details

Commits on Dec 19, 2023

  1. fix: all act warnings (#2861)

    koba04 authored Dec 19, 2023

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    ef63a30 View commit details

Commits on Jan 14, 2024

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    387a3ab View commit details
  2. build: use new bundle convention (#2865)

    * build: use new bundle convention
    
    * fix test alias
    
    * chore: fix lint error
    
    * update bundler and pkg exports
    
    * import from core
    
    * react-server alias
    
    * Update alias
    
    * simplify script
    
    * change internal import path
    
    * rm duplicated script
    
    * fix imports
    
    * rm unused
    
    * upgrade bunchee and fix export
    
    * fix alias
    
    ---------
    
    Co-authored-by: Yixuan Xu <yixuanxu94@outlook.com>
    huozhi and promer94 authored Jan 14, 2024

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf5363e View commit details
  3. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b18781b View commit details
  4. Verified

    This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d5d8482 View commit details

Commits on Jan 17, 2024

  1. Verified

    This commit was created on github.com and signed with GitHub’s verified signature.
    Copy the full SHA
    30cfa8c View commit details

Commits on Feb 15, 2024

  1. fix: allow onErrorRetry on inactive tab without focus/reconnect reval…

    …idation (#2848)
    
    fix: #2543
    qkdreyer authored Feb 15, 2024

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f306893 View commit details
  2. feat: pass a function to the revalidate option in mutate (#2862)

    feat: pass a function to revalidate option in mutate
    koba04 authored Feb 15, 2024

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3668c90 View commit details
  3. fix: SWRConfiguration type (#2882)

    * fix: SWRConfiguration type
    
    * add test
    
    ---------
    
    Co-authored-by: Jiachi Liu <inbox@huozhi.im>
    samuelhulla and huozhi authored Feb 15, 2024

    Verified

    This commit was created on github.com and signed with GitHub’s verified signature.
    Copy the full SHA
    744f692 View commit details
  4. 2.2.5

    vercel-release-bot committed Feb 15, 2024
    Copy the full SHA
    79445e4 View commit details
Showing with 852 additions and 630 deletions.
  1. +3 −2 .github/workflows/test-canary.yml
  2. +2 −1 .github/workflows/test-release.yml
  3. +1 −1 .github/workflows/trigger-release.yml
  4. +4 −19 _internal/package.json
  5. +0 −7 _internal/tsconfig.json
  6. +0 −24 core/package.json
  7. +0 −4 core/src/serialize.ts
  8. +0 −8 core/tsconfig.json
  9. +6 −0 e2e/test/tsconfig.json
  10. 0 {core/src → }/env.d.ts
  11. +4 −19 immutable/package.json
  12. +0 −7 immutable/tsconfig.json
  13. +4 −21 infinite/package.json
  14. +0 −1 infinite/src/index.react-server.ts
  15. +0 −7 infinite/tsconfig.json
  16. +6 −6 jest.config.js
  17. +4 −19 mutation/package.json
  18. +0 −7 mutation/tsconfig.json
  19. +71 −58 package.json
  20. +393 −324 pnpm-lock.yaml
  21. 0 {_internal/src → src/_internal}/constants.ts
  22. 0 {_internal/src → src/_internal}/events.ts
  23. 0 {_internal/src → src/_internal}/index.react-server.ts
  24. 0 {_internal/src → src/_internal}/index.ts
  25. +11 −3 {_internal/src → src/_internal}/types.ts
  26. 0 {_internal/src → src/_internal}/utils/cache.ts
  27. +4 −12 {_internal/src → src/_internal}/utils/config-context.ts
  28. 0 {_internal/src → src/_internal}/utils/config.ts
  29. 0 {_internal/src → src/_internal}/utils/devtools.ts
  30. 0 {_internal/src → src/_internal}/utils/env.ts
  31. 0 {_internal/src → src/_internal}/utils/global-state.ts
  32. 0 {_internal/src → src/_internal}/utils/hash.ts
  33. 0 {_internal/src → src/_internal}/utils/helper.ts
  34. 0 {_internal/src → src/_internal}/utils/merge-config.ts
  35. 0 {_internal/src → src/_internal}/utils/middleware-preset.ts
  36. +3 −1 {_internal/src → src/_internal}/utils/mutate.ts
  37. 0 {_internal/src → src/_internal}/utils/normalize-args.ts
  38. 0 {_internal/src → src/_internal}/utils/preload.ts
  39. 0 {_internal/src → src/_internal}/utils/resolve-args.ts
  40. 0 {_internal/src → src/_internal}/utils/serialize.ts
  41. 0 {_internal/src → src/_internal}/utils/shared.ts
  42. 0 {_internal/src → src/_internal}/utils/subscribe-key.ts
  43. 0 {_internal/src → src/_internal}/utils/timestamp.ts
  44. 0 {_internal/src → src/_internal}/utils/use-swr-config.ts
  45. 0 {_internal/src → src/_internal}/utils/web-preset.ts
  46. 0 {_internal/src → src/_internal}/utils/with-middleware.ts
  47. +4 −4 {core/src → src/core}/index.ts
  48. +4 −0 src/core/serialize.ts
  49. +3 −4 {core/src → src/core}/use-swr.ts
  50. +3 −3 {immutable/src → src/immutable}/index.ts
  51. +1 −0 src/index/index.react-server.ts
  52. +2 −0 src/index/index.ts
  53. 0 {core/src → src/infinite}/index.react-server.ts
  54. +18 −11 {infinite/src → src/infinite}/index.ts
  55. +1 −1 {infinite/src → src/infinite}/serialize.ts
  56. +23 −3 {infinite/src → src/infinite}/types.ts
  57. +3 −3 {mutation/src → src/mutation}/index.ts
  58. +1 −1 {mutation/src → src/mutation}/state.ts
  59. +2 −2 {mutation/src → src/mutation}/types.ts
  60. +9 −3 {subscription/src → src/subscription}/index.ts
  61. +1 −1 {subscription/src → src/subscription}/types.ts
  62. +4 −19 subscription/package.json
  63. +0 −9 subscription/tsconfig.json
  64. +42 −0 test/type/config.tsx
  65. +1 −2 test/type/mutation.ts
  66. +44 −0 test/use-swr-infinite.test.tsx
  67. +120 −3 test/use-swr-local-mutation.test.tsx
  68. +49 −1 test/use-swr-remote-mutation.test.tsx
  69. +1 −9 tsconfig.json
5 changes: 3 additions & 2 deletions .github/workflows/test-canary.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Test React Canary

on:
workflow_dispatch:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

@@ -20,7 +20,8 @@ jobs:

- name: Lint and test
run: |
pnpm run-all-checks
pnpm clean
pnpm build
pnpm run-all-checks
pnpm test
pnpm test:build
3 changes: 2 additions & 1 deletion .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -20,10 +20,11 @@ jobs:

- name: Lint and test
run: |
pnpm run-all-checks
pnpm clean
pnpm build
pnpm run-all-checks
pnpm attw
pnpm test
pnpm test:build
e2e:
runs-on: ubuntu-latest
2 changes: 1 addition & 1 deletion .github/workflows/trigger-release.yml
Original file line number Diff line number Diff line change
@@ -65,9 +65,9 @@ jobs:
- run: pnpm install

- run: |
pnpm run-all-checks
pnpm clean
pnpm build
pnpm run-all-checks
pnpm test:build
- name: Configure git
23 changes: 4 additions & 19 deletions _internal/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
{
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
"exports": {
"react-server": "./dist/react-server.mjs",
"import": "./dist/index.mjs",
"module": "./dist/index.esm.js",
"require": "./dist/index.js"
},
"private": true,
"scripts": {
"watch": "bunchee -w",
"build": "bunchee",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
"peerDependencies": {
"react": "*"
}
"main": "../dist/_internal/index.js",
"module": "../dist/_internal/index.esm.js",
"types": "../dist/_internal/index.d.ts",
"private": true
}
7 changes: 0 additions & 7 deletions _internal/tsconfig.json

This file was deleted.

24 changes: 0 additions & 24 deletions core/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions core/src/serialize.ts

This file was deleted.

8 changes: 0 additions & 8 deletions core/tsconfig.json

This file was deleted.

6 changes: 6 additions & 0 deletions e2e/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
".",
],
}
File renamed without changes.
23 changes: 4 additions & 19 deletions immutable/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
{
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.mjs",
"module": "./dist/index.esm.js",
"require": "./dist/index.js"
},
"private": true,
"scripts": {
"watch": "bunchee -w",
"build": "bunchee",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
"peerDependencies": {
"swr": "*",
"react": "*"
}
"main": "../dist/immutable/index.js",
"module": "../dist/immutable/index.esm.js",
"types": "../dist/immutable/index.d.ts",
"private": true
}
7 changes: 0 additions & 7 deletions immutable/tsconfig.json

This file was deleted.

25 changes: 4 additions & 21 deletions infinite/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
{
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
"exports": {
"react-server": "./dist/react-server.mjs",
"import": "./dist/index.mjs",
"module": "./dist/index.esm.js",
"require": "./dist/index.js"
},
"private": true,
"scripts": {
"watch": "bunchee -w",
"build": "bunchee",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
"peerDependencies": {
"swr": "*",
"react": "*",
"use-sync-external-store": "*"
}
"main": "../dist/infinite/index.js",
"module": "../dist/infinite/index.esm.js",
"types": "../dist/infinite/index.d.ts",
"private": true
}
1 change: 0 additions & 1 deletion infinite/src/index.react-server.ts

This file was deleted.

7 changes: 0 additions & 7 deletions infinite/tsconfig.json

This file was deleted.

12 changes: 6 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -5,12 +5,12 @@ module.exports = {
modulePathIgnorePatterns: ['<rootDir>/examples/'],
setupFilesAfterEnv: ['<rootDir>/test/jest-setup.ts'],
moduleNameMapper: {
'^swr$': '<rootDir>/core/src/index.ts',
'^swr/infinite$': '<rootDir>/infinite/src/index.ts',
'^swr/immutable$': '<rootDir>/immutable/src/index.ts',
'^swr/subscription$': '<rootDir>/subscription/src/index.ts',
'^swr/mutation$': '<rootDir>/mutation/src/index.ts',
'^swr/_internal$': '<rootDir>/_internal/src/index.ts'
'^swr$': '<rootDir>/src/index/index.ts',
'^swr/infinite$': '<rootDir>/src/infinite/index.ts',
'^swr/immutable$': '<rootDir>/src/immutable/index.ts',
'^swr/subscription$': '<rootDir>/src/subscription/index.ts',
'^swr/mutation$': '<rootDir>/src/mutation/index.ts',
'^swr/_internal$': '<rootDir>/src/_internal/index.ts'
},
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest']
23 changes: 4 additions & 19 deletions mutation/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
{
"main": "./dist/index.js",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.mjs",
"module": "./dist/index.esm.js",
"require": "./dist/index.js"
},
"private": true,
"scripts": {
"watch": "bunchee -w",
"build": "bunchee",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
"peerDependencies": {
"swr": "*",
"react": "*"
}
"main": "../dist/mutation/index.js",
"module": "../dist/mutation/index.esm.js",
"types": "../dist/mutation/index.d.ts",
"private": true
}
7 changes: 0 additions & 7 deletions mutation/tsconfig.json

This file was deleted.

Loading