Openui5: Polyfills should be load only if required

Created on 26 Nov 2020  路  3Comments  路  Source: SAP/openui5

OpenUI5 version: All

Browser/version (+device/version): All

What is the expected result?
If my browser supports Promises, I don't need to load a polyfill for it. If my browser doesn't support Promises, the polyfill should be loaded async. The same applies for all other polyfills being used by UI5.

What happens instead?
Polyfills are load even when they are not required. A lot of data is being transferred for nothing. UI5 is notorious heavy, not loading unnecessary code would help a bit.

in progress

Most helpful comment

Hi @mauriciolauffer ,

I will directly comment here and update the ticket a bit later.

I know - this is really unfortunate, that we cannot decide depending on the browser to omit the polyfills or not.

But we have a plan for that! The optional loading of polyfills to not punish modern browsers is exactly what we want to achieve with a new bootstrap of UI5 which is modular and can decide while booting what kind of resources need to be loaded: I called it ultra core or modular core. Paired with the UI5 Tooling and the option to create a self-contained bundles, you can then create most optimal packages for your scenarios. This is part of our roadmap of the UI5 evolution project at the framework side. As this change isn't compatible (which is one key pillar of the promises of UI5), we cannot change todays' bootstrap (sap-ui-core.js) for that.

I think this is rather a feature request than a bug fix which underlines the need for this feature and I have yet another argument to get more priority on this topic. Would this be ok for you?

Best regards,
Peter

All 3 comments

Hello @mauriciolauffer,

Thank you for sharing this finding. I've created an internal incident 2080398450. The status of the issue will be updated here in GitHub.

Regards,
Patric

Hi @mauriciolauffer ,

I will directly comment here and update the ticket a bit later.

I know - this is really unfortunate, that we cannot decide depending on the browser to omit the polyfills or not.

But we have a plan for that! The optional loading of polyfills to not punish modern browsers is exactly what we want to achieve with a new bootstrap of UI5 which is modular and can decide while booting what kind of resources need to be loaded: I called it ultra core or modular core. Paired with the UI5 Tooling and the option to create a self-contained bundles, you can then create most optimal packages for your scenarios. This is part of our roadmap of the UI5 evolution project at the framework side. As this change isn't compatible (which is one key pillar of the promises of UI5), we cannot change todays' bootstrap (sap-ui-core.js) for that.

I think this is rather a feature request than a bug fix which underlines the need for this feature and I have yet another argument to get more priority on this topic. Would this be ok for you?

Best regards,
Peter

Bug fix, feature... as long as we have it in the future, everybody will be happier :)

Was this page helpful?
0 / 5 - 0 ratings