From 23bcf58428ed289438796ce3d058ae49fb286073 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 19 Oct 2022 14:43:05 +0200 Subject: [PATCH 1/3] cleanup --- code/lib/preview-web/src/UrlStore.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/code/lib/preview-web/src/UrlStore.ts b/code/lib/preview-web/src/UrlStore.ts index 244d374dbcaf..3722ff2b1f60 100644 --- a/code/lib/preview-web/src/UrlStore.ts +++ b/code/lib/preview-web/src/UrlStore.ts @@ -2,7 +2,6 @@ import type { SelectionSpecifier, Selection } from '@storybook/store'; import global from 'global'; import qs from 'qs'; -import deprecate from 'util-deprecate'; import type { ViewMode } from '@storybook/addons'; import { parseArgsParam } from './parseArgsParam'; @@ -66,13 +65,6 @@ const getFirstString = (v: ValueOf): string | void => { return undefined; }; -const deprecatedLegacyQuery = deprecate( - () => 0, - `URL formats with \`selectedKind\` and \`selectedName\` query parameters are deprecated. -Use \`id=$storyId\` instead. -See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-url-structure` -); - export const getSelectionSpecifierFromPath: () => SelectionSpecifier | null = () => { const query = qs.parse(document.location.search, { ignoreQueryPrefix: true }); const args = typeof query.args === 'string' ? parseArgsParam(query.args) : undefined; @@ -94,10 +86,6 @@ export const getSelectionSpecifierFromPath: () => SelectionSpecifier | null = () const title = getFirstString(query.selectedKind); const name = getFirstString(query.selectedStory); - if (title && name) { - deprecatedLegacyQuery(); - return { storySpecifier: { title, name }, args, globals, viewMode }; - } return null; }; From 1dd9930ab89bf1586539051d1ff5942024361f1b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 19 Oct 2022 15:00:06 +0200 Subject: [PATCH 2/3] cleanup --- code/lib/preview-web/src/UrlStore.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/code/lib/preview-web/src/UrlStore.ts b/code/lib/preview-web/src/UrlStore.ts index 3722ff2b1f60..3b56f76b0695 100644 --- a/code/lib/preview-web/src/UrlStore.ts +++ b/code/lib/preview-web/src/UrlStore.ts @@ -82,10 +82,6 @@ export const getSelectionSpecifierFromPath: () => SelectionSpecifier | null = () return { storySpecifier: storyId, args, globals, viewMode }; } - // Legacy URL format - const title = getFirstString(query.selectedKind); - const name = getFirstString(query.selectedStory); - return null; }; From 914191e2133e09b5ca8be1684e85f9a45a3db226 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 19 Oct 2022 15:15:32 +0200 Subject: [PATCH 3/3] remove tests for removed features --- code/lib/preview-web/src/UrlStore.test.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/code/lib/preview-web/src/UrlStore.test.ts b/code/lib/preview-web/src/UrlStore.test.ts index 463008c8b584..132e368ede91 100644 --- a/code/lib/preview-web/src/UrlStore.test.ts +++ b/code/lib/preview-web/src/UrlStore.test.ts @@ -75,13 +75,6 @@ describe('UrlStore', () => { viewMode: 'story', }); }); - it('should parse legacy queries', () => { - document.location.search = '?selectedKind=kind&selectedStory=story'; - expect(getSelectionSpecifierFromPath()).toEqual({ - storySpecifier: { title: 'kind', name: 'story' }, - viewMode: 'story', - }); - }); it('should parse args', () => { document.location.search = '?id=story--id&args=obj.key:val'; expect(getSelectionSpecifierFromPath()).toEqual({