···
On Wed, Jul 5, 2017 at 9:11 PM, chris.leemesser@gmail.com wrote:
Hello,
Bokeh has been great so far and I am making my first foray into extending it. My javascript experience is limited—years ago I wrote some short web applications using old-school javascript.
My understanding is that modern browsers and nodejs support nice things like classes, super(), and other features.
It’s not that simple. Browsers and node.js support modern javascript (or ecmascript to be precise) to varying degrees. Some more, some less. That’s why we don’t depend on this and write bokehjs in languages that compile to javascript understood by all supported browser. Thus we use coffeescript and are slowly transitioning to typescript. We could write bokehjs in modern javascript, but we would still require a compilation step to generate common javascript. We could use babel for this purpose.
The examples I have seen so far in the bokeh documentation (like at http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html#userguide-extensions)
use Coffeescript, which also has similar nice features, unfortunately with enough differences to be a bit confusing .
So I am left with a question:
Can we use modern javascript features in our extensions?
We could by using babel, but currently it’s not supported, though it’s not hard to implement. However, we support typescript (and currently use a non-strict mode in extensions). Typescript uses modern javascript as its syntactical basis, so given non-strict mode, you can pretty much write modern javascript with it.
Is there a pure javascript version of the above example?
Currently not and I think we don’t have any examples of this kind with typescript or plain javascript. This will change soon, as we are replacing coffeescript across bokeh.
Mateusz
Many thanks
-Chris
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/030b8b37-ef39-49b8-ba3d-b3b2433277e3%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.