framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.16k stars 3.23k forks source link

Fastclick removal regresses iOS cordova app responsiveness #3395

Closed peitschie closed 5 years ago

peitschie commented 5 years ago

Describe the bug

The recent removal of the embedded fastclick library in Framework7 v5 has re-introduced the 300ms click delay in Cordova iOS applications. Even with the most recent versions of cordova (9.0 with iOS platform version 5+) and iOS (13.1.3), the webkit versions in use are very old: AppleWebKit/605.1.15.

Without the fastclick library, the 300ms lag when clicking on buttons, links etc is re-introduced, making applications feel laggy to use.

Fortunately, the upstream library (https://github.com/ftlabs/fastclick) is still easily installable, so I've worked around this by packaging the fastclick library myself with the application to improve the speed once again.

Additional Context

I'm raising this defect however as Framework7 is specifically listing cordova & iOS as supported configurations, so thought perhaps it may be of interest to know.

nolimits4web commented 5 years ago

the webkit versions in use are very old: AppleWebKit/605.1.15.

You need to use WKWebView to have latest web view where this is not the issue

peitschie commented 5 years ago

Hi @nolimits4web ,

Apologies if I've missed the obvious, but I am using cordova-ios v5.0.1, with the https://github.com/apache/cordova-plugin-wkwebview-engine plugin, and have added the following into my config.xml:

  <plugin name="cordova-plugin-wkwebview-engine" spec="^1.2.1" />
  <platform name="ios">
        <feature name="CDVWKWebViewEngine">
            <param name="ios-package" value="CDVWKWebViewEngine" />
        </feature>
        <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
    </platform>

When the app launches, it's clearly stating that the WKWebView is in use, though the navigator version is still listed as the one I inserted at the top.

Are you able to provide any tips as to why I'm not seeing a more recent browser as you'd expect?

Thanks for your help here and this wonderful framework.

peitschie commented 5 years ago

More proof of this, here is the starting banner for the app:

2019-11-14 18:36:59.565798+1100 <....>[1128:696117] Apache Cordova native platform version 5.0.1 is starting.
2019-11-14 18:36:59.565919+1100 <....>[1128:696117] Multi-tasking -> Device: YES, App: YES
2019-11-14 18:36:59.578236+1100 <....>[1128:696117] 

Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file
2019-11-14 18:36:59.706278+1100 <....>[1128:696117] CDVWKWebViewEngine will reload WKWebView if required on resume
2019-11-14 18:36:59.706336+1100 <....>[1128:696117] Using WKWebView
2019-11-14 18:36:59.706498+1100 <....>[1128:696117] [CDVTimer][console] 0.038028ms
2019-11-14 18:36:59.706569+1100 <....>[1128:696117] [CDVTimer][handleopenurl] 0.037074ms
2019-11-14 18:36:59.707412+1100 <....>[1128:696117] [CDVTimer][intentandnavigationfilter] 0.813007ms
2019-11-14 18:36:59.707483+1100 <....>[1128:696117] [CDVTimer][gesturehandler] 0.036001ms
2019-11-14 18:36:59.709140+1100 <....>[1128:696117] [CDVTimer][file] 1.620054ms
2019-11-14 18:36:59.735027+1100 <....>[1128:696117] [CDVTimer][splashscreen] 25.839090ms

I've triple-checked this today, and it seems that v605 of the browser is the latest on iOS 13, and the fastclick addition still has a noticeable improvement on the responsiveness.

peitschie commented 5 years ago

Hrm. After cleaning everything (including node_modules etc), and rebuilding from scratch, I can confirm the fastclick module isn't required, as you said @nolimits4web . Seems like something was not correctly rebuilt in my earlier attempts.

Apologies for wasting your time on this! Thanks again 😃