store
store copied to clipboard
Performance.mark() method is missing in Safari iOS 12.1.4
I'm submitting a feature request
-
Library Version: 1.0.0
-
Operating System: OSX 10.14.6
-
Node Version: 12.9.1
-
NPM Version: 6.10.2
-
JSPM OR Webpack AND Version webpack 3.3.9
-
Browser: iOS XX WKWebView Mozilla/5.0 (iPad CPU OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57
-
Language: 3.6.3
Current behavior:
We are developing a cordova app with Aurelia. On Android everything is working fine, but on iOS 12.1.4 store.dispatch
is not working because we are missing the performance.mark
API.
Printing window.performance
is indeed showing, that performance.mark is just not defined.
Whereas caniuse and MDN say it should be supported from iOS Safari 11 onwards.
We are now using a polyfill and it is working.
Expected/desired behavior: Since it looks the the User Timing API is only used for logging it would be great if it would only be used by aurelia-store when it is supported by the browser.
- What is the motivation / use case for changing the behavior? The Library would automatically support older browsers and Safari 12.1.4 ;-)
Hmm weird. In that case I would argue to add the polyfill here. I remember that the nodejs one used to be pretty small. Can you share a link for the one you are using @kabaehr?
I am using https://github.com/nicjansma/usertiming.js right now, but later I found this https://gist.github.com/pmeenan/5902672 that looks also promising
I think I'd prefer the one introduced here which is what we use under test. Would you mind giving it a try?
@kabaehr I've created a branch with the added polyfill. Cant test on your mentioned safari so if you could give it a try that would be really helpful.
Sure, I will test it
Hey, I finally found the time to test it, but I had troubles. When I installed aurelia-store from the branch, the new code was there in src/polyfills.ts but when I build my app it was missing in the compiled aurelia-store file, I checked the files in the dist folder, and there it was indeed missing. I wanted to execute npm run build in the aurelia-store folder but there was another problem with rollup and I gave up.
oh I see, thats because the files haven't been added to dist for the branch as this only happens with the release.
Could you checkout the store repo and switch to the branch. Then in there do npm run build
which now should work compared to doing that from the node_modules. Then in your app just do npm install ../<path-to-the-checked-out-repo>
which should get the local one as a dep
I tried again and had troubles loading the local module with my webpack configuration. "cannot find module "aurelia-store" was the error message. I need to try again soon, since I can't invest too much time on that right now.