Cvmcosta / ltijs

Turn your application into a fully integratable LTI 1.3 tool provider.
https://cvmcosta.github.io/ltijs/
Apache License 2.0
303 stars 69 forks source link

Typescript support #35

Closed paulschwoerer closed 4 years ago

paulschwoerer commented 4 years ago

Hi :)

First of all: thanks for your great work!

would you be interested in including typings in this library, for it to be usable in typescript? I'm currently using it in a typescript project in university, so I'd be able to provide the typings I made. They might be incomplete however and I'd appreciate if you'd have a look at it, given your understanding of the library goes much deeper!

Cheers

Cvmcosta commented 4 years ago

Hello!! Thank you for your interest in this project :)!

I really like your idea, but I've never worked with typescript before, so to be honest i don't really know how to do this. But i would like to look into what you did and learn about it to be able to implement this in the near future. Right now i'm focused on getting an IMS Certification for the library, but this could be a good next step.

Thanks again!

paulschwoerer commented 4 years ago

I don't think it would be too much of a hassle, have a look at these links:

If you'd like I could start a PR, so you and maybe some other people could look at it and expand on the typings I did (some result types are missing/ incomplete)

Cheers

Cvmcosta commented 4 years ago

Yes, that would be nice :). And thank you for the links, i'll look into it during the weekend.

paulschwoerer commented 4 years ago

It's also possible to publish the typings to DefinitelyTyped, which seems to be recommended by the people behind typescript.

I guess that's up to you :)

paulschwoerer commented 4 years ago

Haven't heard from you in a while, I guess I'll do a PR at Definitely Typed, as recommended. After that it'll still be possible to integrate the typings at a later date.

Cvmcosta commented 4 years ago

Hello, sorry for not answering sooner, I've been dealing with some personal issues and haven't had much time to work on this, and the little time i had was directed towards some bug fixes and the IMS certification process. I see you didn't open a pull request here yet, what would be the next step towards me implementing this feature?

paulschwoerer commented 4 years ago

No worries man, those things should always be prioritized!

After digging around how to properly implement typescript typings for external libraries, I found this page, which states, that typings for a library not written in typescript should be distributed with DefinitelyTyped. I guess the reason for that is, that you would need to include typescript dependencies, which could be annoying for people who are working with your library, but are not using typescript.

This is why I think the next step forward for this will be a PR I'm working on right now for the DefinitelyTyped repository. I'll let you know as soon as that's finished, it would be great if you could have a quick look at it. If you decide one day to transform your library to typescript, the typings can be moved/deleted from DefinitelyTyped.

Cheers!

paulschwoerer commented 4 years ago

See here for the PR

Cvmcosta commented 4 years ago

Sounds great, please let me know once the PR is finished. I read a bit about it and took a quick look at the PR. Thanks again for the great work!

paulschwoerer commented 4 years ago

Could you add a comment in the PR, that you, as the library creator, approve of the changes? That could lead to the PR being merged sooner. Only if you're comfortable with that, of course.

Cvmcosta commented 4 years ago

Sure! I left a comment there. :)

Cvmcosta commented 4 years ago

Hello @paulschwoerer, just wanted to let you now that a new version of Ltijs is out now, and a few API changes were made. I was wondering if the typings need to be updated? And if you would please help me through the process, or at least point me in the right direction.

paulschwoerer commented 4 years ago

Hey :) Could you point me to where those API changes are documented? The typings only need updating if the public facing API changed (new methods, different parameters/ parameter types)

Cvmcosta commented 4 years ago

Hey, thanks, i documented the major changes in this Migration Tutorial, only a few of them involve public facing APIs. Also the New features section of the Changelog describes a few additions to existing methods and one new method.

paulschwoerer commented 4 years ago

I made a WIP version. You can have a look at it here.

Please let me know if you can spot any mistakes

ssciolla commented 3 years ago

Hi @Cvmcosta and @paulschwoerer, I'm taking a look at ltijs as a possible solution for my organization for an LTI tool integrating with a Canvas LMS instance. We're hoping to use TypeScript with this project, and I found this issue during my investigation. I'm going to pull down the last iteration of version 4 (since I'm guessing that will work with the existing @types/ltijs), but it'd be great to have updated typings as I explore this. This is a friendly message to see if you have available time to finalize Paul's work, which looks solid. (I might try running those changes, as well, if I can figure it out...) Thanks for all your efforts -- past, present, and future!

Cvmcosta commented 3 years ago

Hello @ssciolla! I really haven't had the time to work on keeping the typings up to date, so i don't know how far off it is from the current state of the project. I'd greatly appreciate if you could take a look and let me know what you think. Between other priorities in the project and my daytime job i haven't had the time to look into it.

That being said, in the meantime, if your company is looking for a LTI solution that does not clash with your current application, you should look into Ltiaas (LTI as a Service). It is a complete implementation of a LTI Provider as a microservice where every LTI Service and functionality is easily accessible through a simple API. The project is not open source, though. It is part of a package i've been selling that includes the System and Consulting for the integration with it. Ltiaas is being used by various companies like Powtoon(where i currently work at) and Dynos.io.

Shameless plug aside, you can also create a microservice-like solution from the ground up with Ltijs using the ltiaas flag to be able to access routes without cookies, only passing the ltik token. That is a way to avoid compatibility issues if the Ltijs Typings are not up to date.

ssciolla commented 3 years ago

Thanks for the extra info, I wasn't aware of ltiaas. I work in academia, and I think we're really looking for an open-source solution. I was able to set up Paul's updated typings, so as I experiment and decide whether the package will work for us, I can update you here on whether they are working as expected. The micro-service setup is also something I can consider; thanks for that idea!

Cvmcosta commented 3 years ago

@ssciolla If you are with an university i could give you free access to the Ltiaas codebase and help you get set up, if you'd like. I am working with a couple of universities since i feel that it helps with the project reach and visibility.

ssciolla commented 3 years ago

@Cvmcosta, let me get a bit more comfortable with the ltijs codebase and talk with the team about my findings. We're still very much in the research phase. I appreciate the gesture though, and I will follow up with you if we would like to hear more details.