This gist is for my talk Faster JavaScript.
So far...
A talk by @inconshreveable at The Strange Loop 2016 called "Idealized Commit Logs: Code Simplification via Program Slicing" about the amazing tools that can be built with program slicing inspired me to work on this project. Learn more about program slicing here.
This is actual output from slice-js (not yet open source), a program slicing tool that I'm working on right now. I can't wait to work out more kinks, make it more practically useful and show it to you all!
The match-sorter.js
file is the transpiled CommonJS version of match-sorter
and you can find that here.
This file contains hidden or 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
/***/ }), | |
/***/ "2UZ2": | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* unused harmony export DropdownModuleNgFactory */ | |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return RenderType_Dropdown; }); | |
/* harmony export (immutable) */ __webpack_exports__["b"] = View_Dropdown_0; | |
/* unused harmony export View_Dropdown_Host_0 */ |
This file contains hidden or 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
describe('Creating client', () => { | |
before(() => { | |
cy.login(); | |
cy.visit('http://xyz/clients') | |
cy.get('#user-app-navigation li.active') | |
.get('a'); | |
cy.get('#user-app-navigation li.active a').should('have.attr', 'href') |
This file contains hidden or 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
// JSON tree is this kind: | |
[ | |
{ | |
name: "Ob1", | |
subobjects: [ | |
{name: "Un1", age: 2}, | |
{name: "Un2", age: 5}, | |
{name: "Un3", age: 4}, | |
{name: "Un4", age: 5}, |
This file contains hidden or 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
class List.Event extends Marionette.ItemView | |
template: "events/list/templates/_event" | |
tagName: "tr" | |
triggers: | |
"click button" : "edit:event:clicked" | |
This file contains hidden or 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
CanSing = | |
sing: -> | |
console.log "I am #{@name} la la la" | |
include = (ctr, mixin) -> | |
console.log "including", ctr | |
for key of mixin | |
ctr.prototype[key] = mixin[key] | |
class Man |