ES5 coding style

ore code source is written on ES5 style. Is that out of “it’s so because it was developed while ES6 was not there or not supported enough” ?

Could we have a roadmap for ES6 (or later…) conversion? It would involve a lot of automatic testing to be sure to spot anything that would broke. Not a trivial things but I thik it would be worth.

And what about new feature or other things? For instance, if one would be writing a new filter operator for the core edition, would it be required to write in ES5 or could it be in ES6?

Beyond the stytle, the is the functionality. I see some use of map which is ES6 and yet I don’t see any use of the let keyword but only of varand I don’t see either any use of =>but only of function so I am a little bit puzzled about this issue… Where are we really? What are we supposed to do?

1 Like

This is upon core developers to decide…

As a plugin developer, I have already adapt typescript, and it makes calling core API a bit easier. And we will contribute those types to GitHub - tiddly-gittly/TW5-Typed: TypeScript type definitions for TiddlyWiki5. once we have collect enout amount of types.

Core developers have the decision, but they should inform us about it and yet it’s not the case.

As for typescript, I’m not keen about it as last time I checked, it did not have types for functions so how would you specify a function as arguments or variable?

Hi @jypre @linonetwo

Broadly, yes. TW5 was started in 2011 when ES5 was just coming out. We’ve stuck with (roughly) ES5.1 because compatibility with older browsers is useful (eg many Android phones are stuck using older browsers). There’s nothing to stop plugins using more modern language features.

We’ll upgrade the core when the return on investment is worth it, which I suspect will come when ES2018 has a broad installed base.

1 Like

Oh, that will be function aaa(callback: (arg1: number, arg2: string) => void): void {}

thank you @linonetwo for this tip. Have you a useful howto or typescript 101 with that kind of information to share then?

1 Like

Than you @jeremyruston.

But who would you tiddlywiki witg b phone? I tried it but it’s really not very usable because of the screen and of the finger. written too small. A css problem but not only. UI interaction would involve an other logic to be really good.

Anyway, I shall write my code as ES6/2018 with peace of mind thenceforth :slight_smile:

Amazingly, I’ve encountered more than one person whose primary computer is an old-ish Android phone with a Bluetooth keyboard.

1 Like

I primarily read the official doc, and when working on a TS project in my daily job, I learn a lot…

And then they use tiddlywiki? Not just try, but keep using it? It would be amazing, a real testimony of the greatness of Tiddlywiki even in adversial setups!

@linonetwo I read the official doc about function type. All I need is there. Thank you for pointing this to me. I will see to it!!!