TanStack / table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table
https://tanstack.com/table
MIT License
25k stars 3.07k forks source link

refactor(svelte-table): improve type inference #5603

Closed thenbe closed 3 months ago

thenbe commented 3 months ago

svelte-check was having a difficult time inferring the props types when using svelte 5. This PR fixes that by swapping out the deprecated type utilities to improve type inference for renderComponent(component, props).

Also updates svelte from svelte@5.0.0-next.78 to svelte@5.0.0-next.155.

nx-cloud[bot] commented 3 months ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit f9857890ab7c545244ea92019704940580c0d944. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target - [`nx affected --targets=test:format,test:sherif,test:knip,test:lib,test:types,test:build,build --parallel=3`](https://cloud.nx.app/runs/bCrvyuy20z?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.

KevinVandy commented 3 months ago

@thenbe I can't get the sorting example types to compile, but also cannot get the error to appear in the editior.

thenbe commented 3 months ago

Yeah I see the same issue. After running pnpm update --latest in the root of the repo the sorting example types can compile again. So I guess some dependencies in the lockfile must be old.

thenbe commented 3 months ago

I'm not sure how to find the exact culprit though.

thenbe commented 3 months ago

The sorting example is the only one failing (out of the other svelte examples) is because it's the only that actually uses renderComponent.

thenbe commented 3 months ago

Updated deps for svelte examples using pnpm update --filter './examples/svelte/*'. Both build and test:types now work in all svelte examples.

KevinVandy commented 3 months ago

be sure to run pnpm test before pushing up. Still some type issues.

KevinVandy commented 3 months ago

Think we got all the right versions upgraded repo wide now