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

Migrate our usage of internal API get_current_component to other alternative #471

Open
BeeMargarida opened this issue Oct 1, 2023 · 5 comments
Labels
bug Something isn't working investigation

Comments

@BeeMargarida
Copy link
Member

What package has an issue

@svelteuidev/core

A clear and concise description of what the bug is

Type definitions for svelte/internal were removed for svelte 4: https://svelte.dev/docs/v4-migration-guide#other-breaking-changes, sveltejs/svelte#9189

We are using get_current_component, which is an internal method. We should find another solution for this.

In which browser(s) did the problem occur?

Firefox

Steps To Reproduce

  1. Install codebase using svelte>=4
  2. Check TS errors when importing get_current_component in the codebase

Do you know how to fix the issue

Yes

Are you willing to participate in fixing this issue and create a pull request with the fix

Yes

Relevant Assets

No response

@BeeMargarida BeeMargarida added bug Something isn't working investigation labels Oct 1, 2023
@notramo
Copy link

notramo commented Oct 7, 2023

Does it mean that SvelteUI is not usable with Svelte 4 + TypeScript?

@BeeMargarida
Copy link
Member Author

Does it mean that SvelteUI is not usable with Svelte 4 + TypeScript?

It's usable, the internal methods just don't have types, so it gives out TS errors inside the svelteui codebase.

@notramo
Copy link

notramo commented Oct 9, 2023

Does it mean it willl throw TS errors when I run the type checker on my project?

@BeeMargarida
Copy link
Member Author

Does it mean it willl throw TS errors when I run the type checker on my project?

No, I don't think so

@iva2k
Copy link

iva2k commented Jan 30, 2024

There's also another change in svelte/internal - beforeUpdate was moved to svelte, should also fix for that:

- import { beforeUpdate } from 'svelte/internal';
+ import { beforeUpdate } from 'svelte';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigation
Projects
None yet
Development

No branches or pull requests

3 participants