Closed orangecoloured closed 2 years ago
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.
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.
@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.
@SE2Dev that sounds great. I suggest the following:
src
folder is preserved for the time being, until the port is completets
folder or somethingWhat do you think?
@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 somethingWhat 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.
Atm a lot of the frontend dev is done using TypeScript. Do you plan to add types to the lib later on?