Search code examples
javascriptwindows-phone-8.1windows-10-mobile

Are JavaScript apps for WP8.1 and WP10 processed in the same way?


I wrote Liquid Dynamics engine on JS. It doesn't really matter how exactly it works, just one thing to say: it performs heavy computations.

So, I try to launch a project with this engine on WP8.1 and WP10. The project (and all source files) is exactly the same for both platforms.

In WP8.1 it works just perfect. But in WP10 I can see that UI doesn't respond. Particulary, 'click' and 'pointerdown' events handlers are not triggered. After digging deeper I found out that if I reduce computational payload (reduce liquid resolution and exclude some code fragments) then event handlers start to work (can be triggered) in WP10.

The CPU inside both devices is almost the same. I can't believe that WP10 device can't handle this payload.

More than it, this issue can be reproduced inside emulators. Inside WP8.1 emulator it works, inside WP10 emulator 'click' and 'pointerdown' events handlers are not triggered. But if I reduce payload, the handlers start to work inside WP10 emulator. As you can see, CPU is exactly the same for both emulators (it is inside my PC where emulators are).

Can anyone explain what's going on? There is no errors inside debugging console in both cases.


Solution

  • So, maybe the problem was in fact that WP8.1 uses Chakra (JScript) engine (like inside IE11), but Windows 10 Mobile uses Chakra (JavaScript) engine (like inside Edge). But it is only supposition.

    The only advice that I can give from my experience is not to run WP8.1 JavaScript apps on Windows 10. It is necessary to create another UWP app instead. Fortunately, Visual Studio allows to develop several projects inside one solution. So, the source code can be easily copied from one project to another or (even better) it can be isolated into separate project to which other projects can refer to.

    Windows Store also allows to publish several packages to different OS inside one app.

    When I created new UWP app and inserted my code there, it started to work normally.