on 03-20-2017 6:51 AM
I am trying to improve the performance of the Fiori Apps using SAPUI5 framework by making it a Progressive Web App.
So I was trying to implement a Service Worker which is similar to a web worker and would help in offline browser activity especially mobile apps, and cache all the date on the client side.
The problem I am facing in the request conversion. So what I think is, SAPUI5 uses XHR request which I need to probably convert to FETCH API which Service Worker uses.
If anyone has worked on it, do let me know. I would love to have a discussion.
Regards,
Beni
Update: Check this blog post by Mehmet to see how to reduce sync XHRs
___
Previous answer..:
No, currently it's not possible to leverage Service Worker because of the heavy usage of sync XHRs in UI5 internally (e.g. requireSync is often used). Service Worker API demands async XHR only as mentioned in MDN:
"A service worker is run in a worker context: it therefore has no DOM access, and runs on a different thread to the main JavaScript that powers your app, so it is not blocking. It is designed to be fully async; as a consequence, APIs such as synchronous XHR and localStorage can't be used inside a service worker."
Therefore, we either have to modify UI5 so that it doesn't send any sync XHR, or we have to wait until UI5 gets rid of sync XHRs completely which will be done hopefully at the end of this year.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Did you make any progress on this topic? I am also interested in using service workers in my SAPUI5 apps
Kind regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.