mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
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:
@@ -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) {
|
||||
|
||||
@@ -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
7
packages/ui/newblaze.js
Normal file
@@ -0,0 +1,7 @@
|
||||
UI.body2 = new Blaze.Component();
|
||||
_.extend(UI.body2, {
|
||||
contentParts: [],
|
||||
render: function () {
|
||||
return _.map(this.contentParts, function (f) { return f(); });
|
||||
}
|
||||
});
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user