So we can use this feature inside of all browsers for all users, which is amazing. And since we have a limited time today, unfortunately, we would have to stop. But I'm going to give you some bonus points and I hope I intrigued you enough to investigate some of these cool APIs on your own.
So here are my highlights. There is a Beacon API which basically we use if you want to send a request, but you don't care about the response. The use case is some analytics. There is a Web Speech API, which can figure out our talk and even give us some diagnostics about certain words. There is a Web Share API, which helps us to share data between different devices. There is a Screen Awake Lock API, which prevents us from locking screen on our devices, despite of the personal preferences of that device. There is a Page Visibility API, which figures out if the whole browser, if the whole tab is visible or not. There is a Background Fetch API, which is basically similar to Background Sync, but if we are downloading some large resources and we go offline. And of course, there is a Web Authentication API, which is a brand new, shiny web API for password-less authorization and authentication, of course.
And some of the takeaways. We've seen that with some of the APIs, there is nonexistent existing browser support. So we still may have some challenges when using some of these web APIs. Some of them have experimental browser support, so they have some implementation in place, but it's maybe not production ready. Some of them have a device support, for example, like Screen Away Clock API. So there are some challenges, and we should be careful when using some of the APIs. But why should we do this, and why should we take this approach? Because it's standardized code, it's standardized code, it's standardized code. Probably I could not stress enough how important this is, especially in today's web development where we have a new library or new framework each week. This is kind of like a single source of truth. These APIs are standardized, and they work across all browsers the same from the code perspective. So that code is pretty much standardized and should not break anytime soon. Most of these APIs are easy to learn, they're not super complicated or something. And they can increase performance because if we adopt this mindset to use the APIs and not so many libraries, or build something on our own based on some of these APIs like we have seen for the infinite scroll lists, the bundle size of our app will be smaller. And that brings me to to my next point, why is that so much important, especially with the performance and bundle sizes. I wanted to talk a bit about our planet. If you're having 4 or 4 facial expressions right now, like, what? What are you talking about? Actually, when we build our application, we get a certain bundle of JavaScript, which we push somewhere to some server, those servers to some cloud providers, which are spread across the whole globe, and all those servers use a lot of electricity. In fact, so much that the internet is consuming 21% of all electricity on the world. Luckily for us, there is a website called Website Carbon Calculator, which figures out all of this stuff for us. Basically, it checks how green is our website. This is super important because I would really hate if we had to use swmirko.rs to run for our lives and not to you know go to a vacation or enjoy ourselves. So, please be kind to our planet and using some of the web APIs and not using the libraries and increasing the bundle sizes are one of the many ways we can do this. If we join forces together, it doesn't have to be a big effort, but if we all join forces just a bit, we can all produce a big, big result in this regard. So, thank you so much for being with us today, I hope you like this talk. If you need a refresher, there is a QR code, which is the link to the slides themselves. At the bottom, there is a link to my GitHub, where you can check all the APIs, all the examples for yourself, run them locally, maybe tweak them a little bit. Let me know if you have some improvements, of course. And that would be it.
Comments