GWT vs打字稿 [英] GWT vs typescript
问题描述
在GWT vs javascript上有很多帖子,但是我无法在GWT vs typescript上找到任何信息。
我在Java中有大约20,000行代码,我需要移到浏览器客户端。但是,如果我走这条路线,那不仅仅是在GWT中重新编译。我需要删除的代码中引用了一堆对象(现有的代码是一个更大的程序的一部分)。
另外,一些底层类正在被广泛使用的正在改变。这不是一个很大的改变,但是这些课程在很多地方都有使用。所以这是真正的重写。如果我得到GWT,重写会更平滑一些,但仍然是重写。
这段代码也没有GUI或I / O组件。它在客户端被javascript调用,仅用于处理JavaScript代码创建和使用的JavaScript对象。
这导致我的问题。 GWT vs typescript有哪些优缺点?
解决方案 如果我正确理解你,你想运行 Java
以前在没有GUI的浏览器中的Server / Java Applet上运行的代码。
我没有使用 最大的优点是可以测试大部分代码在普通Java中。只有那些需要仿真的类必须在浏览器中进行测试。您可以使用 最近举行的 GWT.create 会议也突出显示对 可能 There are a number of posts on GWT vs javascript but I couldn't find any on GWT vs typescript. I have about 20,000 lines of code in Java I need to move over to the browser client. However, it's not just recompile in GWT if I go that route. There's a bunch of objects referenced in that code that I need to remove (the existing code is part of a much larger program). In addition, some low-level classes that are widely used are changing. It's not a big change but these classes are used in a lot of places. So it's really a rewrite either way. A bit smoother rewrite if I got to GWT, but a rewrite nonetheless. This code also has no GUI or I/O component. It's called by javascript on the client and is used solely to process the javascript objects created and used by the javascript code. Which leads to my question. What are the advantages and disadvantages of GWT vs typescript? Well if I correctly understand you, you want to run I haven't used The biggest advantage is that most of your code, can be tested in "plain Java". Only those classes that need emulation have to be tested in the browser. You can use The recently held GWT.create conference highlighted also some interesting future improvements to Possibly 这篇关于GWT vs打字稿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! Typescript
,所以我会强调 GWT
(可能其中一些也适用于
Typescript
):
Java
代码,所以 GWT
是一个很自然的选择(使用 Typescript
你必须重写所有内容)。
浏览器
中不起作用的类和包。这是巨大的,因为你最终会得到或多或少能够在浏览器,服务器,Java应用程序等上运行的代码库。例如,新的谷歌驱动器电子表格(web应用程序,Android应用程序等)是使用这个技术。
树状结构
,因此您所玩的成本仅限于您真正使用的成本
SuperDevMode
和 SourceMaps
直接在浏览器中进行调试。
GWT
的一些有趣的未来改进。
有计划优化编译器,以便它生成为javascript引擎优化的javascript代码(对象布局等)。
还有一些想法可以使用键入数组
,这会使性能受益,特别是对于计算密集型任务。
GWT
可以指定 asm.js ,它可以为你提供原生的表演。Java
code that was previously run on the Server/Java Applet in the browser without GUI. Typescript
so I will highlight the advantages of GWT
(maybe some of them also apply to Typescript
):
Java
code, so GWT
is a naturally fit (with Typescript
you have to rewrite everything). Browser
. This is huge because you will end up with more or less one code base that's capable of running on Browsers, Servers, Java Apps, etc. For example the new google drive spreadsheet (web-app, Android app, etc) is built using this technique. tree-shaking
and thus the cost you play is only for what you really useSuperDevMode
and SourceMaps
to debug them directly in the browser. GWT
.
There are plans to optimize the compiler so that it produces javascript code that is optimized for the javascript engines (object layout, etc).
There are also some ideas to use typed arrays
which would benefit performance, especially for computational intense tasks. GWT
could target asm.js which could give you native like performance.