-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
diary - implementation thoughts #5
Comments
ES5 implementation could give more syntax sugar than ES6 classes. In ES6 the private data need to be routed by accessor methods defined as closure in constructor. Which anyway are not private and insulated just symbolically by '_' prefix. The trouble is in need to preserve the slot and other internal variables which do not meant to be exposed for security reasons. The simulation of class definition by function (ES5 approach) from closure could give the private variables shared across methods without exposing those via accessor methods. Unfortunately arrow functions and other nice ES6 features would require either compiled version or abandon the legacy browsers. At the moment leaving the compilation to application. To make it simpler the embed-page.js will be in UMD format compatible with Babel and WebPack. Links: |
HTML or JS for deployment? The complete functionality of |
In POC inherited from HTMLElement(not Polymer.Element) Still could not catch the event on Polymer binding update to substitute the string presentation with secured dom. So far tried
with
Also tried to encapsulate binding with div At the moment leaving |
Along with removing Polymer dependencies, moving embed-page from html-based web component to ES6 module, with following publishing on NPM and Bower. |
Will UMD provide any additional value if the embed-page code will be in ES6 ?
As the last is the least complex, it is chosen as format for embed-page. UMD/AMD have a fall back which need to be reflected in docs. |
Apparently ES6 module needs For enabling |
Apparently Polymer.Element gives quite a bit of features to keep it as dependency. Properties definition and binding in particular. Keeping |
Eat your own dog food.
CC: @rianby64 , @TakayoshiKochi |
The content of While the CSS is web component compliant and could be used in full extent, the A
The mock above is using JS string literal syntax which is reflecting one time evaluation. If the page is using own templating framework, it could conflict with The templating in such manner could be made in various ways from treating XML with XSLT, converting JSON to XML and than transforming into SVG, and so on. The transformation and trigger different transformation according to content-type or another condition need to be thought-through. Browser default behavior in such cases already given some hints: XML for example is transformed into collapsible tree. Seems such behavior for |
Loading state APIConsidered options
Most popular use casesWhile each app could be unique, it is expected the order of use cases by popularity would be
Failure handlingQ. Should the “failed” status set when content load failed upon re-assigning src ? Browser in IFRAME shows the browsing error message with error code. In case of load error the default content could be re-rendered with error status available in JS and rendered by default app.
|
Css |
use
From another hand, implementation could gain from encasing the content html within slot element. Is there a potential for multiple slots? As a candidates:
Those slots reflect browser as application peaces. Hidden by default, show default UI if slot mentioned, replaced with custom content when defined. |
fix node_modules/wct-browser-legacy/browser.jslodash produces Solution: Replace 'lodash/index.js' with 'lodash/lodash.js'. With current polymer-cli the error seems gone. |
CDN for es6 modules WebPack does not support exporting ES6 modules. Only build stack which is capable is RollUp and polymer-cli. There is an outdated plugin for replacing rel path to URL. Which is almost sufficient for client code. The missing part is a library build and distribution: plugin which would produce @vendor/module@rev/ into build. And of course CDN to host libs. also rollup-plugin-esm-import-to-url Related issues:
|
Time for v1.0As proof of concept It is a time to move on with current 2021 browser set and JS stack making POC the actual product. ChangesSame APIAs initially designed, basic functionality would be available via same API compatible with IFRAME, import maps, etc. Implementation changesNative web components, ES6 classes & async.
|
Web componentsWould need insulation withing microapplication container as default scope is global. Could be solved by namespacing in XmlDocument. Default namespace would be defined on document and documentElement level. |
virtual DOM vs polyfillXmlDocumentXmlDocument could be used as virtual DOM capable of HtmlDocument functionality. All changes to virtual document could be reflected in microapplication container. Since there is no direct dom and document exposure, it is a most comprehensive insulation method. JS polyfillIs working in embed-page. The window and document API are massaged and routed to matching container. Hence JS is working on page DOM directly without extra memory and the need for virtual dom synchronization. hybrid approachWould permit to place the trusted microapplications in polyfill based containers and keep untrusted content within virtual dom. As development of additional implementation is costly, it would be either in V2 or in commercial implementation. |
<embed-page>
overall nuances.The text was updated successfully, but these errors were encountered: