mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge pull request #4851 from meteor/umbrella
Split meteor-platform into smaller umbrella packages code and discussion
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
Package.describe({
|
||||
summary: "Publish the entire database to all clients",
|
||||
summary: "(For prototyping only) Publish the entire database to all clients",
|
||||
version: '1.0.4-plugins.0'
|
||||
});
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ Package.onUse(function (api) {
|
||||
'underscore'
|
||||
], ['client', 'server']);
|
||||
|
||||
api.use('reload', 'client', {weak: true});
|
||||
api.use('reload', 'client');
|
||||
|
||||
api.use(['http', 'random'], 'web.cordova');
|
||||
|
||||
|
||||
api.addFiles('autoupdate_server.js', 'server');
|
||||
api.addFiles('autoupdate_client.js', 'web.browser');
|
||||
api.addFiles('autoupdate_cordova.js', 'web.cordova');
|
||||
|
||||
9
packages/blaze-html-templates/README.md
Normal file
9
packages/blaze-html-templates/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# blaze-html-templates
|
||||
|
||||
A meta-package that includes everything you need to compile and run Meteor templates with Spacebars and Blaze.
|
||||
|
||||
For more details, see the documentation of the component packages:
|
||||
|
||||
- [templating](https://atmospherejs.com/meteor/templating): compiles `.html` files
|
||||
- [blaze](https://atmospherejs.com/meteor/blaze): the runtime library
|
||||
- [spacebars](https://atmospherejs.com/meteor/spacebars): the templating language
|
||||
25
packages/blaze-html-templates/package.js
Normal file
25
packages/blaze-html-templates/package.js
Normal file
@@ -0,0 +1,25 @@
|
||||
Package.describe({
|
||||
name: 'blaze-html-templates',
|
||||
version: '1.0.0',
|
||||
// Brief, one-line summary of the package.
|
||||
summary: 'Compile HTML templates into reactive UI with Meteor Blaze',
|
||||
// By default, Meteor will default to using README.md for documentation.
|
||||
// To avoid submitting documentation, set this field to null.
|
||||
documentation: 'README.md'
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.imply([
|
||||
// A library for reactive user interfaces
|
||||
'blaze',
|
||||
|
||||
// The following packages are basically empty shells that just exist to
|
||||
// satisfy code checking for the existence of a package. Rest assured that
|
||||
// they are not adding any bloat to your bundle.
|
||||
'ui', // XXX COMPAT WITH PACKAGES BUILT FOR 0.9.0.
|
||||
'spacebars', // XXX COMPAT WITH PACKAGES BUILT FOR 0.9.0
|
||||
|
||||
// Compile .html files into Blaze reactive views
|
||||
'templating'
|
||||
]);
|
||||
});
|
||||
@@ -26,8 +26,7 @@ Blaze._escape = (function() {
|
||||
Blaze._warn = function (msg) {
|
||||
msg = 'Warning: ' + msg;
|
||||
|
||||
if ((typeof Log !== 'undefined') && Log && Log.warn)
|
||||
Log.warn(msg); // use Meteor's "logging" package
|
||||
else if ((typeof console !== 'undefined') && console.log)
|
||||
console.log(msg);
|
||||
if ((typeof console !== 'undefined') && console.warn) {
|
||||
console.warn(msg);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Package.describe({
|
||||
summary: "Allow all database writes by default",
|
||||
summary: "(For prototyping only) Allow all database writes from the client",
|
||||
version: '1.0.4-plugins.0'
|
||||
});
|
||||
|
||||
|
||||
11
packages/meteor-base/README.md
Normal file
11
packages/meteor-base/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# meteor-base
|
||||
|
||||
A default set of packages that almost every app will have. You should only remove this package if you really, really know what you are doing.
|
||||
|
||||
It comes with the following packages:
|
||||
|
||||
1. [`meteor`](https://atmospherejs.com/meteor/meteor) - Super basic stuff about the programming environment, and a handler for the `css` file type.
|
||||
2. [`webapp`](https://atmospherejs.com/meteor/webapp) - The actual web server that handles connections, serves files, etc.
|
||||
3. [`underscore`](https://atmospherejs.com/meteor/underscore) - A library with lots of useful utilities that most of Meteor is built on.
|
||||
4. [`autoupdate`](https://atmospherejs.com/meteor/autoupdate) - Refreshes the client automatically when the server has new code.
|
||||
5. [`ddp`](https://atmospherejs.com/meteor/ddp) - A protocol for communicating between the client and server. This is what enables `Meteor.methods`, `Meteor.publish`, `Meteor.subscribe`, etc.
|
||||
31
packages/meteor-base/package.js
Normal file
31
packages/meteor-base/package.js
Normal file
@@ -0,0 +1,31 @@
|
||||
Package.describe({
|
||||
name: 'meteor-base',
|
||||
version: '1.0.0',
|
||||
// Brief, one-line summary of the package.
|
||||
summary: 'Packages that every Meteor app needs',
|
||||
// By default, Meteor will default to using README.md for documentation.
|
||||
// To avoid submitting documentation, set this field to null.
|
||||
documentation: 'README.md'
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.imply([
|
||||
// Super basic stuff about where your code is running and async utilities
|
||||
'meteor',
|
||||
|
||||
// This package enables making client-server connections; currently Meteor
|
||||
// only supports building client/server web applications so this is not
|
||||
// removable
|
||||
'webapp',
|
||||
|
||||
// Most Meteor core packages depend on Underscore right now
|
||||
'underscore',
|
||||
|
||||
// The protocol and client/server libraries that Meteor uses to send data
|
||||
'ddp',
|
||||
'livedata', // XXX COMPAT WITH PACKAGES BUILT FOR 0.9.0.
|
||||
|
||||
// Push code changes to the client and automatically reload the page
|
||||
'autoupdate'
|
||||
]);
|
||||
});
|
||||
7
packages/mobile-experience/README.md
Normal file
7
packages/mobile-experience/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# mobile-experience
|
||||
|
||||
A set of Cordova/PhoneGap-specific packages that set some good defaults when building for mobile. These packages only activate when you are building a native Android or iOS app.
|
||||
|
||||
1. [fastclick](https://atmospherejs.com/meteor/fastclick) - avoid the 300ms touch delay
|
||||
2. [mobile-status-bar](https://atmospherejs.com/meteor/mobile-status-bar) - avoid the status bar information covering up your app content
|
||||
3. [launch-screen](https://atmospherejs.com/meteor/launch-screen) - cover the app with a launch image so that people don’t have to see things loading
|
||||
22
packages/mobile-experience/package.js
Normal file
22
packages/mobile-experience/package.js
Normal file
@@ -0,0 +1,22 @@
|
||||
Package.describe({
|
||||
name: 'mobile-experience',
|
||||
version: '1.0.0',
|
||||
// Brief, one-line summary of the package.
|
||||
summary: 'Packages for a great mobile user experience',
|
||||
// By default, Meteor will default to using README.md for documentation.
|
||||
// To avoid submitting documentation, set this field to null.
|
||||
documentation: 'README.md'
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.imply([
|
||||
// Fastclick: remove the 300 ms click event lag in mobile browsers
|
||||
"fastclick",
|
||||
|
||||
// A nicer appearance for the status bar in PhoneGap/Cordova apps
|
||||
"mobile-status-bar",
|
||||
|
||||
// Show a nice splash image while your PhoneGap/Cordova app's UI is loading
|
||||
"launch-screen"
|
||||
], "web.cordova");
|
||||
});
|
||||
@@ -4,9 +4,17 @@
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-platform
|
||||
standard-minifiers # JS/CSS minifiers run for production mode
|
||||
autopublish # publishes all data to the clients for prototyping
|
||||
insecure # allows all DB writes from clients for prototyping
|
||||
es5-shim # ECMAScript 5 compatibility for older browsers.
|
||||
ecmascript # allows ECMAScript2015+ syntax by default
|
||||
meteor-base # Packages every Meteor app needs to have
|
||||
mobile-experience # Packages for a great mobile UX
|
||||
mongo # The database Meteor supports right now
|
||||
blaze-html-templates # Compile .html files into Meteor Blaze views
|
||||
session # Client-side reactive dictionary for your app
|
||||
jquery # Helpful client-side library
|
||||
tracker # Meteor's client-side reactive programming library
|
||||
|
||||
standard-minifiers # JS/CSS minifiers run for production mode
|
||||
es5-shim # ECMAScript 5 compatibility for older browsers.
|
||||
ecmascript # Enable ECMAScript2015+ syntax in app code
|
||||
|
||||
autopublish # Publish all data to the clients (for prototyping)
|
||||
insecure # Allow all DB writes from clients (for prototyping)
|
||||
|
||||
@@ -132,6 +132,37 @@ var upgradersByName = {
|
||||
projectContext.projectConstraintsFile.addConstraints(
|
||||
['standard-minifiers']);
|
||||
projectContext.projectConstraintsFile.writeIfModified();
|
||||
},
|
||||
|
||||
"1.2.0-meteor-platform-split": function (projectContext) {
|
||||
const packagesFile = projectContext.projectConstraintsFile;
|
||||
// meteor-platform is split into a series of smaller umbrella packages
|
||||
// Only run this upgrader if the app has meteor-platform
|
||||
if (packagesFile.getConstraint('meteor-platform')) {
|
||||
packagesFile.removePackages(['meteor-platform']);
|
||||
|
||||
packagesFile.addConstraints([
|
||||
// These packages replace meteor-platform in newly created apps
|
||||
'meteor-base',
|
||||
'mobile-experience',
|
||||
'mongo',
|
||||
'blaze-html-templates',
|
||||
'session',
|
||||
'jquery',
|
||||
'tracker',
|
||||
|
||||
// These packages are not in newly created apps, but were in
|
||||
// meteor-platform so we need to add them just in case
|
||||
'logging',
|
||||
'reload',
|
||||
'random',
|
||||
'ejson',
|
||||
'spacebars',
|
||||
'check',
|
||||
].map((pkgName) => {return {package: pkgName}}));
|
||||
|
||||
packagesFile.writeIfModified();
|
||||
}
|
||||
}
|
||||
|
||||
////////////
|
||||
|
||||
Reference in New Issue
Block a user