Comparing version 0.1.0 to 0.1.1
@@ -22,4 +22,4 @@ The process of converting a string template into a fully compiled | ||
only needs to ever be called once), clones the fragment, | ||
then calls `hydrate` and and loops through each mustache, | ||
passing each to runtime helpers `RESOLVE` or `ATTRIBUTE` | ||
then calls `hydrate` and loops through each mustache, | ||
passing each to runtime helpers `resolve` or `attribute` | ||
which can be overridden to perform data-binding, invoke | ||
@@ -34,3 +34,3 @@ user-defined helpers, etc. | ||
4. Build up hydrating function from the HTMLBars AST. | ||
5. Generate the final template code performs the basic cloning logic, | ||
5. Generate the final template code that performs the basic cloning logic, | ||
invokes `build` and `hydrate`, and loops through each mustache. | ||
@@ -66,4 +66,3 @@ | ||
See [parser.js](lib/htmlbars/parser.js) and | ||
[process-token.js](lib/htmlbars/html-parser/process-token.js). | ||
See [parser.js](packages/htmlbars-compiler/lib/parser.js) | ||
@@ -77,3 +76,3 @@ ### 2. Convert to HTMLBars AST | ||
1. The there are AST nodes for every DOM element | ||
1. There are AST nodes for every DOM element | ||
2. The mustaches are distinguished between whether they occur | ||
@@ -87,11 +86,11 @@ a) within an element's content (e.g. `<p>Hello {{name}}!</p>`), | ||
HTMLElement tag='p' attributes=[['class', ['user ', Mustache(`user.cssClass`)]]] | ||
Element tag='p' attributes=[Attr('class', Mustache(`concat "user " user.cssClass`))] | ||
"User: " | ||
Mustache(`user.name`) | ||
" " | ||
HTMLElement tag='button' helpers=[Mustache(`onclick "like"`)] | ||
Element tag='button' helpers=[Mustache(`onclick "like"`)] | ||
"Like" | ||
See [parser.js](lib/htmlbars/parser.js) and | ||
[ast.js](lib/htmlbars/ast.js). | ||
See [parser.js](packages/htmlbars-compiler/lib/parser.js) and | ||
[ast.js](packages/htmlbars-compiler/lib/ast.js). | ||
@@ -157,7 +156,7 @@ ### 3. Build document fragment generator from HTMLbars AST | ||
1. In [fragment_opcode.js](lib/compiler/fragment_opcode.js), | ||
1. In [fragment_opcode.js](packages/htmlbars-compiler/lib/compiler/fragment_opcode.js), | ||
the HTMLbars AST is recursively walked and a flattened | ||
array of opcodes (used in step 2) is generated. | ||
The intent of this phase is to flatten the recursive structure of the | ||
AST so that so recursion need take place in our compiled | ||
AST so that no recursion need take place in our compiled | ||
template (recursion leads to deep object graphs, clunky GC, etc) | ||
@@ -172,2 +171,1 @@ 2. This opcodes array is then passed to `lib/compiler/fragment.js` which | ||
TODO: this. | ||
{ | ||
"name": "htmlbars", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "HTMLBars compiles Handlebars templates into document fragments rather than string buffers", | ||
"main": "index.js", | ||
"main": "dist/cjs/htmlbars.js", | ||
"scripts": { | ||
"test": "./node_modules/grunt-cli/bin/grunt test" | ||
"prepublish": "bower install", | ||
"build": "bin/build.js", | ||
"pretest": "bin/build.js", | ||
"test": "bin/run-tests.js", | ||
"start": "broccoli serve" | ||
}, | ||
@@ -16,16 +20,27 @@ "repository": { | ||
"readmeFilename": "README.md", | ||
"dependencies": { | ||
"handlebars": "1.3.0", | ||
"broccoli-funnel": "^0.1.6" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.2", | ||
"grunt-cli": "~0.1.11", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-connect": "~0.6.0", | ||
"grunt-contrib-watch": "~0.5.3", | ||
"grunt-contrib-qunit": "~0.3.0", | ||
"grunt-es6-module-transpiler": "~0.6.0", | ||
"grunt-concat-sourcemap": "~0.4.0", | ||
"grunt-contrib-copy": "~0.5.0", | ||
"grunt-contrib-uglify": "~0.2.7", | ||
"grunt-contrib-jshint": "~0.8.0", | ||
"connect-redirection": "0.0.1" | ||
"bower": "~1.3.3", | ||
"broccoli": "0.12.0", | ||
"broccoli-cli": "0.0.1", | ||
"broccoli-concat": "0.0.6", | ||
"broccoli-es6-module-transpiler": "~0.1.0", | ||
"broccoli-export-tree": "~0.3.0", | ||
"broccoli-file-mover": "0.3.5", | ||
"broccoli-file-remover": "~0.2.2", | ||
"broccoli-jshint": "~0.5.3", | ||
"broccoli-merge-trees": "0.2.1", | ||
"broccoli-string-replace": "~0.0.2", | ||
"broccoli-uglify-js": "~0.1.3", | ||
"chalk": "~0.4.0", | ||
"copy-dereference": "~1.0.0", | ||
"handlebars": "1.3.0", | ||
"ncp": "~0.5.1", | ||
"qunit": "^0.7.2", | ||
"rimraf": "~2.2.8", | ||
"rsvp": "~3.0.6" | ||
} | ||
} |
@@ -16,4 +16,4 @@ # Status [![Build Status](https://travis-ci.org/tildeio/htmlbars.png)](https://travis-ci.org/tildeio/htmlbars) | ||
Handlebars that can work directly against DOM nodes and doesn't | ||
need special tags in the String for the data binding code can | ||
find (a major limitation in Ember). | ||
need special tags in the String for the data binding code to work | ||
(a major limitation in Ember). | ||
@@ -28,4 +28,29 @@ There are also many performance gains in HTMLBars' approach to building | ||
Until then, check out [ARCHITECTURE.md](ARCHITECTURE.md) for | ||
info on how HTMLBars is structured and its approach to efficiently | ||
building / emitting DOM. | ||
info on how HTMLBars is structured and its approach to efficiently building / emitting DOM. | ||
# Building HTMLBars | ||
1. Ensure that [Node.js](http://nodejs.org/) is installed. | ||
2. Run `npm install` to ensure the required dependencies are installed. | ||
3. Run `npm run-script build` to build HTMLBars. The builds will be placed in the `dist/` directory. | ||
# How to Run Tests | ||
## Via testem | ||
[Testem](https://github.com/airportyh/testem) is a tool for running tests against | ||
multiple launchers. For instance, Chrome and PhantomJS. | ||
1. Install Testem: `npm install -g testem` | ||
2. Run testem: `testem` or run Testem with specific browers: `testem -l Safari,Firefox` | ||
Testem is a CI tool, so it will run tests as you change files. | ||
## On the console with PhantomJS | ||
1. Run `npm test`. | ||
## In a browser | ||
1. Run `npm start`. | ||
2. Visit <http://localhost:4200/test>. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
59
55
189240
2
19
4873
5
6
+ Addedbroccoli-funnel@^0.1.6
+ Addedhandlebars@1.3.0
+ Addedamdefine@1.0.1(transitive)
+ Addedasync@0.2.10(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedbroccoli-funnel@0.1.7(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedcore-object@0.0.2(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhandlebars@1.3.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedlodash-node@2.4.1(transitive)
+ Addedminimatch@2.0.103.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedoptimist@0.3.7(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedrsvp@3.6.2(transitive)
+ Addedsource-map@0.1.43(transitive)
+ Addedsymlink-or-copy@1.3.1(transitive)
+ Addeduglify-js@2.3.6(transitive)
+ Addedwalk-sync@0.1.3(transitive)
+ Addedwordwrap@0.0.3(transitive)
+ Addedwrappy@1.0.2(transitive)