lib-jitsi-meet icon indicating copy to clipboard operation
lib-jitsi-meet copied to clipboard

fix(types): update to TS 5.3.3 and fix types

Open DanielMcAssey opened this issue 1 year ago • 14 comments

Took a bit longer than expected, as there were a lot of types to update.

DanielMcAssey avatar Dec 18 '23 16:12 DanielMcAssey

Hi, thanks for your contribution! If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

jitsi-jenkins avatar Dec 18 '23 16:12 jitsi-jenkins

@saghul Ready for review! Had to fix a weird issue with the build, which requires overriding the rollup command https://github.com/vitejs/vite/issues/15167

You can see it in the package.json, sorry for such a big PR, but its the only way I could get it to successfully be used in a TS project, as some of the types needed updating

DanielMcAssey avatar Dec 18 '23 17:12 DanielMcAssey

Impressive work, thank you!

Quick question before I dive deeper: can't we do something to avoid those weird inline imports in the JSdocs?

saghul avatar Dec 18 '23 18:12 saghul

Impressive work, thank you!

Quick question before I dive deeper: can't we do something to avoid those weird inline imports in the JSdocs?

Not that I could find :(

It seems that something changed between TypeScript 4 and 5, and referencing global modules. In an ideal world, when this is fully TypeScript, it wont matter, but its because of the way declaration is generated, it needs to reference the appropriate module.

DanielMcAssey avatar Dec 18 '23 18:12 DanielMcAssey

Sorry but that adds too much curn, it's not a change I'm comfortable adding.

saghul avatar Dec 19 '23 16:12 saghul

Fair enough. I saw your PR, want me to update this one? ill update it to remove the import statements, but keep the fixed types, then move it to the types folder

DanielMcAssey avatar Dec 19 '23 16:12 DanielMcAssey

@saghul I've just pushed an update, it removes the import statements, but still fixes the types and keeps it in the types folder.

Fingers crossed it will be easier for TypeScript modules to be used in JSDoc

Ive kept TS 5.3.3, as it still fixes the constructor being generated incorrectly.

DanielMcAssey avatar Dec 19 '23 16:12 DanielMcAssey

Thank you! I'll take another look!

saghul avatar Dec 19 '23 21:12 saghul

Unfortunately, I tried removing the roll-up hack (Blegh 🤢) hoping that the npm issue had been fixed, but it hasnt. I have re-added just so this builds successfully.

DanielMcAssey avatar Jan 08 '24 13:01 DanielMcAssey

Jenkins please test this please.

saghul avatar Jan 08 '24 13:01 saghul

Let's see if this passes Jenkins. I wonder if there is a problem with Jitsi meet using an older TS... Hopefully not.

saghul avatar Jan 08 '24 13:01 saghul

After Jenkins passes, can you pl add a new commit basically undoing this: https://github.com/jitsi/lib-jitsi-meet/commit/ca40744fa28c5a7bfb93196f0d49760e3c019262 so we can test it that way too?

saghul avatar Jan 08 '24 13:01 saghul

Passed on Jenkins, Added the type line back back

DanielMcAssey avatar Jan 08 '24 13:01 DanielMcAssey

Jenkins please test this please.

saghul avatar Jan 08 '24 14:01 saghul