Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 492ddef

Browse files
authored
Svelte: Fix Safari 17.3 groupBy usage (#63964)
Currently, svelte build of Sourcegraph is broken on s2 and dotcom for users who use Safari 17.3 and lower The problem is that we use the `Object.groupBy` method, which isn't supported in "old" Safari versions like 17.3 and lower. See caniuse documentation about this here https://caniuse.com/?search=groupBy (in the old Safari version this method is actually named `groupToMap` ## Test plan - Check basic functionality Search flow in Safari (especially in Safari 17.3) <!-- REQUIRED; info at https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles --> ## Changelog <!-- OPTIONAL; info at https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c -->
1 parent b5ac21b commit 492ddef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

client/web-sveltekit/src/lib/search/dynamicFilters/Sidebar.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
</script>
110110

111111
<script lang="ts">
112+
import { groupBy } from 'lodash'
112113
import { onMount, type ComponentProps } from 'svelte'
113114
114115
import type { Filter as QueryFilter } from '@sourcegraph/shared/src/search/query/token'
@@ -162,10 +163,10 @@
162163
}
163164
164165
let groupedSelectedFilters: Partial<Record<SectionKind, SelectedFilter[]>>
165-
$: groupedSelectedFilters = Object.groupBy(selectedFilters, ({ kind }) => kind)
166+
$: groupedSelectedFilters = groupBy(selectedFilters, ({ kind }) => kind)
166167
167168
let groupedStreamFilters: Partial<Record<SectionKind, StreamFilter[]>>
168-
$: groupedStreamFilters = Object.groupBy(streamFilters, ({ kind }) => kind)
169+
$: groupedStreamFilters = groupBy(streamFilters, ({ kind }) => kind)
169170
170171
// Then we merge the groups together. Different sources provide different
171172
// information (see mergeFilterSources for details). After we've merged, add

0 commit comments

Comments
 (0)