All-but-remove the ui package

Also improve info strings on blaze and ui

Not in this commit:
* Change all uses of `ui` package to use `blaze`
* Change all references to UI symbol to Blaze
* Change docs accordingly
This commit is contained in:
David Greenspan
2014-08-26 15:53:05 -07:00
parent 5eae6f409e
commit c93ac97c10
8 changed files with 24 additions and 51 deletions

View File

@@ -271,13 +271,13 @@ Accounts.loginServicesConfigured = function () {
/// HANDLEBARS HELPERS
///
// If our app has a UI, register the {{currentUser}} and {{loggingIn}}
// If our app has a Blaze, register the {{currentUser}} and {{loggingIn}}
// global helpers.
if (Package.ui) {
Package.ui.UI.registerHelper('currentUser', function () {
if (Package.blaze) {
Package.blaze.Blaze.registerHelper('currentUser', function () {
return Meteor.user();
});
Package.ui.UI.registerHelper('loggingIn', function () {
Package.blaze.Blaze.registerHelper('loggingIn', function () {
return Meteor.loggingIn();
});
}

View File

@@ -1,7 +1,7 @@
Handlebars = {};
Handlebars.registerHelper = UI.registerHelper;
Handlebars.registerHelper = Blaze.registerHelper;
Handlebars._escape = UI._escape;
Handlebars._escape = Blaze._escape;
// Return these from {{...}} helpers to achieve the same as returning
// strings from {{{...}}} helpers
@@ -11,3 +11,6 @@ Handlebars.SafeString = function(string) {
Handlebars.SafeString.prototype.toString = function() {
return this.string.toString();
};
UI = Blaze;

View File

@@ -1,14 +1,15 @@
Package.describe({
summary: "Meteor UI Components framework",
summary: "Meteor Reactive Templating library",
version: '1.0.3'
});
Package.on_use(function (api) {
api.export(['Blaze']);
api.export(['Blaze', 'UI', 'Handlebars']);
api.use('jquery'); // should be a weak dep, by having multiple "DOM backends"
api.use('deps');
api.use('underscore'); // only the subset in microscore.js
api.use('htmljs');
api.imply('htmljs');
api.use('observe-sequence');
api.add_files([
@@ -31,7 +32,8 @@ Package.on_use(function (api) {
'view.js',
'builtins.js',
'lookup.js',
'template.js'
'template.js',
'backcompat.js'
]);
});
@@ -41,6 +43,9 @@ Package.on_test(function (api) {
api.use('blaze');
api.use('test-helpers');
api.use('underscore');
api.use('blaze-tools'); // for BlazeTools.toJS
api.use('html-tools');
api.add_files('view_tests.js');
api.add_files('render_tests.js', 'client');
});

View File

@@ -1,10 +1,9 @@
if (Package.templating) {
var Template = Package.templating.Template;
var UI = Package.ui.UI; // implied by `templating`
var HTML = Package.htmljs.HTML; // implied by `ui`
var Blaze = Package.blaze.Blaze; // implied by `ui`
var Blaze = Package.blaze.Blaze; // implied by `templating`
var HTML = Package.htmljs.HTML; // implied by `blaze`
UI.registerHelper("markdown", new Template('markdown', function () {
Blaze.registerHelper("markdown", new Template('markdown', function () {
var view = this;
var content = '';
if (view.templateContentBlock) {

View File

@@ -26,10 +26,10 @@ Package.on_use(function (api) {
api.export('Template', 'client');
// html_scanner.js emits client code that calls Meteor.startup and
// UI, so anybody using templating (eg apps) need to implicitly use
// Blaze, so anybody using templating (eg apps) need to implicitly use
// 'meteor' and 'ui'.
api.use('ui');
api.imply(['meteor', 'ui'], 'client');
api.use('blaze');
api.imply(['meteor', 'blaze'], 'client');
});
Package.on_test(function (api) {

View File

@@ -1,42 +1,9 @@
Package.describe({
summary: "Meteor UI Components framework",
summary: "Meteor UI framework",
version: '1.0.0'
});
Package.on_use(function (api) {
api.export(['UI', 'Handlebars']);
api.use('jquery'); // should be a weak dep, by having multiple "DOM backends"
// XXX StyleHandler uses $.trim since Safari 4 doesn't support
// `String.trim`. We should just replace this with our own `trim` if
// we want to make jquery a weak dep.
api.use('deps');
api.use('random');
api.use('ejson');
api.use('underscore'); // slight
api.use('ordered-dict');
api.use('minimongo'); // for idStringify
api.use('observe-sequence');
api.use('htmljs');
api.imply('htmljs');
api.use('blaze');
api.imply('blaze');
api.add_files(['ui.js']);
api.add_files(['handlebars_backcompat.js']);
});
Package.on_test(function (api) {
api.use('tinytest');
api.use('jquery'); // strong dependency, for testing jQuery backend
api.use('ui');
api.use(['test-helpers', 'underscore'], 'client');
api.use('blaze-tools'); // for `HTML.toJS`
api.use('html-tools');
api.add_files([
'render_tests.js'
], 'client');
});

View File

@@ -1 +0,0 @@
UI = Blaze;