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

Typescript migrate? #90

Open
xeinebiu opened this issue Nov 15, 2022 · 5 comments · May be fixed by #92
Open

Typescript migrate? #90

xeinebiu opened this issue Nov 15, 2022 · 5 comments · May be fixed by #92

Comments

@xeinebiu
Copy link

Hello.

Just found this library from https://stackoverflow.com/a/73214171 and so far looks very promising.

I wanted to ask, are there any plans to migrate it to Typescript, if yes then I can try to contribute on this part.

Regards.

@rstacruz
Copy link
Owner

Thanks for checking in! Remount should already have TypeScript types available. They're written using TypeScript's Jsdoc syntax.

@xeinebiu
Copy link
Author

Thanks for checking in! Remount should already have TypeScript types available. They're written using TypeScript's Jsdoc syntax.

That has nothing to do with Typescript. These are documentation while Typescript allows us to transpile the code to more targets.

Using this library from React with Typescript requires us to manually declare modules using ``.d.tsas well there are no types on@types/remount` ?

I think you misunderstood what I meant, therefore It makes sense to open the issue again and let someone contribute on this issue.

@rstacruz
Copy link
Owner

rstacruz commented Nov 16, 2022

Using this library from React with Typescript requires us to manually declare modules using .d.ts as well there are no types on@types/remount` ?

Interesting - thanks for this report! This was not the intention at all - there are .d.ts files shipped with the npm distribution (https://cdn.jsdelivr.net/npm/remount@1.0.0/dist/), but it looks like something may be amiss if .d.ts are manually required. The idea was to write Remount in .js files, document it with jsdoc, then use TypeScript to generate .d.ts files from the jsdoc documentation comments.

These are documentation

...apart from being documentation, it's also there for type checking (yarn tsc will run TypeScript type checks with these jsdoc types), and also for generating TypeScript type files.

Granted I haven't had a chance to test this out myself so something might be amiss. Keen to hear any ideas!

@rstacruz rstacruz reopened this Nov 16, 2022
@au5ton
Copy link

au5ton commented Mar 8, 2023

@rstacruz Shipping the .d.ts files is the right idea, but I think it also needs a reference in package.json like "types": "./dist/index.d.ts"

@au5ton
Copy link

au5ton commented Mar 8, 2023

Pull request #92 fixes this.

@au5ton au5ton linked a pull request Mar 8, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants