Files modified from a standard UI5 project to enable polyfill usage from external provider. Also a example about baking polyfills JS file inside a UI5 app if corporate firewall blocks those provider by any chance.
Created
July 10, 2020 17:57
-
-
Save thalesvb/81c8bf0c183b71f027b14ffaa8a110cc to your computer and use it in GitHub Desktop.
UI5 IE11 Polyfill by external provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_version": "1.12.0", | |
"sap.app": { | |
"id": "demo.polyfill.Polyfill", | |
"type": "application", | |
"i18n": "i18n/i18n.properties", | |
"title": "{{appTitle}}", | |
"description": "{{appDescription}}", | |
"applicationVersion": { | |
"version": "1.0.0" | |
}, | |
"resources": "resources.json", | |
"dataSources": { | |
"mainService": { | |
"uri": "/Northwind/V2/Northwind/Northwind.svc/", | |
"type": "OData", | |
"settings": { | |
"odataVersion": "2.0", | |
"localUri": "localService/metadata.xml" | |
} | |
} | |
}, | |
"sourceTemplate": { | |
"id": "sap.ui.ui5-template-plugin.2masterdetail", | |
"version": "1.65.14" | |
} | |
}, | |
"sap.ui": { | |
"technology": "UI5", | |
"icons": { | |
"icon": "sap-icon://detail-view", | |
"favIcon": "", | |
"phone": "", | |
"phone@2": "", | |
"tablet": "", | |
"tablet@2": "" | |
}, | |
"deviceTypes": { | |
"desktop": true, | |
"tablet": true, | |
"phone": true | |
} | |
}, | |
"sap.ui5": { | |
"rootView": { | |
"viewName": "demo.polyfill.Polyfill.view.App", | |
"type": "XML", | |
"async": true, | |
"id": "app" | |
}, | |
"dependencies": { | |
"minUI5Version": "1.60.0", | |
"libs": { | |
"sap.ui.core": {}, | |
"sap.m": {}, | |
"sap.f": {}, | |
"sap.ushell": {}, | |
"sap.collaboration": { | |
"lazy": true | |
} | |
} | |
}, | |
"contentDensities": { | |
"compact": true, | |
"cozy": true | |
}, | |
"models": { | |
"i18n": { | |
"type": "sap.ui.model.resource.ResourceModel", | |
"settings": { | |
"bundleName": "demo.polyfill.Polyfill.i18n.i18n" | |
} | |
}, | |
"": { | |
"dataSource": "mainService", | |
"preload": true | |
} | |
}, | |
"resources": { | |
"js": [ | |
{ | |
"uri": "polyfill/Object.values.js" | |
}, | |
{ | |
"uri": "polyfill/polyfill.io.js" | |
} | |
] | |
}, | |
"routing": { | |
"config": { | |
"routerClass": "sap.f.routing.Router", | |
"viewType": "XML", | |
"viewPath": "demo.polyfill.Polyfill.view", | |
"controlId": "layout", | |
"controlAggregation": "beginColumnPages", | |
"bypassed": { | |
"target": "notFound" | |
}, | |
"async": true | |
}, | |
"routes": [ | |
{ | |
"pattern": "", | |
"name": "master", | |
"target": "master" | |
}, | |
{ | |
"pattern": "Orders/{objectId}", | |
"name": "object", | |
"target": [ | |
"master", | |
"object" | |
] | |
} | |
], | |
"targets": { | |
"master": { | |
"viewName": "Master", | |
"viewLevel": 1, | |
"viewId": "master" | |
}, | |
"object": { | |
"viewName": "Detail", | |
"viewId": "detail", | |
"viewLevel": 1, | |
"controlAggregation": "midColumnPages" | |
}, | |
"detailObjectNotFound": { | |
"viewName": "DetailObjectNotFound", | |
"viewId": "detailObjectNotFound", | |
"controlAggregation": "midColumnPages" | |
}, | |
"notFound": { | |
"viewName": "NotFound", | |
"viewId": "notFound" | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!Object.values) { | |
Object.values = function(o){ | |
return Object.keys(o).map(function(k){ | |
return o[k]; | |
}); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*eslint-disable sap-no-dom-access*/ | |
/*eslint-disable sap-no-dom-insertion*/ | |
/*eslint-disable sap-no-element-creation*/ | |
if (!document.getElementById("polyfill_loader")) { | |
var script = document.createElement("script"); | |
script.id = "polyfill_loader"; | |
script.src = "//polyfill.io/v3/polyfill.min.js"; | |
document.head.appendChild(script); | |
} | |
/*eslint-enable sap-no-dom-access*/ | |
/*eslint-enable sap-no-element-creation*/ | |
/*eslint-enable sap-no-dom-insertion*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment