Reviews run for a minimum of one week. The outcome of the review is decided on this date. This is the last day to make comments or ask questions about this review.
N4JS is an extension of ECMAScript providing a sound type system. It provides a transpiler to translate N4JS files to plain ECMAScript. The N4JS IDE enables the authoring of JS and N4JS files, providing tool support analogous to that of best-of-breed Java IDEs, e.g., Eclipse JDT.
N4JS adds a static type system similar to that of Java to ECMAScript 2015. This type system support nominal and structural typing, in both cases supporting generics similar to that of Java 8. In order to capture details specific to ECMAScript,additional constructs are introduced such as union types, 'this' type, and special forms of structural types. Additional concepts required for larger projects are built in, e.g., dependency injection, test support, and various component types.
N4JS provides an extensible framework for representing and manipulating JS and N4JS files.Based on this framework, it provides integrated, extensible tooling that supports instantaneous validation, content assist, and quick fixes, as well as launch support for running the code and associated tests.
The N4JS IDE is based on the Eclipse platform and uses many associated Eclipse technologies, in particular Xtext. Not only does it provide a Java-based ECMAScript 2015 parser, it also produces EMF-based models for both the abstract syntax tree (AST) of JS and N4JS as well as the type model of N4JS. This makes it an ideal basis for implementing a host of interesting tools to analyze, maniuplulate, and transform JS and N4JS.
N4JS aims to build a community of contributors who will help build a powerful, feature-rich IDE.
The initial contribution consists of the N4JS IDE (and a headless version), tests, and a small ECMAScript runtime library. The code base consists of approximately 8,000 files. The pedigree of the code is as follows:
- The majority of the code is written either by NumberFour employees or by consultants working for NumberFour. This copyright holder for this code is by NumberFour AG.
- The ECMAScript test suite (github.com/tc39/test262, BSD License) in two versions (for ECMAScript 5 and ECMAScript 2015). For performance reasons, parts of these tests suits are archived and included in the test sources.
- The built-in ECMAScript APIs including some of the documentation have been copied from the ECMAScript 5 and 2015 (ed. 6) specification (ecma-international.org/../Ecma-262), License
The code has the following dependencies, which are to be resolved during build and run time:
The project is already using a build process similar to the one used by Eclipse projects, so it should be possible to quickly set up the Eclipse project with a nightly build once the project gets approved and the initial contribution as gone through the due diligence process.
The current version is already stable and has been in production mode internally for over a year. Fixing bugs and adding minor improvements are on going work, of course. Additionally, the following topics are expected to be addressed:
- Improved UI experience, in particular customized content assist as well as more quick fixes.
- Improved ECMAScript 2015 support.
- Improved type inference.
- Improved refactoring capabilities.
- Improved node.js developer experience, e.g., support for browser-based projects.
Although tooling only supports N4JS and plain ECMAScript at the moment, it should be possible to also provide support for other ECMAScript typing approaches such as TypeScript in the future. Whether this is added or not depends on the community feedback and involvement.