SINTEF-9012 / PruneCluster

Fast and realtime marker clustering for Leaflet
MIT License
552 stars 131 forks source link

Should we rewrite the library in JavaScript? #79

Open fungiboletus opened 8 years ago

fungiboletus commented 8 years ago

The library is written in TypeScript. TypeScript is a superset of JavaScript adding strong typing and other features such as classes and interfaces.

When I started the development, TypeScript was brand new and promising. 1 year later, it is not very popular in the JavaScript community. I think ES6 with tools such as Babel have reduced the interest in TypeScript. It still has types, but bug reports demonstrated that the library needs to check everything during runtime anyway.

I personally like TypeScript and I think the code completion and type checking features are pretty neat when used inside VisualStudio with Leaflet's DefinitelyTyped definitions. But even though it's very light and close to ES6's syntax, it's a different language with a low popularity.

The conversion from TypeScript to ES6 (with Babel or equivalent for backward compatibility) can be considered.

itbeyond commented 8 years ago

I think the library is excellent and I for one would be happy to add extensions and update like my new Layer Switch that applies filters to prunecluster. I have never even looked at TypeScript so have no idea how hard a conversion, the source it creates in JS is not unreadable. I will be using this library and think it is well worth moving forward.

MarcBanc commented 8 years ago

I think that TS have more pros than cons so i am against it. It is well maintained and gives many more every new release. Personally i cant think about writing again in vanilla js :-) His time to shine is about to start when Angular2 become to be widely used.

turbobuilt commented 8 years ago

I think it would be worthwhile - it makes it easier to make changes. That in turn makes it easier to do pull requests with modifications I have made in plain JS.

w8r commented 8 years ago

First of all - great library, superb performance! We can do it using ES2015 + some type checks. Anyway, not to offend anyone, the C# code style is very confusing and not compatible with Leaflet core code.

+1 for rewrite, can invest some time into a PR

turbobuilt commented 8 years ago

Just a note: I read somewhere that AngularJS 2 is being written in TypeScript. So I don't know if that can make TypeScript popular, but at least one significant project is using it.

fungiboletus commented 8 years ago

Yes Angular 2 is written in TypeScript and the language looks more and more popular. However it's still a small community compared to JavaScript.

A solution might be rewriting the code in JavaScript using Leaflet coding style this time, but also maintaining a TypeScript definitions file.

kasparsklavins commented 8 years ago

I support the idea of rewriting it to ES2015. Typescript releases are far to common for IDE's to keep up.