PruneCluster icon indicating copy to clipboard operation
PruneCluster copied to clipboard

Should we rewrite the library in JavaScript?

Open fungiboletus opened this issue 8 years ago • 7 comments

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.

fungiboletus avatar Jul 24 '15 11:07 fungiboletus

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.

itbeyond avatar Jul 27 '15 00:07 itbeyond

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.

MarcBanc avatar Aug 03 '15 13:08 MarcBanc

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.

turbobuilt avatar Aug 19 '15 20:08 turbobuilt

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

w8r avatar Sep 14 '15 07:09 w8r

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.

turbobuilt avatar Sep 18 '15 07:09 turbobuilt

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.

fungiboletus avatar Sep 18 '15 08:09 fungiboletus

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

kasparsklavins avatar Jun 09 '16 06:06 kasparsklavins