Changelog
You can stay informed about new releases and other STJS-related announcements by following us on Google+
Future plans
- import existing Javascript projects in Java (STJS compatible) or at least create the corresponding bridge - (not sure a simple solution exists :) )
- add support for Google Closure compiler (or build a similar tool based on Java obfuscation tools)
- add bridge to Javascript API for mobile phones
3.2.1 (20-Aug-2015)
This is a bugfix release
Generator
- Fixed issue #103: The generator failed to work on Windows due to path/URI issues
Test Helper
- Fixed issue #97: In the case where none of the specified browsers could be configured correctly, all the unit tests would be marked as passed without being run
Bridges
- Huge update on the jQuery bridge (version 1.11.3.bv1). It is now fully up to date with jQuery 1.11.3 and includes a lots of the API documentation as Javadoc
Server
- Fixed the implementation of the Array(List) constructor, it used to always build empty Array instances
3.2.0 (07-Aug-2015)
This release bring several new features: Full webjar support, improved Array bridge and implementation, JavaScript debug mode in the JUnit test runner.
Generator
- Source mapping comment switched from //# to the more recent //@
- Fixed issue #66: The code for inner classes annotated with @STJSBridge is no longer generated
- Fixed issue #94: Allows methods annotated with @Template("toProperty") in object litterals
Maven plugin
- Official support for building webjars. Just add <webjar>true</webjar> to your st-js maven plugin configuration
Runtime
- Fixed issue #83: String.contains() now works correctly
- Fixed issue #75: deprecate STJS.typefy() in favor of STJS.hydrate() which is more standard
- Fixed issue #95: Object.getClass() now works as expected
Test Helper
- Dependencies on libraries/bridges using webjars are automatically resolved and included in test cases. Those libraries can be removed from your @ScriptsBefore and @ScriptsAfter annotations
Bridges
- The scripts defined in @ScriptsAfter, @ScriptsBefore of a parent test class are now inherited by subclasses
- Unit tests execute much faster on large projects. Improvements up to 8x have been measured on real codebases.
- All methods of Array and Date are now fully documented. Giving you instant access to the documentation from your IDE.
- Bridges can now depend on webjars. The dependency to .js files that are in webjars can be specified like this: @STJSBridge(sources = {"webjar:/rsvp.js"})
- New JavaScript debug mode that allows the developper the opportunity to set breakpoints in his browsers before running unit tests
- New bridge for RSVP.js
- New bridge for CometD
Server
- Complete re-write of the Array implementation. It now behaves as close as possible to the ECMA-262 specification. If you are sharing some code between your server-side and client-side, this should greatly improve the compatibility of that code.
- JSON serialization for sparse arrays now throws a clear exception. (JSON does not support sparse arrays, but the new Array implementation does)
3.1.5 (07-Jul-2015)
This release brings major performance improvements for the JUnit test runner, as well as a couple of bug fixes and small features
Generator
- Fixed: In some rare cases, the final packed JavaScript file could include classes in the wrong order, creating runtime errors
Test Helper
- The scripts defined in @ScriptsAfter, @ScriptsBefore of a parent test class are now inherited by subclasses
- Unit tests execute much faster on large projects. Improvements up to 8x have been measured on real codebases.
3.1.4 (22-Apr-2015)
This release brings bug fixes and small features
Generator
- Fixed issue #62: @Namespace is ignored on fully qualified static method calls
- Added support for emberjs-style properties via the new @Template("gproperty")
Maven plugin
- Fixed issue #68: Specifying a generatedSourcesDirectory to create a webjar fails the test
- Added an <includeStjsSupportFile> configuration option, to be able to make webjars that don't include stjs.js
Runtime
- Small fixes to the runtime support (stjs.js) so that it is better handled by naive minifiers
- Fixed issue #74: stjs.typefy() method doesn't works good in IE8
Test Helper
- Fixed issue #64: assertNotNull(undefined) is accepted
3.1.3 (29-Jan-2015)
This release brings a lot of improvements in various areas, including: Better support for Java 8 Lambdas and method
references, client-side support for Java annotations, improved control on generated code leading to
better JS library bridging, better sourcemap support, etc...
Versions 3.1.0 through 3.1.2 were private unstable versions.
Generator
- Added the @ServerSide annotation to be able to have server-side only code
- Fixed issue #52: Access to outer scope from lambdas
- Lambdas and method references are now allowed to access the containing object instance as "this".
- Introduced support for @Template annotations on fields (useful to build better bridges for some libraries)
- Pass Java annotations on to the generated code
- Fixed sourcemaps for packed files
- Added the "suffix" template
- @Template now supports simple parameters. This allows declarations like @Template("suffix(Return)") void thenReturn() to be used to generate then(). This is used in the RSVP/Promises bridge.
- @Namespace is now supported at the package level, and applied recursively to all sub-packages (unless overridden by a more specific package or class @Namespace annotation).
- Fixed issue #59: ST-JS Interfaces are not compatible with JsMockito
Maven plugin
- Renamed the maven plugin artifact to "stjs-maven-plugin" from "maven-plugin". This means that it is now possible to easily invoke STJS goals from the command line. For example: `mvn compile stjs:generate`
- Better, less retrictive cyclical dependencies check when using the <pack>true</pack> configuration option.
- Fix issue #54: do not count @STJSBridge classes in the generation
Runtime
- Support reading Java source code annotations at JavaScript runtime using the new STJS.get*Annotation() methods
- Introduced stjs.bind() which is used to provide support for lambdas and method references.
- Fixed issue #51: integer divisions for large numbers returned wrong results.
Bridges
Test Helper
- Use browser caching as often as possible to speed up unit test execution.
- Better error handling and messages
- Fixed issues with HEAD requests freezing unit tests
3.0.3 (17-Aug-2014)
This is mainly a bug fix version notably for the source map part.
Generator
- added stjs-ext to be able to typefy and stringify POJOs based on type description
- fix source maps
- fix wildcard type name
- upgrade guava lib
3.0.2 (02-Jul-2014)
This is a mainly a bug fix version.
Generator
- fix NPE in loops (with cast) and wrong check message with classes extending exceptions (java 7 only)
- fix ClassCastException when using anounymous interfaces within static initializers
- fix Parsing of firefox' stacktrace
- allow to use the GeneratorTestHelper for unit tests in arbitrary packages
- fix run command-line test on linux, fix order of pack files for global classes, source map packing
- Fix NullPointerException when jar file don't have manifest.
3.0.1 (09-Feb-2014)
This is a minor bug fixed related to the refactoring done in the previous version.
Generator
- fix #42 - add Array.$forEach method to avoid clash in Java 8 with Iterable.forEach
- put back check access to forbidden classes
- fix #43 - using stjs and annotation processors
- fix #41 build with Java 7
- fix #40 - java 8 build (but without findbugs)
- fix #36 - allow @Native on methods too
- fix #39, non-jar files found in the classpath of the compiled project
3.0.0 (15-Jan-2014)
This new major version brings the support for Java8, allowing you to use the long expected lambda expressions. Also the method references simplify greatly the development and make
the code even closer to the generated JavaScript code. To use these new functionalities, you simply have to compile your project with a JDK 8. ST-JS uses the right parser for the desired Java version.
To achieve this, the generator was completely re-written and uses the Java compiler's AST features. Now it's also simpler to extend the generator via the @UsePlugin annotation.
Generator
- Support Java8
- Generator plugins
- @UsePlugin annotation
2.1.0 (02-Jan-2014)
The main functionality delivered in the version is the possibility to have overloaded methods and constructors, not only in bridges but also in regular classes.
The implementation is similar to the one in TypeScript, and it sticks to our philosophy to stay as close as possible to JavaScript syntax and capabilities.
So only one constructor or overloaded method with the same name can have a body. The other less generic versions are marked with the keyword native or with the annotation @Native
Generator
- Added the possibility to overload methods (by only having a single non-native method, that's the most generic)
- Added overload for constructors
- Moved many classes/fields/methods from the HTML bridge that actually belong to the JavaScript language itself.
- Moved isNaN from the HTML bridge to JSGlobal
- Added some important constructor methods to JSGlobal. These are useful for doing type conversions in JS.
- Added a set of Abstract operations as defined in the ECMA-262 spec, which will help us implement the correct JS compatible behavior in Java.
- Added the Constructor functions to the Global object. People can now use Array(2) to create a new empty array of size 2.
- fix issue #22 - added the prefix template.
- fix and clean the global scope
- fix issue #27 - the usage of JDK instead of JRE
- fix issue #29 - hexadecimal literals
- fix issue #33 - integer divide and assign
- fix issue #34 - usage of xor operator
- fix #32 - default value for primitive types
- fix varargs type resolution, type variable method resolution
- forbid @GlobalScope innerType, fix numeral literals
2.0.0 (06-Oct-2013)
Starting with this release the bridges are no longer in the main repository. They will have they own independent releases, linked to the release
of the JavaScript libraries they are bridging.
All there are a bunch of examples that were also separated from the main repository here.
Bridges
Generator
- fix issue #21 - problems when packing bridges
- do not copy empty folders
- fixed fully qualified access to GlobalScope object
- Command line tool to use ST-JS without the need of Maven
1.4.0 (11-Aug-2013)
The 1.4.0 release is the last one before removing the bridges from the main project. It's main goal was to externalize the method call templates, to simplify the creation of other bridges.
Here is the list of the changes:
Common
- added static code analysis: PMD, Findbugs, Checkstyle
- remove the site from the repository and put it to st-js.github.io
Generator
- remove the display of file names during compilation - now only the number of the processed files is displayed
- add @Template annotation and the possibility to add custom made method call templates
- fixed #16 - wrong integer division
- fixed #18 source encoding - now configurable from plugin also
Test Helper
- added improved stack trace support for tests by using http://stacktracejs.com
1.3.1 (14-Feb-2013)
Generator
- add exceptions js basic implementation and fix issue #12
- fixed issue #13 - parentheses around typeof
- fixed issue #10 - use topological order iterator to sort dependencies
- fixed issue #9 - instanceof is handled correctly
1.3.0 (23-Jan-2013)
JQuery/DOM bridge
- added minified version of jquery and jquery ui;
- added the sources of jquery ui (1.8.24)
- issue #6 added originalEvent property to jQuery Event
Test Helper
- Rewrite completely the test driver. Now it runs remote browsers as well as directly the browser in a regular or headless way.
- the location of the config file can now be set via the stjs.test.config system property
- @Test.expected is now supported (with some limitations)
- issue #8: added handling of @Before and @After in test helper
- added @ScriptsBefore and @ScriptsAfter to include scripts for unit tests and deprecate @Scripts
- fix issue #5 - junit assertEquals for double doesn't take into account deltas
- use the sources STJSBridge parameter in test helper;
Generator
- Generate static initializers correctly, and make sure that their local variables don't bleed into the global scope - Support running the main method from @GlobalScope classes.
- Global scope fields and methods are now handled correctly.
- Do not attempt to generate abstract methods in JS
- added stjs.trunc() around for integer casts and integer divisions
- Properly name constructors of inner types and anonymous classes. This makes debugging in the browser easier because modern browser will use the constructor.name property as type name for all objects.
- Fixed instantiation of Anonymous types
- Do not allow javascript keywords in namespace declarations.
- stjs.ns() statements were not generated when the annotation was placed on Enums.
- Changed the approach on how to do a proper stjs.extend again. We now use an initializer function instead of two initializer object. The new way is more flexible, and looks cleaner too.
- Discovered a problem when a static field is initialized with the value of another static field in the same class.
- skip package-info.java when processing
- fix namespace declaration with extends
- finished to packaging of jar and war and added maven integration tests for that
- fix bug: empty constructor does not call super constructor
- added the copy-js plugin goal that copies the resources to the war file
- added the possibility to pack files in one big file containing all project's js files (correctly ordered)
- put the note you need at least java 6 in the documentation (as per issue #3)
- no longer generate == for x.equals(y), but leave it as is. Added equals only for basic types: Number, String and Boolean.
- Add the equals(Object) method to all stjs base classes that do not override it. This allows .equals() in Java to be translated to .equals() in JavaScript without causing trouble.
- Rolled by the changes that generates "===" and "!==" as a translation for "==" and "!=". This is not backwards compatible, and causes all sorts of problems due to the fact that "undefined == null" and "undefined !== null" are both true.
1.2.3 (18-Jul-2012)
JQuery/DOM bridge
- Document inherits from Node
Generator
- Added @Template annotation for future support of custom Java -> Javascript method conversion. Only @Template("none") is supported for the moment that leaves the code as-is for special methods
- fix - throw exception when a dead code is detected - the .class of one or more anonymous inner classes is not found
- fix equals method when using interfaces
- fix maven plugin filter to include .java only
- added static initializer
- added minimal source map support
Server
- fix: ArrayImpl.concat did not included the elements of this array in the resulting concatenated array
1.2.2 (18-Jul-2012)
Buggy version - please ignore it
1.2.1 (21-Mar-2012)
Test Helper
- fix dependencies order
- more style test console
- added url attribute to @HtmlFixture
- added the possibility to refer stjs libs (war or jar) from the unit tests. keep only absolute or url scripts in tests
JQuery/DOM bridge
- added offset methods
- added extends methods to GlobalJQuery, fix close stream test driver
- fix jquery.ajax return type
- fix Enum.valueOf, fix Element.offsetParent
Generator
- throw mojo exception
- check final variables used in inner loops
- fix generic types with parameterized type fields
- check if $maps keys are literals
General
- added jetty:run for examples
1.2.0 (15-Jan-2012)
- improve test helper performance
- improve parseJSON performance
- add Javascript compatibility functions for Strings and Numbers.
Array.indexOf (inexistent in IE7 was left out because of potential problems with existing code that iterates on arrays that may break)
- improve Eclipse integration - better error reporting
- add automatically hasOwnProperty for array iterations
- add namespacing - @Namespace annotation
- change return type of jQuery.attr to Object instead of String
- added @SyntheticType annotation (instead of @DataType) and handle annotated types better
- added $js(javascriptCode) to output directly a Javascript code
- fix ClassUtils NPE (thank you özhan)
- improved jQuery API to be able to build jQuery widgets using ST-JS (example coming soon)
1.1.4 (13-Dec-2011)
- added verification that parent classes don't contain the same fields/methods
- fix vararg method with null bug
- changed some jQuery callbacks from Runnable to Callback1 (using THIS parameter)
- added "type-safe" JSON parsing
- added Javascript function annotation to mark interfaces that should be treated as Javascript functions
- added Mockjax support, improve test helper
- changed jQuery core interface name to JQueryCore and use JQuery for the jQuery core and the plugins together
- for Javascript compatibility, changed Array iterators to String instead of integer
- for Javascript compatibility, map keys forced to string
- clear BCEL cache in the Maven plugin to correctly handle anonymous classes
1.1.3 (24-Nov-2011)
- added Jackson deserializers for map, array and date
- fixed anonymous type resolution
- changed Maven groupId from org.stjs to org.st-js to comply with Maven central repository requirements
1.1.2 (10-Nov-2011)
- added GSON serializers/deserializers and Jackson serializers for map, array and date
- moved the array and map initializers for both client and server in the shared artifact
- added Console object
- added DOM events
1.1.1 (7-Nov-2011)
- added $prototype, $constructor, $castArray
- forbid usage of Java arrays
- change all callbacks to use the CallbackN classes (removed Runnable, AjaxHandler)
- add sources to maven repository
1.1.0 (1-Nov-2011)
- include a test helper
- major refactoring of the type resolution module
- split the Javascript library in 4 parts: base, shared, server and jQuery
1.0.0 (11-Oct-2011)
Initial release