Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance.mark() method is missing in Safari iOS 12.1.4 #101

Open
kabaehr opened this issue Sep 30, 2019 · 8 comments
Open

Performance.mark() method is missing in Safari iOS 12.1.4 #101

kabaehr opened this issue Sep 30, 2019 · 8 comments

Comments

@kabaehr
Copy link

kabaehr commented Sep 30, 2019

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 ;-)
@zewa666
Copy link
Member

zewa666 commented Sep 30, 2019

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?

@kabaehr
Copy link
Author

kabaehr commented Oct 1, 2019

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

@zewa666
Copy link
Member

zewa666 commented Oct 1, 2019

I think I'd prefer the one introduced here which is what we use under test. Would you mind giving it a try?

zewa666 added a commit that referenced this issue Oct 2, 2019
adds the performance polyfill, specifically for perf.mark

related issue #101
@zewa666
Copy link
Member

zewa666 commented Oct 2, 2019

@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.

@kabaehr
Copy link
Author

kabaehr commented Oct 7, 2019

Sure, I will test it

@kabaehr
Copy link
Author

kabaehr commented Oct 31, 2019

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.

@zewa666
Copy link
Member

zewa666 commented Oct 31, 2019

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

@kabaehr
Copy link
Author

kabaehr commented Nov 18, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants