SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.96k stars 1.24k forks source link

refactor: Use performance rather than window.performance #3934

Closed mauriciolauffer closed 9 months ago

mauriciolauffer commented 10 months ago

We have window.performance and performance being used all over the place. They're the same.

I'm proposing to use only the performance form. It's shorter and consistent with JavaScript in all contexts: Node.js, browser window and browser worker.

codeworrior commented 10 months ago

Just a comment: we have indeed the convention*) to use global APIs by their global name (without window, globalThis etc.) when they are available on all platforms (not only UI5 browser platforms). APIs that are only available in the browser (e.g. window.location) should not be used as a global but via window. That way, it's easier to grasp from the source whether code relies on a browser environment or not.

That being said, your change is a good contribution!

*) Well, like with most of our conventions, we fail to fully comply with this one :-)

matz3 commented 10 months ago

Commit pushed as change I82e973528202376163b6d224d255ed787c4d56ab

matz3 commented 9 months ago

Thank you for your contribution 👍🏻 The change has been merged via 90ef141c97e18731a6f2f6bad6a55e79c75c8558