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 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 - - - diff --git a/src/mutation/index.ts b/src/mutation/index.ts index e15468596..eb9289ce9 100644 --- a/src/mutation/index.ts +++ b/src/mutation/index.ts @@ -81,7 +81,7 @@ const mutation = (() => startTransition(() => 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) { @@ -91,7 +91,7 @@ const mutation = (() => startTransition(() => 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/src/mutation/types.ts b/src/mutation/types.ts index 4706c10ee..21a807db4 100644 --- a/src/mutation/types.ts +++ b/src/mutation/types.ts @@ -37,14 +37,16 @@ export type SWRMutationConfiguration< key: string, config: Readonly< SWRMutationConfiguration - > + >, + extraArg: ExtraArg ) => void onError?: ( err: Error, key: string, config: Readonly< SWRMutationConfiguration - > + >, + extraArg: ExtraArg ) => void }