From 09c793b2c982c761f7f5dcf6ac9ea3ab14bc9eb1 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Sun, 24 Sep 2023 19:32:23 +0200 Subject: [PATCH 1/3] add missing dependency in useEffect hook this was causing browsers to crash --- code/lib/manager-api/src/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/lib/manager-api/src/index.tsx b/code/lib/manager-api/src/index.tsx index 3b0a21bdcb94..951dc494a93a 100644 --- a/code/lib/manager-api/src/index.tsx +++ b/code/lib/manager-api/src/index.tsx @@ -397,7 +397,6 @@ export function useSharedState(stateId: string, defaultState?: S) { existingState, STORYBOOK_ADDON_STATE[stateId] ? STORYBOOK_ADDON_STATE[stateId] : defaultState ); - let quicksync = false; if (state === defaultState && defaultState !== undefined) { @@ -409,7 +408,7 @@ export function useSharedState(stateId: string, defaultState?: S) { if (quicksync) { api.setAddonState(stateId, defaultState); } - }); + }, [quicksync]); const setState = async (s: S | API_StateMerger, options?: Options) => { const result = await api.setAddonState(stateId, s, options); From 12be604837545e73ada1777924f5ce4e77629ae7 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Sun, 24 Sep 2023 11:12:31 -0700 Subject: [PATCH 2/3] Revert "Build: Cancel when the PR count is 0" --- .github/workflows/prepare-patch-release.yml | 9 --------- scripts/release/pick-patches.ts | 4 ---- 2 files changed, 13 deletions(-) diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index 237d3f87e186..e4f8e38df502 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -88,15 +88,6 @@ jobs: git config --global user.email '32066757+storybook-bot@users.noreply.github.com' yarn release:pick-patches - - name: Cancel when 0 picked - if: steps.pick-patches.outputs.pr-count == '0' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # From https://stackoverflow.com/a/75809743 - run: | - gh run cancel ${{ github.run_id }} - gh run watch ${{ github.run_id }} - - name: Bump version deferred id: bump-version if: steps.unreleased-changes.outputs.has-changes-to-release == 'true' diff --git a/scripts/release/pick-patches.ts b/scripts/release/pick-patches.ts index ef31087ef976..eab1743dcc7b 100644 --- a/scripts/release/pick-patches.ts +++ b/scripts/release/pick-patches.ts @@ -48,10 +48,6 @@ export const run = async (_: unknown) => { spinner.warn('No PRs found.'); } - if (process.env.GITHUB_ACTIONS === 'true') { - setOutput('pr-count', JSON.stringify(patchPRs.length)); - } - const failedCherryPicks: string[] = []; // eslint-disable-next-line no-restricted-syntax From a3cdabb025524822807318bc137f69be006596c2 Mon Sep 17 00:00:00 2001 From: storybook-bot <32066757+storybook-bot@users.noreply.github.com> Date: Sun, 24 Sep 2023 19:42:56 +0000 Subject: [PATCH 3/3] Update CHANGELOG.md for v7.4.5 [skip ci] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index febe34319967..65162adc174c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 7.4.5 + +- UI: Fix infinite hook call causing browsers to freeze - [#24291](https://github.com/storybookjs/storybook/pull/24291), thanks [@yannbf](https://github.com/yannbf)! + ## 7.4.4 - Core: Fix Promise cycle bug in useSharedState - [#24268](https://github.com/storybookjs/storybook/pull/24268), thanks [@ndelangen](https://github.com/ndelangen)!