浏览器中的WinJs?

发布于 2024-12-04 17:17:50 字数 205 浏览 5 评论 0原文

在试用了新的 Visual Studio 11 预览版后,我认为最有趣的问题是如何使我的新的基于 javascript 的应用程序也可以在浏览器中运行,并且只需进行最小的更改?这可能吗?我认为支持 javascript 的想法是为了更好的跨平台应用程序,对吗?

我了解一些 winJs 代码调用 WinRT,但是我们也可以在基于 Web 的应用程序上使用一些 WinJS 代码吗?

After playing a bit with the new Visual Studio 11 preview, I think the most interesting question is how can I make my new javascript based app run also in the browser with minimal changes? is that possible? I suppose the idea of supporting javascript is for better cross-platform apps, am I right?

I understand some of the winJs code calls the WinRT, but can we use some of the WinJS code on web-based apps too?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

俯瞰星空 2024-12-11 17:17:50

我在这里进行构建,根据 Microsoft 人员的说法,WinJS 确实会调用 Windows RT。另外,他们的一些东西是基于一些供应商前缀 css 的东西(即仅限 IE10)。所以简短的回答是否定的,你不能。

更多的想法。
需要明确的是,从现有的 Html/Js 应用程序到 Win8 应该可以正常工作。 Win8 App事件的一些注意事项,以及外观和感觉是一些需要关注的问题。但核心应该可以工作。

最初的问题无异于“我有一个 IE9 HTML5/Js 应用程序,我想在任何地方运行(包括 IE6、FF2),这可能吗?”他们的库中有很多功能,并且利用了新的 CSS3 功能(-ms-grid、-ms-float、3d 变换)。据我所知,他们所有的手势识别功能都在 winRT 中,为了实现“快速且流畅”的响应能力,你无法在 Metro 环境之外真正使用这些功能。

在我看来,之所以支持win8 Metro风格的应用程序,并不是因为跨平台应用程序,而是为了增加可以编写win8应用程序的开发者基础。

I'm here at build and based on what the Microsoft guys have said is that WinJS does call into the Windows RT. Plus some of their stuff is based on some vendor prefix css stuff (ie IE10 only). So short answer is no, you can't.

More thoughts.
To be clear, going from an existing Html/Js app to Win8 should just work. Some considerations of the Win8 App events, and the look and feel are some issues to be concerned about. But the core should work.

The original question is not to dissimilar than, "I have an IE9 HTML5/Js app that I want to run everywhere (including IE6, FF2), Is it possible?" There is a lot of functionality in their libraries, as well as there leveraging of new CSS3 features (-ms-grid, -ms-float, 3d transforms). As far as I know, all their gesture recognition stuff is in the winRT, for "fast and fluid" responsiveness, none of that you can really use outside the Metro environment.

In my opinion, the reason why win8 Metro-style apps is being supported, is not because of cross-platform apps, but to increase the developer base on who can write win8 apps.

断爱 2024-12-11 17:17:50

似乎事情已经发生了变化。 WinJS 已在所有平台上可用...您可以在此处的浏览器中尝试:try.buildwinjs.com

WinJS 现在实际上已经开源了:博客, github

使用这个强大的 Windows 开发框架跨 Windows 之外的各种浏览器和设备(包括 Chrome、Firefox、Android 和 iOS)构建高质量的 Web 应用。

It seems like things have changed. WinJS has become available on all platforms... You can try it in the browser here: try.buildwinjs.com

WinJS is actually being open source now: blog, github

Use this powerful Windows development framework to build high-quality web apps across a variety of browsers and devices beyond Windows, including Chrome, Firefox, Android, and iOS.

欢你一世 2024-12-11 17:17:50

是的,这是通过 lightswitch html 组件完成的。

您可以下载并安装 lightswitch 来查看使用 winjs 跨浏览器的示例。它使用 Promise 对象等。

Yes, this is done in with lightswitch html components.

You can download and install lightswitch to see examples of using winjs cross browser. It uses promise objects etc.

や莫失莫忘 2024-12-11 17:17:50

winjs 有一个替代方案,应该可以在浏览器中工作: http://www.bluesky.io/ 没有'不过还没有尝试过。

There is an alternative to winjs which should work in browsers: http://www.bluesky.io/ didn't tried it yet though.

顾挽 2024-12-11 17:17:50

如果您正在编写游戏,这是可能的,您可以轻松地将它们在 Metro 应用程序和 Web 应用程序之间移植,而无需更改代码字母。这是因为您没有真正使用 WinJS 库。

对于 Web 应用程序,我不建议这样做,因为这意味着您无法使用 WinRT 框架。这也意味着您会失去很多功能。例如搜索和分享魅力。这些本质上适用于 Metro 应用程序,但在 Web 应用程序中没有用处。

WinRT 框架还针对性能进行了优化。因此建议您使用它而不是像 jQuery 或其他框架这样的框架。可能会更慢。

您必须问自己的另一个问题:如果您可以为网络编写它,为什么要将其变成 Metro 应用程序?那有什么价值呢?

我想说的最后一点是:Web 应用程序(目前)旨在在线工作。使用 Metro 应用程序时,您需要记住该应用程序也需要离线工作。这意味着额外的抽象。

就像安德烈在他的回答中提到的那样。 HTML5/JS 仅提供了一种开发应用程序的额外方法。微软只是让更多的人能够用他们熟悉的语言编写应用程序。

If you are writing games this would be possible, you can easily port them between a metro app and a web app without having to change a letter of code. This is because you don't really make use of the WinJS library.

For web apps I wouldn't advice it, because this would mean you can't make use of the WinRT framework. It would also mean you loose a lot of functionalities. For example what with search and share charms. These are essentially for a Metro app, but have no use in a web application.

The WinRT framework is also optimized for performance. So it is advised that you use that instead of a framework like jQuery or an other framework. The would probably be slower.

An other question you have to ask your self: If you can write it for the web, why would you want to turn it into a Metro app? What would be the value of that?

A last point I want to make is the following: Web apps are (for now) intended to work online. When working with a metro app you need to keep in mind that the application needs to work offline as well. This means an extra abstraction.

Like Andre mentioned in his answer. HTML5/JS only provides an extra way to develop an application. Microsoft just made it possible that more people could write apps in the language they feel familiar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文