Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/remove imports from svelte/internal #2569

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/lib/components/event/event-summary-row.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import { noop } from 'svelte/internal';
import { fade, slide } from 'svelte/transition';

import { page } from '$app/stores';
Expand Down Expand Up @@ -46,7 +45,7 @@
export let expandAll = false;
export let typedError = false;
export let active = false;
export let onRowClick: () => void = noop;
export let onRowClick: () => void = () => {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look goo to me but this function could also be () => void no need to change just commenting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought void was only valid as a type declaration, not the function itself πŸ€”


$: selectedId = isEventGroup(event)
? Array.from(event.events.keys()).shift()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import { noop } from 'svelte/internal';

import { page } from '$app/stores';

import Icon from '$lib/holocene/icon/icon.svelte';
Expand All @@ -19,7 +17,7 @@
export let index: number;
export let expandAll = false;
export let active = false;
export let onRowClick: () => void = noop;
export let onRowClick: () => void = () => {};

$: expanded = expandAll;
$: ({ workflow, run, namespace } = $page.params);
Expand Down
4 changes: 1 addition & 3 deletions src/lib/components/event/pending-nexus-summary-row.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import { noop } from 'svelte/internal';

import { page } from '$app/stores';

import Icon from '$lib/holocene/icon/icon.svelte';
Expand All @@ -18,7 +16,7 @@
export let index: number;
export let expandAll = false;
export let active = false;
export let onRowClick: () => void = noop;
export let onRowClick: () => void = () => {};

$: expanded = expandAll;
$: ({ workflow, run, namespace } = $page.params);
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/search-attribute-filter/index.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script lang="ts" context="module">
import { afterUpdate } from 'svelte/internal';
import { writable, type Writable } from 'svelte/store';
import { fly } from 'svelte/transition';

import { setContext } from 'svelte';
import { afterUpdate, setContext } from 'svelte';

export const FILTER_CONTEXT = 'filter-context';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/timezone-select.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { onMount } from 'svelte/internal';
import { onMount } from 'svelte';

import Icon from '$lib/holocene/icon/icon.svelte';
import Input from '$lib/holocene/input/input.svelte';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import { noop } from 'svelte/internal';

import { getContext } from 'svelte';

import { page } from '$app/stores';
Expand All @@ -24,7 +22,7 @@

export let workflow: WorkflowExecution | undefined = undefined;
export let empty = false;
export let viewChildren: (workflow?: WorkflowExecution) => void = noop;
export let viewChildren: (workflow?: WorkflowExecution) => void = () => {};
export let childCount: number | undefined = undefined;
export let child = false;

Expand Down
3 changes: 1 addition & 2 deletions src/lib/holocene/accordion/accordion.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import type { HTMLAttributes } from 'svelte/elements';
import { noop } from 'svelte/internal';

import { twMerge as merge } from 'tailwind-merge';
import { v4 } from 'uuid';
Expand Down Expand Up @@ -28,7 +27,7 @@
export let open = false;
export let expandable = true;
export let error = '';
export let onToggle = noop;
export let onToggle = () => {};

let className = '';
export { className as class };
Expand Down
4 changes: 1 addition & 3 deletions src/lib/holocene/calendar.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import { noop } from 'svelte/internal';

import { createEventDispatcher } from 'svelte';

import { getDateRows, weekDays } from '$lib/utilities/calendar';
Expand Down Expand Up @@ -41,7 +39,7 @@
{#if value}
<button
type="button"
on:click={allowed && value ? () => onChange(value) : noop}
on:click={allowed && value ? () => onChange(value) : () => {}}
class="cell"
class:highlight={allowed && value}
class:disabled={!allowed}
Expand Down
4 changes: 1 addition & 3 deletions src/lib/holocene/filter-or-copy-buttons.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import { noop } from 'svelte/internal';

import { twMerge as merge } from 'tailwind-merge';

import Icon from '$lib/holocene/icon/icon.svelte';
Expand All @@ -10,7 +8,7 @@
export let filterable = true;
export let copyable = true;
export let content: string;
export let onFilter: () => void = noop;
export let onFilter: () => void = () => {};
export let filtered = false;
export let copyIconTitle: string;
export let copySuccessIconTitle: string;
Expand Down
3 changes: 1 addition & 2 deletions src/lib/holocene/pill-container/pill.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import type { HTMLButtonAttributes } from 'svelte/elements';
import { noop } from 'svelte/internal';

import { getContext } from 'svelte';
import { twMerge as merge } from 'tailwind-merge';
Expand All @@ -24,7 +23,7 @@
} & HTMLButtonAttributes;

export let id: string;
export let onClick: () => void = noop;
export let onClick: () => void = () => {};
export let disabled = false;
export let loading = false;
export let active: boolean = null;
Expand Down
5 changes: 2 additions & 3 deletions src/lib/holocene/select/select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@

<script lang="ts">
import type { HTMLInputAttributes } from 'svelte/elements';
import { noop, onMount } from 'svelte/internal';
import { writable, type Writable } from 'svelte/store';

import { setContext } from 'svelte';
import { onMount, setContext } from 'svelte';

import type { ButtonStyles } from '$lib/holocene/button.svelte';
import type { IconName } from '$lib/holocene/icon';
Expand Down Expand Up @@ -56,7 +55,7 @@
export let placeholder = '';
export let disabled = false;
export let leadingIcon: IconName = null;
export let onChange: (value: T) => void = noop;
export let onChange: (value: T) => void = () => {};
export let menuClass: string | undefined = undefined;
export let variant: ButtonStyles['variant'] = 'secondary';
export let required = false;
Expand Down
3 changes: 1 addition & 2 deletions src/lib/holocene/tab/tab.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import type { HTMLAttributes, HTMLButtonAttributes } from 'svelte/elements';
import { noop } from 'svelte/internal';

import { getContext } from 'svelte';

Expand Down Expand Up @@ -29,7 +28,7 @@
export let panelId: string = null;
export let disabled = false;
export let active: boolean = null;
export let onClick: () => void = noop;
export let onClick: () => void = () => {};

const { registerTab, selectTab, activeTab } = getContext<TabContext>(TABS);

Expand Down
6 changes: 2 additions & 4 deletions src/lib/services/workflow-counts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { noop } from 'svelte/internal';

import type { CountWorkflowExecutionsResponse } from '$lib/types/workflows';
import { requestFromAPI } from '$lib/utilities/request-from-api';
import { routeForApi } from '$lib/utilities/route-for-api';
Expand All @@ -14,8 +12,8 @@ export const fetchWorkflowCount = async (
const countRoute = routeForApi('workflows.count', { namespace });
const result = await requestFromAPI<{ count: string }>(countRoute, {
params: query ? { query } : {},
onError: noop,
handleError: noop,
onError: () => {},
handleError: () => {},
request,
});
count = parseInt(result?.count || '0');
Expand Down
6 changes: 2 additions & 4 deletions vitest-setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { noop } from 'svelte/internal';

import i18next from 'i18next';
import { vi } from 'vitest';

Expand All @@ -21,8 +19,8 @@ i18next.init({
});

const BroadcastChannelMock = vi.fn(() => ({
addEventListener: noop,
postMessage: noop,
addEventListener: () => {},
postMessage: () => {},
}));

vi.stubGlobal('BroadcastChannel', BroadcastChannelMock);
Expand Down
Loading