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

Potential Typescript support? #9

Open
michalusio opened this issue Oct 11, 2022 · 13 comments
Open

Potential Typescript support? #9

michalusio opened this issue Oct 11, 2022 · 13 comments

Comments

@michalusio
Copy link

michalusio commented Oct 11, 2022

Hi!

First of all, thank you for creating a fork of blessed.

I am currently in the process of writing a JSX wrapper for blessed and I've wanted to use your fork as the basis.
However the package does not have any typings, there's no DefinitelyTyped for it, and @types/blessed has many incorrect typings.

I was thinking to either add Typescript to this project, or add a d.ts file with correct typings for now.

I could take a look at it soon if the package is still maintained?

@kenan238
Copy link
Owner

Hello, about switching to Typescript, I don't think I really wanna do that. Incrementally adopting it is gonna get messy and rewriting the huge library is gonna be a hard task so I'll go with making d.ts file, I'll start working on it right away.

@kenan238
Copy link
Owner

Finished adding d.ts typings!

@michalusio
Copy link
Author

michalusio commented Oct 27, 2022

Hello @kenan238 !

I'm really not sure why this issue was closed, but I just wanted to say that those typings are not really great (Box accepting any as options...).
I can start working on adding declaration files or rewriting the library into TS (You can do that easily using "checkJS" options in tsconfig).

@DoormatIka
Copy link

DoormatIka commented Jan 12, 2023

Hello @kenan238.

The .d.ts module doesn't exist in my end, would you please update the npm module for it?
image

@kenan238
Copy link
Owner

Hello @DoormatIka, just pushed a new version of the library, had to wait until I added some other new stuff to go along with it.

@kenan238
Copy link
Owner

Hello @michalusio, I'm not sure about writing manual typings, because of how tedious it would be to constantly update the files and I don't have too much time these days, these will have to do for now. The idea of rewriting it in TS has my approval even though it's gonna be extremely tedious, I'll check out other ways to automate that however

@kenan238 kenan238 reopened this Jan 17, 2023
@kenan238
Copy link
Owner

Hello again, I'm starting the refactor on another branch

@tracker1
Copy link

@kenan238 nice to hear about the refactor, and looking forward to TS... hoping this will let the library work in Deno, as importing with 'npm:reblessed' and trying to run the demo results in an error.

error: Uncaught RangeError: Maximum call stack size exceeded

@kenan238
Copy link
Owner

Cool! I'll fix up the base lib and go on with the refactor

@zyriab
Copy link

zyriab commented Aug 24, 2023

@kenan238 Do you need any help with the TS refactor? I'd be happy to help if I can!
Thanks for keeping this lib alive, btw

By the way, have you seen this @types package?
There seems to be problems with your actual TS port (I can't get it working with ESM, for example) that don't exist with this implementation.

@kenan238
Copy link
Owner

kenan238 commented Jun 1, 2024

It'd be handy if you could help since I have been bombarded with exams and I am itching for summer to arrive.

@zyriab
Copy link

zyriab commented Jun 1, 2024

Hey, I got too much work so I can't help.
I tried to rewrite the lib in TS using modern syntax (class, const, etc) as well as refactoring in general but it's really a lot of work and the original code was written in such a way that it's often not obvious what was the author's intent.

To reduce the amount of work I suggest writing d.ts files and adding JSDoc comments here and there in the source but I'd avoid rewriting everything because it would need some reworking on the architecture, etc if you really want to go full in.

Anyway, good luck :)

@kenan238
Copy link
Owner

kenan238 commented Jun 2, 2024

That's what I thought, the original library is such a mess, I'd like to look into re-writing it during my free time

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

5 participants