From 00f60d3e1cee3b42f532fedd32fa653e5744cdf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=84=B1=ED=97=8C?= Date: Wed, 14 Dec 2022 12:03:01 +0900 Subject: [PATCH 1/4] feat: add extra arg in onSuccess, onError --- mutation/index.ts | 4 ++-- mutation/types.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mutation/index.ts b/mutation/index.ts index 3dc7ceb17..a623a2e08 100644 --- a/mutation/index.ts +++ b/mutation/index.ts @@ -72,7 +72,7 @@ const mutation = (() => // If it's reset after the mutation, we don't broadcast any state change. if (ditchMutationsUntilRef.current <= mutationStartedAt) { setState({ data, isMutating: false, error: undefined }) - options.onSuccess?.(data as Data, serializedKey, options) + options.onSuccess?.(data as Data, serializedKey, options, arg) } return data } catch (error) { @@ -80,7 +80,7 @@ const mutation = (() => // or throw because it's discarded. if (ditchMutationsUntilRef.current <= mutationStartedAt) { setState({ error: error as Error, isMutating: false }) - options.onError?.(error as Error, serializedKey, options) + options.onError?.(error as Error, serializedKey, options, arg) if (options.throwOnError) { throw error as Error } diff --git a/mutation/types.ts b/mutation/types.ts index d1922a5bc..523be0ffa 100644 --- a/mutation/types.ts +++ b/mutation/types.ts @@ -30,14 +30,16 @@ export type SWRMutationConfiguration< key: string, config: Readonly< SWRMutationConfiguration - > + >, + extraArg: any ) => void onError?: ( err: Error, key: string, config: Readonly< SWRMutationConfiguration - > + >, + extraArg: any ) => void } From dcad1a620b6f0f70528d123b568485a93c56e6ae Mon Sep 17 00:00:00 2001 From: Lee-sungheon Date: Wed, 15 Mar 2023 00:24:10 +0900 Subject: [PATCH 2/4] refactor: modify extraArg type --- mutation/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mutation/types.ts b/mutation/types.ts index 1a9347e46..3e3bd21d6 100644 --- a/mutation/types.ts +++ b/mutation/types.ts @@ -39,7 +39,7 @@ export type SWRMutationConfiguration< config: Readonly< SWRMutationConfiguration >, - extraArg: any + extraArg: ExtraArg ) => void onError?: ( err: Error, @@ -47,7 +47,7 @@ export type SWRMutationConfiguration< config: Readonly< SWRMutationConfiguration >, - extraArg: any + extraArg: ExtraArg ) => void } From 993f1274571fd6d6e9cd6e74d22859da07879c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=84=B1=ED=97=8C?= Date: Sat, 20 Apr 2024 23:19:31 +0900 Subject: [PATCH 3/4] Delete .github/workflows/trigger-release.yml --- .github/workflows/trigger-release.yml | 90 --------------------------- 1 file changed, 90 deletions(-) delete mode 100644 .github/workflows/trigger-release.yml diff --git a/.github/workflows/trigger-release.yml b/.github/workflows/trigger-release.yml deleted file mode 100644 index 6efdb045b..000000000 --- a/.github/workflows/trigger-release.yml +++ /dev/null @@ -1,90 +0,0 @@ -on: - workflow_dispatch: - inputs: - releaseType: - description: Release stable or beta? - required: true - type: choice - options: - - beta - - stable - - semverType: - description: semver type? - type: choice - options: - - patch - - minor - - major - - secrets: - RELEASE_BOT_GITHUB_TOKEN: - required: true - -name: Trigger Release - -env: - PNPM_VERSION: 8.4.0 - SEMVER_TYPE: ${{ github.event.inputs.semverType }} - RELEASE_TYPE: ${{ github.event.inputs.releaseType }} - -jobs: - start: - runs-on: ubuntu-latest - - environment: release-${{ github.event.inputs.releaseType }}-${{ github.event.inputs.semverType }} - steps: - - name: Setup node - uses: actions/setup-node@v3 - if: ${{ steps.docs-change.outputs.docsChange == 'nope' }} - with: - node-version: 18 - check-latest: true - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 10 - token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} - - - run: npm i -g pnpm@${PNPM_VERSION} - - - id: get-store-path - run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - timeout-minutes: 5 - id: cache-pnpm-store - with: - path: ${{ steps.get-store-path.outputs.STORE_PATH }} - key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }} - restore-keys: | - pnpm-store- - pnpm-store-${{ hashFiles('pnpm-lock.yaml') }} - - - run: pnpm install - - - run: | - pnpm clean - pnpm build - pnpm run-all-checks - pnpm test:build - - - name: Configure git - run: | - git config user.name "vercel-release-bot" - git config user.email "infra+release@vercel.com" - - - name: Bump version and tag - run: | - node ./scripts/bump-next-version.js - - - name: Git push - env: - RELEASE_BOT_GITHUB_TOKEN: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} - run: | - git push origin main - git push origin --tags - - - From ac9ae7550b918e977354e7df2790ebaf68480fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=84=B1=ED=97=8C?= Date: Sat, 20 Apr 2024 23:19:45 +0900 Subject: [PATCH 4/4] Delete .github/workflows/test-canary.yml --- .github/workflows/test-canary.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 .github/workflows/test-canary.yml diff --git a/.github/workflows/test-canary.yml b/.github/workflows/test-canary.yml deleted file mode 100644 index 9d8c5c0ba..000000000 --- a/.github/workflows/test-canary.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Test React Canary - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install - uses: ./.github/workflows/install - - - name: Install Canary - run: corepack pnpm upgrade react@canary react-dom@canary use-sync-external-store@canary - - - name: Lint and test - env: - TEST_REACT_LEGACY: 1 - run: | - pnpm clean - pnpm build - pnpm test - pnpm test:build