microsoft / winstore-jscompat

JavaScript Dynamic Content shim for Windows Store apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multi-device Hybrid App Template + WinJS = buggy single page navigation

limefrogyank opened this issue · comments

I've been playing around with the Multi-device Hybrid App template (CTP2) and working on a single-page navigation style app using the WinJS UI. I'm calling a navigate function that loads HTML fragments into a root page... and these fragments contain other scripts that need to run. I've had very few problems making this run on Android and iOS, but Windows 8 and WP8 have given me no end of problems. I wasn't getting any errors thrown so it took a while but I managed at one point to make everything work on Windows by using path names that start with "./" and using path names completely relative to the current html document. (i.e. using lots of ../../folder/file.js style paths)

However, since upgrading to CTP3, this behavior is now gone... meaning the navigation is completely broken again. I began exploring potential problems and decided to comment out the winstore-jscompat.js file that is automatically included in the MDHA template. IT WORKED! I would like to keep using this shim because it fixes compatibility issues with other libraries, but for now it seems to not work well with the navigation model used by WinJS and the current MDHA template.

If needed, I can upload a sample solution that demonstrates this problem.

Copied from the issue from winjs listed above:

https://onedrive.live.com/redir?resid=46F246A7F6BC0008!843259&authkey=!AN8-BUNf07xgmu4&ithint=file%2czip

This is a Multi-Device Hybrid App solution that is setup for single page navigation. It currently has the winstore-jscompat.js reference commented out (in the merges/windows/scripts/platformOverrides.js file) so that it actually works.

To actually build the project for windows, you FIRST have to build it for Android to create the Debug bld folder. Then, you need to attempt to build the Windows version. It will fail with an expired key error. Follow the link below to get a new key, rename it, and copy it to the windows solution folder... build again and it will run.

https://git-wip-us.apache.org/repos/asf?p=cordova-windows.git;a=blob;f=template/CordovaApp_TemporaryKey.pfx;h=90d7ab2208ce170d176a2ac8a60eb22fbc1cbf7a;hb=refs/tags/3.7.1

Once you see it work, then try to uncomment the winstore-jscompat stuff to see what happens... nothing :)

Closing this one and we will track in winjs/winjs#718