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

Use of svelte/internal in Svelte 5 #5707

Closed
2 tasks done
moalamri opened this issue Aug 12, 2024 · 7 comments
Closed
2 tasks done

Use of svelte/internal in Svelte 5 #5707

moalamri opened this issue Aug 12, 2024 · 7 comments

Comments

@moalamri
Copy link

TanStack Table version

8.20.1

Framework/Library version

Svelte 5

Describe the bug and the steps to reproduce it

This is not related to the use of runs in Svelte 5 or migrating the current TanStack's codebase to Svelte 5 as it should be working fine with Svelte 4.
It is about the use of svelte/internal as it is no longer supported in Svelte 5 which will make TanStack unusable and a migration blocker to projects depending on it.

          The solution is to not rely on `svelte/internal` anymore. If you're solely using this for utility functions (like `identity` in your case), just copy the function into your own code and remove the import. For non-utility functions it would be good to know why you reach into internals. In the meantime, closing since it looks like you're only relying on it for utility functions.

Originally posted by @dummdidumm in sveltejs/svelte#12104 (comment)

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACmWNwQrCQAxEfyXkUoVK76WKfoO9WQ_rNoXFbrJsUkFK_11avXl8M8ObGYcwkmJ9m5FdJKzxkhKWaO-0gr5oNMISVabs16RRn0OyU8chJskGM_hMzui6TVv3GAkWGLJEKM7mWM35Z_UVHWyti469sBpsBMd_wU6SBWHdd9xUv0MsMUofhkA91pYnWu7LBxTLfES_AAAA

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
@moalamri
Copy link
Author

After going through some PRs, I found that this issue should be fixed with some upcoming update.

@alissa-tung
Copy link

After going through some PRs, I found that this issue should be fixed with some upcoming update.

I have tested it with pnpm add @tanstack/svelte-table@alpha, seems works well

@KevinVandy
Copy link
Member

After going through some PRs, I found that this issue should be fixed with some upcoming update.

I have tested it with pnpm add @tanstack/svelte-table@alpha, seems works well

Be aware that some breaking changes will be coming to the alpha soon though. And we don't have the v9 alpha docs visible on the TanStack website yet, but they can be browsed on GitHub.

@moalamri
Copy link
Author

After going through some PRs, I found that this issue should be fixed with some upcoming update.

I have tested it with pnpm add @tanstack/svelte-table@alpha, seems works well

I didn’t test the alpha and I didn’t know it was under development, sorry for that :)

according to @KevinVandy I better not implement it for now so I will wait for the official release.

Thank you all for the good work

@KevinVandy
Copy link
Member

After going through some PRs, I found that this issue should be fixed with some upcoming update.

I have tested it with pnpm add @tanstack/svelte-table@alpha, seems works well

I didn’t test the alpha and I didn’t know it was under development, sorry for that :)

according to @KevinVandy I better not implement it for now so I will wait for the official release.

Thank you all for the good work

You can use it, you just might want to pin the version and make sure you only upgrade intentionally.

@moalamri
Copy link
Author

moalamri commented Aug 14, 2024

I just updated TanStack Table to alpha.10, applied all the new changes and it is rendering👍🏻
Just a little tip, to make options writable and the table instance reactive as in Svelte 4 I did the following.

let options: TableOptions<any> = $state({
    data: defaultData,
    columns: defaultColumns,
    getCoreRowModel: getCoreRowModel()
});

const table = $derived(createTable(options));

Maybe you want to update the examples code.
Thanks a lot 👍🏻

Nvm 😄

@dummdidumm
Copy link

dummdidumm commented Oct 28, 2024

If anyone's looking for a drop-in replacement that largely keeps the old API of @tanstack/svelte-table version 8 while using Svelte 5, I created one meant as a temporary solution until you can upgrade to @tanstack/svelte-table version 9: https://www.npmjs.com/package/tanstack-table-8-svelte-5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants