mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
This should shave down bundle sizes by 14.4 kb for many non-blaze projects. The other core meteor packages have not depended on `underscore` since #9362. However, we are only able to remove this last dependency now due to the previous commit, which eliminated usages of `underscore` from apps that did not have the package listed in their `packages` files. This was causing CI test failures that now should be corrected. Any meteor apps currently using `_` without `underscore` listed in their `packages` file will need to add the package explicitly. Version number of `meteor-base` bumped from 1.3.0 to 1.4.0. There are only a few uses of `underscore` in these apps, and two of them actually used `underscore` without having it explicitly listed in their `packages` file. This is a problem, because the apps were relying on the dependency from `meteor-base`, which we want to remove to cut down bundle sizes. For the `modules` test app, I've added `underscore` to the `packages` file, because it is using `_` in an assertion about the module system. For the other app and all other uses of `_`, rather than add `underscore` to the `packages` files, I took the modernization route and replaced the functions with their ES6 equivalents, and then removed `underscore` from all `packages` files.
25 lines
695 B
JavaScript
25 lines
695 B
JavaScript
if (Meteor.isClient) {
|
|
Meteor.startup(function () {
|
|
['production_css', 'development_css'].forEach(cls => {
|
|
var color = getComputedStyle(document.querySelectorAll('.' + cls)[0]).color;
|
|
Meteor.call('print', cls + ': ' + color);
|
|
});
|
|
|
|
// this log is expected to be transformed by minifier
|
|
Meteor.call('print', 'Message (client): foo');
|
|
});
|
|
} else {
|
|
Meteor.startup(function () {
|
|
// since we don't run minifiers for server targets, this is going
|
|
// to be printed as "foo" and not as "production_js" or
|
|
// "development_js"
|
|
console.log('Message: foo');
|
|
});
|
|
|
|
Meteor.methods({
|
|
print: function (message) {
|
|
console.log(message);
|
|
}
|
|
});
|
|
}
|