JavaScript on Mars

Eclipse Mars and JavaScript Development Tools – how much JS can it handle?

JAXenter Editorial Team
Mars image via Shutterstock

Following the Eclipse Mars release, we spoke to the Eclipse’s JavaScript Development Tools (JSDT) team about the latest possibilities for Eclipse users looking for more JavaScript integration.

JAXenter: Victor, as the project lead of JSDT, can you tell us about the current state of the project – what are the plans for Eclipse Mars and what is the future of JSDT?

Victor Rubezhny, Project Lead JSDT: The guys from IBM who initiated and developed JSDT project, have done great work. But life goes on faster while JSDT development stayed on support for only ECMA3 Scripts. And as JavaScript standard moves forward, we’re facing more and more incompatibilities with the modern JavaScript libraries and applications. So, the first goal is to provide the support for the modern JavaScript standards. The other problems come from the fact that JSDT initially was based on JDT project and has similar editing facilities, so it’s not as simple as to replace the parser. All the editing facilities – validation, content assist, types hierarchy, hyperlinking, searching, outline and so on have – all needs to be changed accordingly. So there’s quite a lot of work to do.

For Mars we are focused on reducing memory consumption, performance glitches and making sure JSDT does work better with never JavaScript libraries and projects.

SEE ALSO: The Top 10 new features in Eclipse Mars

For Mars maintenance releases we hope to be able to provide incubation support for technologies like npm and bower for dependency management and beyond Mars we are looking at allowing JSDT to delegate much of its content assist and validation to external Javascript based tools like Orion, Tern, etc. This will allow JSDT to keep up-to-date with latest JavaScript changes without having to reimplement it in Java.

How many people are working actually on the JS ecosystem in Eclipse?

Victor: Not that many, comparing for example with Platform UI Eclipse’s component. But we have at least partial support from all the ‘old’ committers and project leads (since they all are mostly involved in their current projects). Thanks to Mickael’s work and committers of WTP Releng team we’ve made the project easy to contribute to.

Some other contributors bring their fixes and improvements into the project. Many thanks to them all. But yes, regarding the all improvements we have to do, we are looking for more contributors and hopefully even committers for the JSDT project.

JSDT has a lot of competitors in the field of Java Script Development. Esspecially in IntelliJ IDEA there is rich support for Java Script. Can Eclipse JSDT keep up with them? If yes why, if not please explain why and what are the plans to make the situation better.

Victor: The situation in past for JSDT was really bad–- JSDT was simply taking the wrong approach on handling JavaScript projects. If you look at IntelliJ or Netbeans or even TextMate they do not try and understand all of the project’s JavaScript, just the file you are working on. In JSDT it defaults to parsing the whole project, resulting in bad performance. Also JSDT tries to parse and validate JavaScript which often result in bad error markers and then users feel like JSDT is more of a burden than a help. That’s the worst thing that can happen for a tool.

Making Mars “more sane to work with”

In Mars we wanted to make sure JSDT gets out of the way and does not complain unless there is a good reason for it and that we do not default to parse everything. This should make Mars much more sane to work with.

Beyond Mars we are looking at utilizing projects like Eclipse Orion and Tern to handle the JavaScript parsing and thus be much faster, more correct and much more up-to-date with latest/greatest JavaScript technology (like EcmaScript 6).

Mickael, you also contribute to the JSDT Project – what are your personal goals with JSDT?

Mickael Istria, Release Engineer for JSDT: The goal of my contributions is to make it accessible and efficient to contribute to the JSDT project. I’ve set up an autonomous Tycho build, Hudson, Gerrit, SonarQube and documentation for JSDT so that it’s easier to contribute to the project. That was really missing about a year ago when our team started to get involved in JSDT. JSDT was “just” one component of the big Web Tools project, and it wasn’t clear how to contribute, build and test without working on the whole Web Tools project. JSDT now is a bit more independent and autonomous when it comes to build and contributions. That helps a lot.

As a consequence, it was easier for us (the JBoss Tools team) to incorporate important patches such as the ones for debugger; and I’m pleased to see that this also brought new contributors since some did submit patches via Gerrit in order to remove some flaws in code detected by SonarQube.

Victor, which kind of Ecma Version does JSDT support in which version? Will Mars JSDT support Ecma 5?

Victor: Mars will not support EcmaScript 5 completely. It will tolerate it more than in previous releases. In JBoss Tools we’ve integrated Tern that at least gives you EcmaScript 5 content assist. We only have limited time before Eclipse Mars codefreezes, but we will do what we can.

Why is integration of so important?

Victor: is great project for those who can’t wait for JSDT to begin to support of ECMA5 Script standards. Also it brings content assist and validation support for the wide range of most popular JavaScripts that are widely used by JavaScript developers. The combination of JSDT and may bring such a support right out of the box, so it’s a great project.

What about Nashorn? Can I use JSDT to write JavaScript programs that run on Java 8’s new 8 JavaScript engine? Do I have Content Assist, and is it possible to debug?

