Skip to content

Commit

Permalink
Merge pull request #54 from vaadin/JS_RC
Browse files Browse the repository at this point in the history
support both JS & JS_RC modes
  • Loading branch information
tehapo committed Jan 21, 2016
2 parents d8ba970 + e11430b commit a195903
Show file tree
Hide file tree
Showing 25 changed files with 372 additions and 220 deletions.
71 changes: 39 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,59 @@ $ npm install -g vaadin/gwt-api-generator
```
> If you've installed node and npm using `sudo`, installing packages globally will also require you to use `sudo`. See [http://givan.se/do-not-sudo-npm/](http://givan.se/do-not-sudo-npm/) how to remedy the situation.
- Generating the resourcer for bower packages installed in your bower_components folder
```shell
$ bower install my-web-component
$ gwt-api-generator
```
- Generating the resources for a library
```shell
$ gwt-api-generator --package=PolymerElements/paper-elements
```
- Generating the resources with a custom groupId and artifactId
```shell
$ gwt-api-generator --package=PolymerElements/paper-elements \
- Generating java code for bower packages installed in your bower_components folder

```shell
$ bower install my-web-component
$ gwt-api-generator
```
- Generating java code for a complete library

```shell
$ gwt-api-generator --package=PolymerElements/paper-elements
```
- Generating resources with a custom groupId and artifactId

```shell
$ gwt-api-generator --package=PolymerElements/paper-elements \
--groupId=com.foo --artifactId=bar
```
- Generating the resources for a non-maven structure
```shell
$ gwt-api-generator --package=PolymerElements/paper-elements
--javaDir=src --resourcesDir=src
```
- Packaging the result as a ready-to-use jar file
```shell
$ gwt-api-generator --package=PolymerElements/paper-elements --pom
$ mvn package
```
```
- Generating resources for a non-maven structure

```shell
$ gwt-api-generator --package=PolymerElements/paper-elements
--javaDir=src --resourcesDir=src
```
- Generating maven `pom.xml` file and packaging the result as a ready-to-use `.jar` file

> Bower can be configured by placing a `.bowerrc` into the folder where `gwt-api-generator` command is run.
```shell
$ gwt-api-generator --package=PolymerElements/paper-elements --pom
$ mvn package
```

## Pre-built packages

### Paper and Iron elements
### Paper, Iron and Vaadin-Core elements

Vaadin officially maintains and supports a pre-built package deployed at Maven Central repository containing all the resources needed for using Polymer [paper-elements](https://elements.polymer-project.org/browse?package=paper-elements) and [iron-elements](https://elements.polymer-project.org/browse?package=iron-elements) in a GWT application.
Vaadin officially maintains and supports a pre-built package deployed at Maven Central repository containing all the resources needed for using Polymer
[paper-elements](https://elements.polymer-project.org/browse?package=paper-elements),
[iron-elements](https://elements.polymer-project.org/browse?package=iron-elements) and
[vaadin-core-elements](https://vaadin.com/elements)
in a GWT application.

Build script, demo and usage instructions for the project are available [here](https://github.com/vaadin/gwt-polymer-elements).

### Vaadin elements
You also might see all these components in action using the [Show Case](http://vaadin.github.io/gwt-polymer-elements/demo/) application

Comming soon.

## About GWT 2.7/2.8 compatibility

Vaadin gwt-api-generator produces `@JsType` interfaces for JS Element level access from Java Objects.
Generated classes are written using Java 1.7 syntax, and rely on GWT JSInterop available as an experimental feature from GWT 2.7.0.

Notice that even though the generated code is GWT 2.7 compatible for now, it's recommended to use GWT 2.8-SNAPSHOT for better stability.
Generated classes are written using Java 1.7 syntax, and rely on GWT JSInterop available as an experimental feature from GWT 2.7.0, and will be stable in GWT 2.8.0.

But, starting with gwt-api-generator 1.2.1, GWT 2.7.0 is not supported anymore since the experimental version of jsInterop in 2.7.0 does not support JsFunctions.

Produced interfaces don't currently utilize the full GWT 2.8 JSInterop API. For example `@JsFunction` is replaced by generic JavaScriptObject parameters leaving the responsibility of wrapping callbacks to the developer.
Additionally JsInterop has suffered a complete API change in 2.8.0, so old syntax will be deprecated and remove.

The plan is however to support `@JsFunction` among other JSInterop features in future releases so consider GWT 2.7 support deprecated at this point.
So, will encourage to make your project depend on GWT 2.8.0-SNAPSHOT and use new JsInterop syntax.
Loading

0 comments on commit a195903

Please sign in to comment.