pdamoc / elm-box Goto Github PK
View Code? Open in Web Editor NEWAn exploration of pseudo Web Components implemented in Elm
License: Mozilla Public License 2.0
An exploration of pseudo Web Components implemented in Elm
License: Mozilla Public License 2.0
Setting attributes does nothing.
Reduce the idea of a component to an init /\ next
.
no style tags are added anymore
The error occurs in Safari 10.0.2 or 10.2 (Technology preview version) or Firefox 50.1.0.
The error appears in every example. In this case RandomGif.elm:
TypeError: document.registerElement is not a function[Learn More] RandomGif.elm:13156:3
define http://localhost:8000/_compile/RandomGif.elm:13156:3
<anonymous> http://localhost:8000/_compile/RandomGif.elm:13434:37
<anonymous> http://localhost:8000/_compile/RandomGif.elm:2:2
TypeError: runElmProgram is not a function[Learn More] RandomGif.elm:10:1
<anonymous> http://localhost:8000/RandomGif.elm:10:1
The part where the error occurs is the document.registerElement
function in this part of the code:
// REGISTERS THE COMPONENT
var css = Object.create(null);
function loadCSS(document, css) {
var style = document.createElement('style');
style.type = 'text/css';
style.textContent = css;
document.head.insertBefore(style, document.head.lastChild);
}
function define(impl){
var proto = Object.create(HTMLElement.prototype);
proto.createdCallback = function(){
initializeWC(this, impl);
if (!(impl.name in css)){
loadCSS(this.ownerDocument || document, impl.css);
css[impl.name] = true
};
};
proto.attributeChangedCallback = function (name, prev, curr) {
this.send(name, curr);
};
document.registerElement(impl.name, { prototype:proto });
Which seems to be line 162 in box.js.
Only in Chrome the examples work just fine.
Setting the attributes in JS after the component works.
The initializer fails due to reliance on unexposed normalRenderer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.