聚合物元素不适用于最新的 GWT2.8 SNAPSHOT

Polymer Elements don't work with latest GWT2.8 SNAPSHOT

最新的 GWT 2.8 SNAPSHOT 似乎已经删除了对 -XjsInteropMode 标志。人们早就知道会发生这种情况。新旗帜是 -generateJsInteropExports。但是,Polymer 似乎并没有意识到这一点。我得到了一大堆:

[INFO]          [ERROR] Errors in 'jar:file:/C:/Users/ntroncoso/.m2/repository/com/vaadin/polymer/vaadin-gwt-polymer-elements/1.2.1.0/vaadin-gwt-polymer-elements-1.2.1.0.jar!/com/vaadin/polymer/iron/event/IronActivateEvent.java'
[INFO]             [ERROR] Line 36: JsProperty cannot be resolved to a type
[INFO]             [ERROR] Line 31: JsProperty cannot be resolved to a type
[INFO]             [ERROR] Line 16: JsType cannot be resolved to a type
[INFO]             [ERROR] Line 22: JsProperty cannot be resolved to a type
[INFO]             [ERROR] Line 25: JsType cannot be resolved to a type
[INFO]             [ERROR] Line 11: The import com.google.gwt.core.client.js cannot be resolved
[INFO]             [ERROR] Line 10: The import com.google.gwt.core.client.js cannot be resolved

更换标志后。我还需要为 Polymer 做些什么来找到 jsInterop 东西吗?

这个变化是不可避免的,所以说切换到 2.7 或更早的 2.8 版本不是一个合适的解决方案,除非我只需要等待 Vaadin 更新他们的结局。有可用的聚合物快照存储库吗?

在进一步挖掘之后,我找到了一个临时解决方案,方法是:

https://github.com/vaadin/gwt-polymer-elements/issues/74

使用来自 manalo 的冻结快照,构建了我的项目。您需要将其添加到 Maven settings.xml:

<repository>
    <id>gwt-snapshots-tmp-repo</id>
    <url>https://github.com/manolo/gwt-snapshot/raw/master/</url>
    <snapshots><enabled>true</enabled></snapshots>
    <releases><enabled>true</enabled></releases>
</repository>

并将您的 GWT 版本更改为 2.8.0。VC-SNAPSHOT。

根据这个问题:

https://github.com/vaadin/gwt-polymer-elements/issues/66

https://github.com/vaadin/gwt-polymer-elements/issues/86

即将发布 gwt-polymer-elements 版本来解决此问题。

在我的例子中,在尝试将 vaadin 聚合物包装器版本 1.2.3.0 与 gwt 2.7 一起使用时出现错误。

即使将 jsInterOp 设置为 JS,编译也没有工作。

切换到 gwt 2.8.0-beta1,gwt:compile 任务终于成功处理了: 导入 jsinterop.annotations.JsType

在com.vaadin.polymer.paper个元素中。

检查您的 gwt 版本(即编译器)与 Web 组件库之间的兼容性。