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

Plans to add types? #8

Closed
orangecoloured opened this issue Jan 28, 2022 · 5 comments
Closed

Plans to add types? #8

orangecoloured opened this issue Jan 28, 2022 · 5 comments

Comments

@orangecoloured
Copy link

Atm a lot of the frontend dev is done using TypeScript.
Do you plan to add types to the lib later on?

@SubZtep
Copy link

SubZtep commented Jan 29, 2022

I came across Hammer.js, whose codebase seems notably larger at first sight. I’m not sure about the difference and used none of it. This code seems quite solid – full of event handling and stuff –, isn’t it possible the TypeScript compiler will try to polyfill snippets that affect performance?

Of course native TypeScript would be best for implementation, but I think generating type definitions from JSDoc (or manually) seems a simpler step.

@biodiv
Copy link
Owner

biodiv commented Jan 30, 2022

Adding types in the future does make sense. I currently like the JSDoc idea as a first step, thanks for the input.

Regarding hammer.js: I have been using hammerjs myself for years until I ran into problems in both performance and recognition (going into detail would result in a very long text and be off topic here). Hammerjs is unmaintained, and I did not see the possibility to solve my issues by creating a fork because of the way hammerjs recognizes input. To put it simply, contactjs relies much more on vector calculations than hammerjs does.

@SE2Dev
Copy link
Collaborator

SE2Dev commented Jun 15, 2022

@biodiv I've started work on a port of ContactJS that's written in TypeScript, which, of course, includes type information. I've noticed a few potential bugs in the process; perhaps we can merge the projects?

The first pass simply adds types to the existing code and fixes a few internal issues, but the generated types should be compatible with the existing library.

@biodiv
Copy link
Owner

biodiv commented Jun 16, 2022

@SE2Dev that sounds great. I suggest the following:

  • I add you as a collaborator for this repository, which should give you full access
  • the current src folder is preserved for the time being, until the port is complete
  • TypeScript sources go into a ts folder or something

What do you think?

@SE2Dev
Copy link
Collaborator

SE2Dev commented Jun 20, 2022

@SE2Dev that sounds great. I suggest the following:

  • I add you as a collaborator for this repository, which should give you full access
  • the current src folder is preserved for the time being, until the port is complete
  • TypeScript sources go into a ts folder or something

What do you think?

I've already finished the initial version of the conversion, which is available here. There are some additional changes that will probably need to be made in the future, but for an initial conversion it should hopefully be sufficient.

@biodiv biodiv closed this as completed Jul 8, 2022
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

4 participants