Office365并不是完全基于JavaScript重写的,只是用来构建UI界面


发布者 ourjs  发布时间 1528938898969
关键字 大话编程  分享 
最近有各大程序员网站都在转载一篇文章,微软的项目经理Sean 在Twitter上表示, Office 365正在使用JavaScript重写,以此来回应,C++委员会主席曾发表的“脚本语言作为使用量最大的CS编程语言是一种错误“的言论。

不过之后 Sean 又在 Reddit上发表了一则补充说明:

Hi there!!! Original Tweeter here! I'm Sean and I'm a Program Manager at Microsoft working on Microsoft Edge and Edge Dev Tools!

Going to clarify across a few things. Some was lack of more then 280 chars in a tweet and not expecting this to get beyond #JavaScript twitter.

  1. MS Teams, VS Code, is already written _with_ TypeScript which is compiled to JavaScript powered by Electron. It is an electron application. VS Code is on GitHub and Open Source if you'd like to see examples of how or what.
  2. We are not abandoning C++, C#, or any of the other awesome languages, apis, and toolings that we use across Microsoft. EdgeHTML is almost entirely written in C++ like any other browser engine. However we do also run JavaScript (compiled from TypeScript) in DevTools, and leverage open source technologies like React and webpack to build the UI's for them.
  3. Office 365's UI, a lot of it, but definitely not all of it, are pieces that are built using React Native (Windows). API's and Services are still going to be powered by C++, C#, or whatever is the most appropriate for that team. Nothing is converting to "all/completely" JavaScript/TypeScript.
  4. React Native compiling JavaScript to "native code" is arguably wrong. Most of what is native are API's interactions and Native Modules that can be communicated with through JavaScript. WebViews power UI rendering thanks to React. Thanks to the Skype Engineer who sniped me on that in discussion.
  5. Feel free to ask anything else! It's the least I can do for tweeting some pretty unclear messaging. 😅


声明可见,可见 Sean 其实对技术细节并不是很清楚,

微软已经存在一些基于JavaScript构建的项目,比如  MS Team, VS Code这两款产品已经基于 Electron 平台开发。VS Code甚至是开源的,

但微软Office365的后台程序还是使用C++/C#实现的,由此可见,JavaScript只是用来构建Office 365的UI部分。比如桌面版采用 Electron,APP版采用类似 React-Native 与底层的通信接口APP来构建,即复用了以前底层C++的Office处理模块。本质上应该是种基于类似 WebView的混合应用。这样各大平台就有可能尽量复用一套UI界面代码,降低维护成本。



附:
使用Bootstrap、Electron和JavaScript开发桌面应用
NativeScript的竞争者React Native:又一个用JavaScript写原生iOS应用的项目