After Ryosuke, Travis, Wilson, William, and I discussed the problem for an hour over a burrito, William came up with this approach. All hail William.
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
.icon-foo:before { | |
font-family: 'icons'; | |
content: 'foo' | |
} | |
<span class="icon-foo"></span> |
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
function MyClass(external) { | |
this.external = external; | |
} | |
MyClass.prototype.publicMethod = function() {}; | |
MyClass.prototype.privateMethod = function() {}; | |
module.exports = function () { | |
var myClass = new MyClass(this); |
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
var XFooPrototype = { | |
createdCallback: function() { | |
this.createShadowRoot({ mode: 'open' }); | |
new MutationObserver(() => distribute(this)).observe(this, { childList: true }); | |
distribute(this); | |
} | |
} | |
function distribute(host) { | |
var slots = host.shadowRoot.querySelectorAll('content'); |
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
threads.manager({ | |
my-service: { | |
src: 'window.html', | |
type: 'window' | |
}, | |
// my-service: { | |
// src: 'worker.js', | |
// type: 'worker' | |
// } |
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
@navigation-enter(0.5s) { | |
html { | |
background-color: transparent; | |
animation: fade-in 0.5s; | |
} | |
} | |
@keyframes fade-in { | |
from { opacity: 0; } | |
to { opacity: 1; } |
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
!((define)=>{define((require,exports,module)=>{ | |
module.exports = 'stuff'; | |
});})((typeof define)[0]=='f'&&define.amd?define:((n,nn,w)=>{return(typeof | |
module)[0]=='o'?c=>{c(require,exports,module);}:(c)=>{var m={exports:{}}; | |
c(n=>w[n],m.exports,m);w[n]=m.exports;};})('moduleName',this)); |
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
define([/* dependencies */], function(){ | |
nodeunit.run({ | |
"test my module": function (test) { | |
// run test | |
} | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DOM-shim unit tests</title> | |
<link rel="stylesheet" href="resources/nodeunit.css" type="text/css" /> | |
<script src="resources/es5-shim.js"></script> | |
<script src="resources/nodeunit.js"></script> | |
<script src="../code/my/file"></script> | |
</head> | |
<body> |
OlderNewer