7

我试用了 GWT 2.7 并且想知道 -XjsInteropMode JS 和 -XjsInteropMode CLOSURE 编译器标志之间的区别是什么?

4

1 回答 1

7

-XjsInteropMode JS 将输出标准去混淆的 javascript 访问器(方法名称直接匹配,bean getter/setter 映射到简单的属性访问)。我假设使用 CLOSURE 选项会将 Closure 类型注释添加到输出中,以确保 Gwt 和 Closure 之间的双向类型安全......但 Goktug 在 G+ 上回复说:

-XjsInteropMode CLOSURE was used to generate export code in a way
that was assuming closure goog.provide(...) statements exists in
the beginning of js (potentially produced and prepended by a linker).
It was not useful for general public.

I'm using past tense because the option is now removed from the trunk.

无论如何,如果您对 Closure with Gwt 感兴趣,视频还没有上架,但是 Ray Cromwell 关于 Google Inbox 的演讲提到了它们如何支持 Gwt -> Closure Friendly JS -> Minified obfuscated JS 的高度优化、快速编译。

视频播放完毕后,请在此处查看: http ://gwtcreate.com/videos/index.html 在此之前,请 查看幻灯片: https ://drive.google.com/a/wetheinter.net/file/ d/0B3ktS-w9vr8IS2ZwQkw3WVRVeXc/查看

最后,Ray 专门讲讲 Js Interop: https ://docs.google.com/a/wetheinter.net/file/d/0ByS1wxINeBWjeGYxbkJpamxFZ28/edit

请注意,该演讲还有一个视频待定。这很好。上传时,您应该同时观看它们。

于 2015-02-12T23:43:02.083 回答