Package Exports
- yo-yoify
- yo-yoify/lib/appendChild
- yo-yoify/lib/setAttribute
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yo-yoify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
yo-yoify
Transform choo, yo-yo, or bel template strings into pure and fast document calls.
install
npm install yo-yoify --save-dev
usage
When using Browserify, use as a global transform:
browserify entry.js -g yo-yoify -o bundle.js
how this works
yo-yo
and bel
, without this transform, pass template literals to hyperx
.
hyperx
then parses and extracts the tags. bel
then turns those tags into
calls to document.createElement()
.
When using this transform, your template literals:
var msg = 'hello!'
var element = yo`<div>${msg}</div>`
Transform into direct calls to the document
:
var msg = 'hello!'
var element = (function () {
var bel0 = document.createElement("div")
appendChild(bel0, [arguments[0]])
return bel0
}(msg))
Which means, way better performance and compatibility with older browsers.
see also
- babel-plugin-yo-yoify — yo-yoify as a Babel transform, works with any build setup that supports Babel
license
(c) 2016 Kyle Robinson Young. MIT License