Victor: In very minimal approach you can develop JavaScript Programs in terms of Source Editing. But we don’t have a full support for Nashorn yet. So you can’t run or debug your programs using Java 8 JavaScript Engine yet. There is a discussion on the WTP-Dev mailing list around adding debug support for Nashorn and I hope it will result in adding at least minimal support for it during Mars development, but only as experimental feature.

How easy is it to integrate external libraries like tern.js or JQuery or Angular within Eclipse JSDT?

Victor: Not as easy as it should be, but Angelo made great job in Tern for Java. However he’s using JSDT only as a skeleton for his application. He’s using Tern.js that runs in Node.js server and great bunch of so-called Tern.js modules, that once loaded into Tern.js provide content assist and validation support for jQuery, AngularJS and many more well known scripts. Actually this means that he doesn’t need JSDT’s own parsing and validation – ideally they should be just switched off for – he’s only using the JavaScript Editor and different project settings from JSDT (like a project’s source path, for example).

Angular, JQuery and tern.js integration “not as easy is it should be”

There are some other integrations, for example, Philippe Marschall’s jquery-jsdt project, which infers it’s own types/objects for jQuery into JSDT’s model. They are fully integrated into JSDT model, in opposite to Angelo’s project, so they are most interesting from the JSDT point of view.

These different approaches are a challenge to support and we would prefer if we could keep all type of integrations possible, but we will need to make some choices going forward to keep JSDT simple and efficient.

And what about integrations of tools like bower and npm?

Victor: We’re going to integrate a support for node.js/npm/bower tools. We have had a plan to integrate the bower support for Mars, but have faced some issues that didn’t allow us to do that. Now we’re planning to move this integration into WTP incubator and make it available for those who interested and have a time to make it ready to go directly into JSDT.

Most Eclipse Users check the new and noteworthy pages to see what’s new. With WTP and JSTP it’s hard to find any information on what’s new. Are there any plans or ideas to change this in order to be more transparent and to show the community that WTP / JSTP is still alive?

Victor: Yes, for Mars we will make sure the new and noteworthy pages for JSDT is up-to-date. Regarding overall news for WTP and Eclipse, there is ongoing work to try and improve transparency for the Mars release – but this is always up to each projects committers/contributors.

The main source for those who have issues while using JSDT/WTP is Eclipse’s Bugzilla. Sometimes, it’s not easy to find an answer there, but Bugzilla is the direct way to ask a question and get an answer.

Mickael, what is the status of the Web Tools Platform itself? It seems the project is sleeping.

Mickael: The Web Tools project has some activity, with regular public team audio conferences. So the project is definitely not sleeping. However, current contributors don’t have public plans to put much innovation in it and they focus more on maintenance. That’s why from a user perspective, not much has changed.

The Web Tools Platform “is definitely not sleeping.”

Current innovation for Web Tools has happened out of for some time. You can take a look at the various extensions Angelo has on GitHub as example: they really make Web Tools better, but they’re not in Web Tools. Same thing goes for other noticeable plugins. My wish is that the most generic parts of those extensions which are currently “into the wild” join the Web Tools project very soon, so they’ll be included by default with Web Tools to deliver a lot a value to users. Our team dedicates some time “lobbying” with authors of such extensions and encouraging them to work upstream, directly at, in WebTools incubator or JSDT.  I think Web Tools will soon benefit from “new blood” with new committers and more diversity, like it happened successfully for Platform a few years ago.

What are the differences between WTP and the JBoss Developer Tools. Even if I do not write programs for JBoss/Wildfly, do I have benefits using JBoss Developer Tools when I write JavaScript-related stuff or Angular apps that are not running on JBoss?

Mickael: Of course, if you’re using Wildfly, OpenShift, FeedHenry or other JBoss/Red Hat software, you get the benefit of the specific integration that the “vanilla” Eclipse IDE does not provide.

A first noticeable added-value of JBoss Tools over Eclipse IDE + Web Tools is that it’s a consistent set of plugins in a single update-site. Users can just install all JBoss Tools at once and it will enjoy new features without seeing too much “noise” in their IDE. For an even simpler installation experience, users can even use JBoss Developer Studio, which is available as a full RCP application with a trivial installer; no need to care about update-sites nor anything else.

JBoss Tools and JBoss Developer Studio include more extensions for several common Web/Mobile application development use-cases. Easy bootstrapping of projects with JBoss Central, better Jax-RS and CDI tools, Mobile simulators (browsersim), Livereload integration for an immediate feedback loop, great Cordova/PhoneGap tools (as extensions on top of Eclipse Thym), and others.

But more important is that this is not just a collection of tools to support some technologies, those tools are actually linked together in a consistent way which make that JBoss Tools and Developer Studio delivers some more efficient workflows for developers to bootstrap/hack/test/deploy/maintain their applications.

Inline Feedbacks
View all comments