Skip to content

Commit 4b300dc

Browse files
Aaron Muir Hamiltonsamccone
Aaron Muir Hamilton
authored andcommitted
Refactor the Vanilla ES6 example (tastejs#1626)
- Simplify the Template module. - Simplify the router. - Convert all of the View render commands to normal methods, and give them more meaningful names. - Convert all of the View bind synthetic events to binding methods, and give them more meaningful names. - Normalize the Store API. - Collapse the Model abstraction, since it consisted mainly of trampolines to methods on Store. - Remove unnecessary dynamic templating for the Clear completed button. - Put .footer inside .main since they are always hidden together. - Make .filter a div, and unnest the <a>s inside the <li>s to avoid unnecessary extra nodes and CSS. - Update the tests to work correctly with the new Vanilla ES6 markup. - Remove unnecessary object orientation in app.js. - Remove boolean traps from methods. - Do not modify the NodeList prototype. - Use cross-browser copmatible NodeList iteration in dispatchEvent of $delegate. - Fix the existing JSDoc comments. - Expand the existing JSDoc comments. - JSDoc more of the code. - Use Google Closure Compiler instead of Babel. It offers useful warnings and generates better code. - Author a learn.json section for the Vanilla ES6 example.
1 parent 41eaaad commit 4b300dc

25 files changed

+805
-3034
lines changed

.jscsrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"examples/thorax_lumbar/public/*.js",
4949
"examples/typescript-*/js/**/*.js",
5050
"examples/vanilladart/**/*.js",
51+
"examples/vanilla-es6/dist/bundle.js",
5152
],
5253
"requireSpaceBeforeBlockStatements": true,
5354
"requireParenthesesAroundIIFE": true,

examples/vanilla-es6/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vanilla ES6 (ES2015) • [TodoMVC](http://todomvc.com)
22

3-
> An exact port of the [Vanilla JS Example](http://todomvc.com/examples/vanillajs/), but translated into ES6, also known as ES2015.
3+
> A port of the [Vanilla JS Example](http://todomvc.com/examples/vanillajs/), but translated into ES6, also known as ES2015.
44
55
## Learning ES6
66

@@ -34,9 +34,10 @@ npm run compile
3434

3535
## Implementation
3636

37-
Uses [Babel JS](https://babeljs.io/) to compile ES6 code to ES5, which is then readable by all browsers.
37+
Uses [Google Closure Compiler](https://developers.google.com/closure/compiler/) to compile ES6 code to ES5, which is then readable by all browsers.
3838

3939

4040
## Credit
4141

4242
Created by [Luke Edwards](http://www.lukeed.com)
43+
Refactored by [Aaron Muir Hamilton](https://github.com/xorgy)

examples/vanilla-es6/dist/app.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)