Try out using Blaze in UI (break the world)

Basically all that works is an app with a static body :)
This commit is contained in:
David Greenspan
2014-05-01 00:13:07 -07:00
parent a1123715b6
commit b8f7f1d093
4 changed files with 22 additions and 4 deletions

View File

@@ -14,15 +14,21 @@ Package.on_use(function (api) {
api.add_files([
'preamble.js',
'sequence.js',
'var.js',
'var.js'
]);
api.add_files([
'dombackend.js',
'domrange.js',
'events.js',
'attrs.js'
], 'client');
api.add_files([
'render.js',
'component.js',
'attrs.js',
'materialize.js'
], 'client');
]);
});
Package.on_test(function (api) {

View File

@@ -175,7 +175,7 @@ html_scanner = {
});
// We may be one of many `<body>` tags.
results.js += "\nUI.body.contentParts.push(UI.Component.extend({render: " + renderFuncCode + "}));\nMeteor.startup(function () { if (! UI.body.INSTANTIATED) { UI.body.INSTANTIATED = true; UI.DomRange.insert(UI.render(UI.body).dom, document.body); } });\n";
results.js += "\nUI.body2.contentParts.push(" + renderFuncCode + ");\nMeteor.startup(function () { if (! UI.body2.domrange) { Blaze.render(function () { return UI.body2; }).attach(document.body); } });\n";
}
} catch (e) {
if (e.scanner) {

7
packages/ui/newblaze.js Normal file
View File

@@ -0,0 +1,7 @@
UI.body2 = new Blaze.Component();
_.extend(UI.body2, {
contentParts: [],
render: function () {
return _.map(this.contentParts, function (f) { return f(); });
}
});

View File

@@ -17,6 +17,9 @@ Package.on_use(function (api) {
api.use('htmljs');
api.imply('htmljs');
api.use('blaze');
api.imply('blaze');
api.add_files(['exceptions.js', 'base.js']);
api.add_files(['dombackend.js',
@@ -32,6 +35,8 @@ Package.on_use(function (api) {
]);
api.add_files(['handlebars_backcompat.js']);
api.add_files(['newblaze.js']);
});
Package.on_test(function (api) {