EPA-WG / embed-page

Proof of concept for Embeddable Progressive Application - a microapplication container, a WebComponent acting as seamless IFRAME or html include
https://www.webcomponents.org/element/EPA-WG/embed-page
Apache License 2.0
17 stars 5 forks source link

runtime platform support #14

Open sashafirsov opened 5 years ago

sashafirsov commented 5 years ago

There are multiple browsers with own capabilities on JS engine and available APIs application developers have to support. Build toolchains like webpack, various framework cli providing support for converting the source code to platform-specific compiled bundles. But in order to make cross-browser support efficient it is not enough to pick the lowest/oldest standard. On newer platforms with JS modules and web components the code would be a level of magnitude smaller and efficient if compiled accordingly. Which makes the platform-specific build switch so attractive.

The switch could be done by server side( web server filters ), CDN proxy rules, and finally by browser by JS. While embed-page supports dynamic switch of own content by pointing SRC attribute to appropriate build, EPA-WG should expose multiple ways of supporting this aspect of microapplication delivery via API, Docs, and reference implementation for platform-specific build switch of embed-page content.

polymer-cli, and other build toolchains allow to tune up the UI build for modern and legasy browsers. Here is a sample of bundle switch in JSP between build targetting es5 and es6 capable browsers.

The samples of build target switch to be extended to