Skip to content

Commit

Permalink
devmode build
Browse files Browse the repository at this point in the history
  • Loading branch information
leeoniya committed May 11, 2017
1 parent 87122e2 commit 41a9714
Show file tree
Hide file tree
Showing 16 changed files with 2,135 additions and 13 deletions.
15 changes: 13 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const rollup = require('rollup').rollup;
const replace = require('rollup-plugin-replace');
const buble = require('rollup-plugin-buble');
const fs = require('fs');
const exec = require('child_process').exec;
Expand Down Expand Up @@ -40,7 +41,12 @@ function getBuilds() {
{
build: "full",
contents: "`mini`<br> + `attach`<br> + `html`<br>",
descr: "everything (for tests/debug)",
descr: "everything (for tests)",
},
{
build: "dev",
contents: "`full`<br> + warnings",
descr: "use this build for development; it contains detection of some anti-patterns that may cause slowness, confusion, errors or undesirable behavior",
}
];
}
Expand Down Expand Up @@ -80,7 +86,12 @@ function compile(buildName) {

rollup({
entry: entry,
plugins: [ buble() ],
plugins: [
replace({
DEVMODE: buildName === "dev" ? true : false
}),
buble(),
],
})
.then(function(bundle) {
var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
Expand Down
31 changes: 31 additions & 0 deletions demos/devmode.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html>
<head>
<title>domvm - devmode</title>
</head>
<body>
<script src="../dist/dev/domvm.dev.js"></script>

<script>
var el = domvm.defineElement,
vw = domvm.define,
sv = domvm.defineSvgElement;

function View(vm) {
return function() {
return el("div", [
el("input"),
el("input[name=x]"),
el("svg"),
sv("svg"),
]);
}
}

function View2() {
}

var vm = domvm.createView(View).mount(document.body);
</script>
</body>
</html>
6 changes: 4 additions & 2 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
| [mini][4] | 13.4k / 5.3k | + `streamCfg`<br> + `streamFlyd`<br> + `prop`<br> | view reactivity (reduce need for explicit `redraw()`) |
| [client][5] | 13.8k / 5.5k | `mini`<br> + `attach`<br> | SSR hydration |
| [server][6] | 14.8k / 5.9k | `mini`<br> + `html`<br> | SSR rendering |
| [full][7] | 15.2k / 6.0k | `mini`<br> + `attach`<br> + `html`<br> | everything (for tests/debug) |
| [full][7] | 15.2k / 6.0k | `mini`<br> + `attach`<br> + `html`<br> | everything (for tests) |
| [dev][8] | 15.6k / 6.2k | `full`<br> + warnings | use this build for development; it contains detection of some anti-patterns that may cause slowness, confusion, errors or undesirable behavior |

[1]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/pico/domvm.pico.min.js
[2]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/nano/domvm.nano.min.js
[3]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/micro/domvm.micro.min.js
[4]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/mini/domvm.mini.min.js
[5]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/client/domvm.client.min.js
[6]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/server/domvm.server.min.js
[7]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/full/domvm.full.min.js
[7]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/full/domvm.full.min.js
[8]: https://github.com/leeoniya/domvm/blob/2.x-dev/dist/dev/domvm.dev.min.js
2 changes: 1 addition & 1 deletion dist/client/domvm.client.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 41a9714

Please sign in to comment.