Skip to content

Conversation

@wtcross
Copy link

@wtcross wtcross commented Dec 6, 2023

Thank you for this awesome Svelte wrapper for AG Grid. I saw you have a WIP svelte4 branch that was very close to working. I added a few commits on top of yours to get everything working.

Right now tests pass and I have been able to use this version in a Svelte 4 project, but there are a few issues caught by type-aware linting:

ag-grid-svelte\src\lib\AgGridSvelte.svelte 3:62 error Avoid referencing unbound methods which may cause unintentional scoping of `this`. If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead @typescript-eslint/unbound-method 4:61 error Avoid referencing unbound methods which may cause unintentional scoping of `this`. If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead @typescript-eslint/unbound-method 372:26 error Avoid referencing unbound methods which may cause unintentional scoping of `this`. If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead @typescript-eslint/unbound-method ag-grid-svelte\src\lib\SvelteFrameworkComponentWrapper.ts 72:5 error Unsafe return of an `any` typed value @typescript-eslint/no-unsafe-return 73:7 error Unsafe call of an `any` typed value @typescript-eslint/no-unsafe-call 73:13 error Unsafe member access .prototype on an `any` value @typescript-eslint/no-unsafe-member-access 74:60 error Unsafe argument of type `any` assigned to a parameter of type `Object` @typescript-eslint/no-unsafe-argument ag-grid-svelte\src\routes\guide\02-columns\09-column-spanning\column-spanning-complex.svelte 81:24 error Unsafe member access .section on an `any` value @typescript-eslint/no-unsafe-member-access 85:24 error Unsafe member access .section on an `any` value @typescript-eslint/no-unsafe-member-access ag-grid-svelte\src\routes\guide\03-rows\01-row-ids\get-row-id.svelte 22:46 error Unsafe return of an `any` typed value @typescript-eslint/no-unsafe-return 22:58 error Unsafe member access .id on an `any` value @typescript-eslint/no-unsafe-member-access 

I wanted to get direction from you on how you'd like to resolve these errors. I am guessing this is where you stopped your work on the svelte4 branch. It has been a long time since I worked with Typescript, but it appears that resolving these issues will take some work.

What do you think?

Svelte 4 deprecated `SvelteComponentTyped`, as `SvelteComponent` now has all its typing capabilites.
@wtcross wtcross changed the title Towards migration to Svelte 4 WIP: Towards migration to Svelte 4 Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant