15 ms·
WinJS: the Windows Library for JavaScript
- Xdes 13y agoIt's like XAML for the web. I can't wait to write some SPAs with it.
- spankalee 13y agoYou should check out custom elements and Polymer: http://www.polymer-project.org/ http://www.polymer-project.org/ WinJS looks like another soon-to-be-legacy wrapping framework. It doesn't use Shadow DOM, or allow developers to create new elements, which means that you end up with div-soup and important APIs and state that should be part of the view are in separate objects. Because of this, WinJS will have a hard time interoperating with other wrapping frameworks like Angular, Ember, GWT, Ext-JS, etc. Custom elements and Shadow DOM are hugely important for composable web applications. At this point, for SPAs, I wouldn't use anything that doesn't support them, even at the cost of IE8 support.
- MatthewPhillips 13y agoJust wanted to point out that can.Component[1] is a custom element implementation that does support IE8. [1]http://canjs.com/docs/can.Component.html http://canjs.com/docs/can.Component.html
- spankalee 13y agoUnless I'm reading something wrong, that doesn't look like W3C custom elements ( http://www.w3.org/TR/custom-elements/ http://www.w3.org/TR/custom-elements/ ), but CanJS's own system for recognizing custom tag names, like Angular directives. The docs even say "Currently, this only works within can.Mustache templates." W3C custom elements allow the browser to still parse the document, and when it encounters a tag that has been registered with document.register() it calls user code to create construct element. By having the browser be in charge of parsing and element construction, custom elements work without a framework, and when you modify the DOM via things like innerHtml. Approaches like Angular directives, and I'm guessing CanJS components, usually break down when the DOM is modified outside of certain blessed APIs.
- grrowl 13y agoWeb Components are on their "Watch List" at the end of their roadmap[1], but the language seems to be rather dismissive unfortunately. [1]: https://github.com/winjs/winjs/wiki/Roadmap https://github.com/winjs/winjs/wiki/Roadmap
- jimmcslim 13y agoA finalised Web Components spec and broad browser support cannot come soon enough...
- dragonwriter 13y ago> It's like XAML for the web. Isn't XAML just HTML (declarative markup, with some default behavior, with most behavior defined through linked code in a more-traditional programming language) for the .NET stack? So wouldn't XAML for the web just be HTML?
- bztzt 13y agoAt a very high level, sure.
- tlack 13y agoI know everyone has their reservations about Microsoft and their developer ecosystem, but WinJS really is a delight to use, at least in my limited experience. A WinJS app is really just a zip of a bunch of JS (using WinJS's nice APIs for fancy stuff), CSS, and HTML, so most web developers who are used to the modern tool chain should be pretty comfortable with it. And yes, you can supposedly use it alongside Backbone/Angular/whatever. Worth a closer look.
- yulaow 13y agoI was really surprised for how much they pushed it today, considering that is not strongly adopted in the windows dev ecosystem (maybe also because, since today, it did not work on windowsphone). I am personally happy of this decision, and also for the support announced for other oss.
- nthitz 13y agoTo be honest I've always wanted a file format that is exactly as you described. A zipped up front end web app. No internet dependencies so it works 100%. User can open the open the format and it opens in their browser of choice. All the files contained within are "hosted" from a static "webserver" that just hosts the files within the .zip. I can't say much to WinJS yet, but I am interested in their choice of container.
- bananas 13y agoSounds like a java war file (just add container).
- jholly 13y agoHad no idea the Skype and Music app UI's were built with WinJS. Playing around with the demo's really does pass the eye test. This is really good stuff.
- svas 13y agoHas anyone tried to "port"/augment bootstrap CSS for this?
- taylorbuley 13y agoVery excited for what WinJS's success could mean for IndexedDB. MSFT is a surprise champion of this HTML5 API.
- frik 13y agoIt's still sad that because of Mozilla and Microsoft we have no SQL API in all HTML5 browsers :( http://en.wikipedia.org/wiki/WebSQL http://en.wikipedia.org/wiki/WebSQL IndexedDB is fine for storing JSON objects, etc. but a relational database with SQL query syntax, indexes, etc. more powerful and means less code to write. With IndexedDB one has to reinvent the wheel to just get basic query features.
- _wmd 13y agoThat's because both thoroughly understand the difference between a standard, and picking a random implementation that all other browsers would need to inherit (which was exactly what WebSQL would have led to). Instead we got a kickass asynchronous IO ordered map + secondary indices implementation, which is vastly simpler to describe and implement in a uniform fashion, on top of which one could easily write an SQL parser/planner, or simply use it as a blobstore for a cross-compiled SQLite binary, or whatever else. (Funny how SQLite is about the only SQL implementation that would even be suitable for this. Same reason WebSQL was a bad idea.. it essentially required SQLite's exact semantics)
- frik 13y agoWebSQL is not deprecation, the W3C Working Group Note actually says 'This specification is no longer in active maintenance and the Web Applications Working Group does not intend to maintain it further'. As SQLite is in public domain, no company would "loose their face" if they choose to use it. They could fork off SQLite and change the SQL query syntax (parser) to whatever the W3C finds suitable. Mozilla Firefox and FirefoxOS both already ship SQLite for years and can be accessed by its internal JavaScript API. And several Microsoft products already use it anyway (e.g. Forza Xbox games). Microsoft has of course also various other SQL database libraries like MS Access JetRed (http://en.wikipedia.org/wiki/Extensible_Storage_Engine http://en.wikipedia.org/wiki/Extensible_Storage_Engine ), MS Outlook JetBlue (http://en.wikipedia.org/wiki/Extensible_Storage_Engine http://en.wikipedia.org/wiki/Extensible_Storage_Engine ) and MS SQL Server Express (http://en.wikipedia.org/wiki/SQL_Server_Express http://en.wikipedia.org/wiki/SQL_Server_Express ) the SQL backend originally forked off for WinFS for Longhorn (Vista beta). It would be trivial for Microsoft to choose one of its many SQL engines and add it to IE 12. The same goes for Mozilla (just expose the API). For some reason Oracle and Mozilla pushed IndexedDB. Oracle has conflicting interests, as it owns OracleDB(SQL), MySQL (SQL) and BerkeleyDB (NoSQL and now also SQL support, based on SQLite). Oracle is an official "sponsor" of SQLite development and even ships it as part of it's BerkeleyDB package: http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html http://www.oracle.com/technetwork/database/database-technolo... One can speculate that a less powerful HTML5 API translates in the long run to more SQL server licenses for Oracle and Microsoft. If the web app devs cannot do the processing & storage on the client side, one has to do it on the server side. Anyway, I hope that we get a SQL API for HTML 5.x that also Mozilla and/or Microsoft implements. As of now WebSQL works fine in webkit based browser which includes Safari, Chrome, Opera and includes also 95% of all smart phones.
- cl8ton 13y agoWe have been developing Lightswitch SPA Apps with VS2013. WinJS is at the core of Lightswitch development coupled with JQueryMobile.
- subb 13y agoShould this be used for "standard" desktop application? Like building the UI for Photoshop for example?
- SchizoDuckie 13y agoWelcome to 2014, where Microsoft web stuff still works best in Microsoft Internet Explorer... They had an actual shot on getting up to par with proper HTML5, with funky ms extensions being optional where absolutely neccessary. Instead, they rely on an astounding number of non-cross-browser methods and features, as they have done since '95 https://github.com/winjs/winjs/issues https://github.com/winjs/winjs/issues Most issues listed currently are about stuff that just doesn't work on any other browser/platform than IE Footnote: I'm a web developer myself and I use Windows 8.1. How tempted have I been at fiddling with the winjs flavour myself? not at all. Footnote2: I do have to give them credit for the roadmap though. It seems like they're on the right track https://github.com/winjs/winjs/wiki/Roadmap https://github.com/winjs/winjs/wiki/Roadmap Footnote3: I've been fooled into thinking that Microsoft was on the right track again and again.
- Eyas 13y agoNot entirely fair, considering: (1) these are marked as issues that need to be fixed, and (2) many of them are related to IE implementing the CSS-grid W3C draft, vs. coming up with their own proprietary technologies. (Your comment was modified since I hit reply, but I think my point still stands, especially that it isn't strictly MS-extensions, but actual standard drafts)
- jasonlotito 13y ago"The WinJS is a library of CSS and JavaScript files. It contains JavaScript objects, organized into namespaces, designed to make developing Windows Store app using JavaScript easier."
- nivla 13y agoI did notice some of them only to work in IE since it uses the MS- prefix. However they are also marked as an issues that would be fixed later. So hopefully it be corrected soon but since its already open sourced and the syntax is merely CSS3, its won't be that hard to go ahead and fix it yourself. Working on a project that relies heavily on CSS3, I have come to the conclusion that most browsers still depend on vendor specific prefixes. Take the CSS animation for instance, without the inclusion of "-webkit-", it fails to work in the latest Chrome and Safari while having no issues on Firefox or IE. [1] http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_animation-delay http://www.w3schools.com/cssref/tryit.asp?filename=trycss3_a...
- forgotAgain 13y agoWhy call it Win JS? Is it meant to be Windows only? If not then why give a multi-platform open source library a branded name?
- delinka 13y agoBecause it's full of WIN! (as opposed to fail?) But really, I suspect the name is indeed intended to reflect Microsoft's flagship brand: Windows. They're proud of the brand and I'm sure there's no shortage of misunderstandings within Microsoft about how the public (mainly developers I believe) view the brand.
- renekooi 13y agoThey called it WinJS since the start—it seems this is the same library that's used to build Windows 8 metro apps in JS. They just officially open sourced it now (although you could always access the source, as it was just another dependency for your Visual Studio project) but it's been in use by people from Microsoft and otherwise for quite some time. e; library to build windows apps = WinJS
- elwell 13y agoYeah, reminds me of those JScript windows shell things from ten years ago or so [0]. [0] - http://msdn.microsoft.com/en-us/library/windows/desktop/bb776890(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/bb77...
- velikos 13y agoThe fact that it's branded with Windows makes me hesitant to use it for non-Microsoft environments.
- adlpz 13y agohttps://github.com/winjs/winjs/blob/master/License.txt https://github.com/winjs/winjs/blob/master/License.txt It's Apache 2.0. If it's good right now, there is no reason whatsoever to not use it.
- rbanffy 13y agoI'll be interesting to see if the community adopts it or if all improvements and fixes will have to go through Microsoft.
- delinka 13y agoI find it most interesting that it's on GitHub. MS not moving fast enough for the community? Fork it.
- kibibu 13y agoAgreed. I wonder how the Codeplex team feel about it.
- rbanffy 13y agoConsidering all external signs, I think "feeling" too much about it will be a career-limiting move. I still think most of their stack sucks, but I am quite surprised with this new Microsoft. It'll be fun to compete against them again.
- derefr 13y agoSo, this would basically be Microsoft's Windows-only version of node-webkit[1], then? (I've been thinking the comparison was pretty clear since Metro JS apps first appeared, but now that they're going to be able to be window-ified as well, it's much more stark.) [1] https://github.com/rogerwang/node-webkit https://github.com/rogerwang/node-webkit
- oscargrouch 13y agono. In order to do that, they would have to release the IE html rendering engine (i think they call it Trident) to open-source, and bind it to the nodejs engine.. This(WinJS) is basically a library that wraps UI components in JS, CSS and HTML DOM.. its sugar for baked and easy to use UI components (in theory in any html rendering engine)
- derefr 13y agoI didn't mean implementation-wise, I meant in practice: they're both technologies that allow you to ship a zipped blob of HTML+CSS+JS that presents itself as a program, and has additional native APIs, beyond the regular HTML5 ones, exposed to the Javascript engine.
- oscargrouch 13y ago> has additional native APIs, beyond the regular HTML5 ones I think maybe in windows you have native bindings to windows-specific api's.. but whats is shipped here is only the UI + databindings, mvc voodoo for plain HTML5.. for aditional native api's exposed to the javascript engine, you will need something like node-webkit.. This use nodejs just to compile giving a minified js + css styles.. so it's more like bootstrap or ionic framework
- jessaustin 13y agoHoly crap what's gotten into HN? Like the top five stories are all Microsoft. I'm not complaining, just a bit weirded out.
- afhsfsfdsss88 13y agoWell they are having their annual dev conference right now so you know people are thinking about Microsoft stuff.
- adorton 13y agoMicrosoft is doing a big developer conference this week, and is announcing a lot of new stuff that HN finds interesting. When WWDC rolls around again, I'm sure there will be a ton of Apple stories on the front page.
- AdamTReineke 13y agoToday is the first day of Microsoft's developer conference, BUILD. (There is also a non-trivial number of MS employees who read HN, including me.)
- taternuts 13y agoThese examples are half working in chrome, and not a single one is working for me in IE10.
- elwell 13y agoProminent "View on GitHub" button is really indicative of the progressive changes Windows has been making lately.
- toblender 13y agoWait am I reading this right? Is this Windows' answer to AngularJS? Is this a javascript framework or is this something else?
- adolfojp 13y agoNegative. This is just a tool for creating Metro apps and it has existed since Windows 8 came out. People are talking about it now because Microsoft just open sourced it. How does it compare with AngularJS? There might be some overlap but it is not a competitor. In fact, Microsoft uses AngularJS frequently on their sessions, documents, templates, etc. http://channel9.msdn.com/events/build/2014?sort=sequential&direction=desc&term=angular#theSessions http://channel9.msdn.com/events/build/2014?sort=sequential&d... Edit: It seems like Microsoft is transforming WinJS into a general purpose JS library. https://github.com/winjs/winjs/wiki/Roadmap#the-present https://github.com/winjs/winjs/wiki/Roadmap#the-present
- andwaal 13y agoThis was my thought to. Lots of core component such as data-binding and promises, but they added some ui components in addition.
- adolfojp 13y agoWinJS started out as a tool for creating Metro apps with HTML5 and JavaScript as an alternative to XAML and C#. I don't know if Microsoft is now spinning it as a general purpose web tool but that was not its original purpose. And this has always been explicit. The default ASP.NET MVC template, for example, bundles Bootstrap and jQuery. And if you look at the SPA examples they're all in tools like AngularJS and Knockout. In fact, in one of their build sessions they teach how to create a SPA with AngularJS. As far as I know the ASP.NET team has never used WinJS. So it wouldn't surprise me if this library didn't work great on the web on any browser because it wasn't created for that purpose.
- gum_ina_package 13y agoAt first I thought it was a cross platform app building something-or-another (kinda like Xamarin), but now that I actually am building it and playing around with it I see that it's something else entirely. I'm actually glad this happened though. Seems like MS is finally rallying around C# as the defacto language for building apps (as opposed to Visual Basic or even Visual C++). This project might succeed (or at least find a nitch) among developers who are building touch centric web applications.
- suyash 13y agoI thought Microsoft was working on Typescript as an alternate to pure JavaScript. How does WinJS fit into that picture?
- soAsian 13y agoGo to the link and read about it. It's not for web. It's a way for web dev to create WinStore/Metro apps. Jesus f Christ! 100% of people commenting here don't even fucking bother to read what the fuck WinJs is about before shooting off their mouth.
- _pferreir_ 13y agoHow does that invalidate parent's question? TypeScript compiles to JS. Couldn't MS have developed "WinTS" instead?
- reverius42 13y agoThough I haven't checked, I would guess that WinJS has strongly-typed TypeScript bindings, for those who choose to use TypeScript. But releasing the library itself in JS makes it available to a wider audience and doesn't prevent it from being used in TypeScript.
- rubysucks 13y agoJesus' middle name started with an H not an F
- ismaelc 13y agoJust when I'm excited to jump in to start coding on WinJS, HN comes to the rescue...
- velikos 13y agoI'm surprised they decided to re-implement a lot of the available open source libraries (like WinJS.Promise looks a lot like kriskowal/q). Why re-invent the wheel?
- jenscow 13y agoIt goes against their "not invented here" culture.
- motoford 13y agoAm I the only person who had to come here to the comments to even find out what this library does? The winjs page is just a bunch of buzzwords randomly strung together.
- codeulike 13y agoIts for building Windows 8 apps. Lot of people seem to be misunderstanding.
- VikingCoder 13y agoIt's for building HTML + JS applications that can only run in Internet Explorer. You seem to be misunderstanding.
- dblock 13y agoIssues like https://github.com/winjs/winjs/issues/25 https://github.com/winjs/winjs/issues/25 continue saying that MS is maintaining an internal project and dropping things to Github and then synching back. That's the last mile, the thing that desperately needs to change to gain full credibility within the open-source community. It should only be on Github and all development should be in the open. Disclaimer: I'm ex-msft.
- jdp 13y agoOne thing that isn't clear at all is if it is necessary to use Visual Studio to build a WinJS app. Can I develop and test the app on a MacBook or Linux laptop in a web browser, and only involve Visual Studio when I need to package the app for the store? Or is VS required to even get started?
- dlannoye 13y agoThey have a project file for Sublime Text 3 and are using grunt as a build system so you should be able to use it on a Mac or in Linux. However from their road map it looks like they are still trying to fix a lot things that only work in IE.
- SonicSoul 13y agoi'd love a html wysiwyg editor that supports copy/paste from word.. bummer that's not a part of these controls.
- VikingCoder 13y agoAn example of why this sucks: http://try.buildwinjs.com/default.aspx#toggle http://try.buildwinjs.com/default.aspx#toggle "GitHub issue 9: This control currently works only in IE due to its dependency on IE-only styles ::-ms-fill-lower, ::-ms-fill-upper, ::-ms-ticks-before, ::-ms-ticks-after, and ::-ms-tooltip." Another reason why this sucks, you can even't copy that stupid text from that page in Chrome. /me smashes monitor with keyboard, then ragequits.
- toxik 13y agoI could! `GitHub issue 9: This control currently works only in IE due to its dependency on IE-only styles ::-ms-fill-lower, ::-ms-fill-upper, ::-ms-ticks-before, ::-ms-ticks-after, and ::-ms-tooltip.`
- siculars 13y ago/bias rant/ I'm writing this on a brand new, never used, lenovo thinkpad loaner with windows 7 because my 3yr old macbookpro decided to die. (Took it to apple in NYC, they'll fix it and send it to me in Portland, OR.) I can't begin to describe the awful feeling I have knowing that I have to use windows for the next week. This laptop has already frozen twice while using outlook. It takes forever just to figure out which packages to install to manage mssql server. I'm installing something now and am not sure it's even the right thing. I've already had to reboot several times. Everything Microsoft does is counter intuitive, user and developer hostile and proprietary in some fashion. Just take a look at the Download Center. It's as if a horde of product managers were released into a Microsoft hunger games and the ones with the most esoteric description and versioning/ marketing scheme came out alive. How anybody would willingly invest time, money or resources on anything Microsoft related is beyond me. /bias rant/
- at-fates-hands 13y agoAs someone who has a love/hate relationship with MS, I feel your pain. I've found as long as you stick within the MS family, all is well. Try to deviate from that pseudo-walled garden and its brutal. For instance, doing Python or Ruby or ROR on a windows machine? No way. I just started doing more MEAN (Mongo, Express, Angular, Node) stack stuff and after several days of cursing the heavens and trying to figure stuff out on my Windows 7 PC, I just said screw this and went to my box running Linux Mint and within 15 minutes was up, running and coding.
- jenscow 13y agoWhenever I look at the CV for Windows developers, all I see is MS technologies. I think to myself "how can you tie yourself to a single company? don't you explorer?" But it's because it's difficult for them to.
- Mikeb85 13y agoThen throw Linux on it. Linux works very well on ThinkPads, and is (IMHO) much better than OSX, plus open-source. Yes Windows sucks, but MS does throw out good things once in awhile...
- pippy 13y agoWhy would anyone want to use another JavaScript UI library when there are already libraries that are out there that are more mature and don't have a companies bias?
- antonwinter 13y agoone day they will stop thinking about windows only.
- rubyfan 13y ago"Controls" ha
- Justsignedup 13y agoI give them this much. It's a great start for a toolkit of animations and interactions. Transitions really follow the animations of Windows 8. It looks really nice. Problem is that I am not sure if they made a full and good UI framework. How does it compare with something like Angular? Is this just animations on top of what can be done in js already?
- euske 13y agoAm I only one who found it odd that WinJS uses GitHub while TypeScript is released on CodePlex? Make up your mind, Microsoft!
- seanmcdirmid 13y agoIts almost like more than one person works at Microsoft, there might even be multiple teams of people who make different decisions for whatever reason. Codeplex at least supports Git.
- peferron 13y agoThat's what I got when I clicked on the "Output" button of the "Datasource edits" sample: http://i.imgur.com/fQFAv1R.png http://i.imgur.com/fQFAv1R.png Nice. For a crazy second I thought Microsoft devs were really insane or got hacked, before coming to the more likely conclusion that it's just random letters and I got lucky - if you can call it that. It's even less likely to happen because only FF seems to be showing 4 letters instead of 15. (Note: I refreshed to check the randomness theory before taking a screenshot, so the linked screenshot is actually forged with the inspector. But it looks just the same as it really did.)
- fka 13y agoWhy not TypeScript?
- yarou 13y agoWhat happened to "developers, developers, developers, developers"?
- hit8run 13y agoTheir creepy designer forgot to use padding on that site. Looks like shit on my ipad.