-
Notifications
You must be signed in to change notification settings - Fork 27.3k
fix(win8): Make Angular work on Windows 8 JS Apps #6217
Conversation
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
So, a couple of things about this:
Still, I applaud the effort to get Angular behaving better with certain mobile devices, so maybe there's a chance this could be done. |
@caitp This is not for Windows Phone, but for Windows 8 apps written in HTML and JavaScript. |
@caitp Thanks for the feedback. Windows Store apps do not yet support Karma or protractor yet. We are looking at using Cordova's Medic to see if we could automate tests for the Windows 8 Store apps. |
This is known to affect WP8, @panarasi. At any rate, if this makes it into angular core, I think it will need to be shaped differently. |
@caitp How do you think we should shape it ? I have created a thread on the mailing list too, for the discussion. |
Pretty straight forward monkey patching. This could be put in a separate module if it ends up being a lot of code, too, but that leads to some difficulties. I think jQuery suffers from these same problems as I don't see anything in jQuery master branch which gets around this. |
So I've discussed this a bit with Igor, and I think what we really need for proper WP8 support is a good testing strategy. It would be great if you (or your office, or whoever) could enhance this PR with some tests. Looking at the PR again, I think this will hurt performance a bit on WP8 devices, but maybe that can't be helped, so you can probably ignore the issues I've mentioned about it. Probably should take the docs changes out of the diff, though. If anyone can help you get WP8 stuff running on CI builds, that is probably welcome. |
@caitp Question about WP8 - when you say WP8, do you mean the browser (IE) on Windows Phone 8 has issues ? |
@IgorMinar Windows 8 does not have a web driver yet and hence, running on protractor would be hard. For Karma, I am thinking of a karma launcher that would do the following
Alternatively, we could write a karma framework that saves the files, and then a karma launcher, if step 1 seems dirty. |
@panarasi: http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx these affect windows phone apps in general, it's their platform. Now, I have seen some information about running webdriver on WP8 --- http://winphonewebdriver.codeplex.com/ however it appears not to have been updated in a couple months, so I'm not sure how far we could get with that. But it's a start. |
I'm pretty sure the guys at http://www.thinktecture.com/ were wrapping angularjs apps as Windows 8 apps. |
src/jqLite.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just like we have msie
variable defined in Angular.js file, could you also define msApp or something similar? that would simplify the checks throughout the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I was hoping to not do browser (or in this case, platform detection). Do you suggest that I change all the conditional checks to detecting a centralized MsAPP app, just like msie
?
@caitp This link from your comment is for a Windows Store app, it is not for a Windows Phone 8 app. The programming model for Windows 8 Store apps and Windows Phone 8 apps are different. I am sorry I still do not understand how this impacts Windows Phone 8 apps, can you please elaborate ?
|
@petebacondarwin Is there a specific link that we can look at, where they wrap Angular for a Windows Store app? |
@panarasi - no but I am sure I heard them talking about it at a conference. You could try sending them an email - they're very friendly. |
@panarasi I think the "WP8" confusion is just a terminology issue on our part. We weren't aware that WP8 and Windows Store app were two different things :-) now we know... |
@caitp Monkey Patching may not work as we have properties like innerHTML that could be problem |
@IgorMinar I am working on replacing all the checks with the msapp variable as you have mentioned. I am also working on getting a karma-windows8app-launcher, but it may take some time. In the meantime, I have been able to run is a Windows App that runs the various docs-scenario.html test cases and has the same pass rate as desktop IE. Are there any other things that are needed before this pull request can be merged in ? |
I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS. Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match. If you signed the CLA as a corporation, please let us know the company's name. Thanks a bunch! PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR. |
src/Angular.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems redundant, why not just ask for MSApp then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IgorMinar wanted an msapp variable that was checked. @caitp Are you saying that we should get rid of this line and look only for MSApp at all places where we are doing the checks?
CLA signature verified! Thank you! Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes). |
@old9 Can you please explain ? Did you run these on the Windows 8 apps? Do you still see errors? |
Yeah I'm currently running an Angular app on windows 8, and it does report errors on those points. Actually, this happens (only?) when I'm using jQuery(v2.0.3) together with Angular. I'm not quite sure if it's the right place to apply the wrap patch, these are just my guesses from the error traces: for the first link, it calls the |
@old9 Given that jqLite is bundled with Angular, fixing that makes sense. However, if these issues are fixed in jQuery, we would have to fix them here. Note that jQuery had Windows Store apps in 2.0+. This error could be a regression in JQuery? |
@panarasi Yes they did claim a support for Windows Store apps, but I haven't had any lucky on any 2.0+ versions with Angular, so I think there might be more things to tackle on the Angular side, since Angular does something different itself when jQuery is detected. Besides, some of the errors only complain about angular.js rather than jquery.js:
|
That would be from here, not jqLite |
I've re-tested all the places mentioned by placing breakpoints there - all of them are called and work correct (including animation module) when jQuery is NOT used.
|
Added special logic to tweak jQuery to get rid of Windows Store restrictions. Tested with jquery 2.1.0. |
@sgrebnov Angular 1.2.x officially supports jQuery 1.10.x. Official support for jQuery 2.x is coming with Angular 1.3. |
Hi Parashuram, I took a look at PR 6217. The changes I see boil down to these:
Customizing
|
Closing this pull request as per @chirayuk's comment |
Browser: Other
Component: misc core
Regression: no
Make Angular JS work on Windows 8 JavaScript apps.
In order to ensure the right level of security, the Windows platform prevents certain things to be done in JavaScript code, therefore developers have to make some adjustments to their Web code.
The changes in the pull request for AngularJS are in line with Windows 8 recommendations without breaking the Web.
All the unit test cases for the web have been run. The scenario runners have also been run on Windows Store apps to ensure that these changes work.
With these changes, developers can use AngularJS for Windows Store apps the exact same way they do for their Web apps.