diff --git a/.gitignore b/.gitignore index e63ef8d268d..245f622e049 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ TAGS *.log *.out npm-debug.log +universe diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000000..7132327b506 --- /dev/null +++ b/.mailmap @@ -0,0 +1,54 @@ +# This makes it easier to find GitHub usernames for History.md. +# +# This controls 'git shortlog'. eg, run: +# git shortlog -s release/0.6.5.1..HEAD +# to get a sorted list of all committers to revisions in HEAD but not +# in 0.6.5.1. +# +# For any emails that show up in the shortlog that aren't in one of +# these lists, figure out their GitHub username and add them. + +GITHUB: AlexeyMK +GITHUB: ansman +GITHUB: awwx +GITHUB: codeinthehole +GITHUB: dandv +GITHUB: DenisGorbachev +GITHUB: emgee3 +GITHUB: EOT +GITHUB: FooBarWidget +GITHUB: jacott +GITHUB: Maxhodges +GITHUB: meawoppl +GITHUB: mitar +GITHUB: mitar +GITHUB: mizzao +GITHUB: mquandalle +GITHUB: nathan-muir +GITHUB: RobertLowe +GITHUB: ryw +GITHUB: rzymek +GITHUB: sdarnell +GITHUB: timhaines +GITHUB: jfhamlin +GITHUB: marcandre +GITHUB: michaelbishop +GITHUB: OyoKooN +GITHUB: paulswartz +GITHUB: rdickert +GITHUB: icellan +GITHUB: yeputons + +METEOR: avital +METEOR: debergalis +METEOR: dgreensp +METEOR: estark37 +METEOR: estark37 +METEOR: glasser +METEOR: gschmidt +METEOR: karayu +METEOR: n1mmy +METEOR: sixolet +METEOR: Slava +METEOR: stubailo +METEOR: ekatek diff --git a/Contributing.md b/Contributing.md index 3e9bb81858b..aec5918026c 100644 --- a/Contributing.md +++ b/Contributing.md @@ -1,45 +1,14 @@ -### Filing Bug Reports +### Contributing to Meteor -If you've found a bug in Meteor, file a bug report in [our issue -tracker](https://github.com/meteor/meteor/issues). If the issue contains -sensitive information or raises a security concern, email -security[]()@[]()meteor.com instead, which will page the -security team. - -A Meteor app has many moving parts, and it's often difficult to reproduce a bug -based on just a few lines of code. If you want somebody to be able to fix a bug -(or verify a fix that you've contributed), the best way is: - -* Create a new Meteor app that displays the bug with as little code as possible. Try to delete any code that is unrelated to the precise bug you're reporting. -* Create a new GitHub repository with a name like `meteor-reactivity-bug` (or if you're adding a new reproduction recipe to an existing issue, `meteor-issue-321`) and push your code to it. (Make sure to include the `.meteor/packages` file!) -* Reproduce the bug from scratch, starting with a `git clone` command. Copy and paste the entire command-line input and output, starting with the `git clone` command, into the issue description of a new GitHub issue. Also describe any web browser interaction you need to do. -* Specify what version of Meteor (`$ meteor --version`) and what web browser you used. - -By making it as easy as possible for others to reproduce your bug, you make it easier for your bug to be fixed. **We're not always able to tackle issues opened without a reproduction recipe. In those cases we'll close them with a pointer to this wiki section and a request for more information.** - - -### Contributing code to the Meteor project +Thank you for contributing to the Meteor project! -Before submitting a pull request, make sure that it follows these guidelines: +Before you file a bug or pull request, please read our +[contributing guidelines](https://github.com/meteor/meteor/wiki/Contributing-to-Meteor) +on GitHub for more details on how to file a bug report or submit a +pull request. -* Make sure that your branch is based off of the **devel** branch. The **devel** branch is where active development happens. **We can't merge non-trivial patches off master.** -* Sign the [contributor's agreement](http://contribute.meteor.com/). -* Follow the [Meteor style guide](https://github.com/meteor/meteor/wiki/Meteor-Style-Guide). -* Limit yourself to one feature or bug fix per pull request. -* Name your branch to match the feature/bug fix that you are submitting. -* Write clear, descriptive commit messages. -* Describe your pull request in as much detail as possible: why this pull request is important enough for us to consider, what changes it contains, what you had to do to get it to work, how you tested it, etc. Be detailed but be clear: use bullets, examples if needed, and simple, straightforward language. - -If you're working on a big ticket item, please check in on [meteor-core](http://groups.google.com/group/meteor-core). We'd hate to have to steer you in a different direction after you've already put in a lot of hard work. - -### Package Submission Guidelines - -We recommend submitting most new smart packages to [Atmosphere](https://atmosphere.meteor.com), rather than submitting a pull request. - -If you submit a smart package pull request, we want to see strong community interest in the package before we include it in a Meteor release. Usage on atmosphere or comments on the pull request are great for this. This helps us keep Meteor core clean and streamlined. - -* Your package should have tests. See `packages/coffeescript` or `packages/less` for examples. -* Your package should be documented. See `docs/client/packages`. -* Because the package API is still in flux, and because you can include client-side JS/CSS files directly in your project's `client/lib` directory, the bar is higher for new packages that only include client-side JS/CSS files. -* Similarly, the bar is higher for new packages that only include JS files with minimal integration. Generally, the test is whether a file can simply be put into your project's `lib` or `server/lib` directory, or if additional effort is needed to make it work. -* Meteor minifies all JS/CSS. Packages should include only the original JS/CSS files, not the minified versions. +*Please do not file security issues in the GitHub issue tracker.* If +the issue you've found +contains sensitive information or raises a security concern, email +security[]()@[]()meteor.com instead, which will page the +security team. diff --git a/History.md b/History.md index fe9e111e080..26d2b791e39 100644 --- a/History.md +++ b/History.md @@ -1,5 +1,728 @@ +## v.NEXT + +## v0.7.1.2 + +* Fix bug in tool error handling that caused `meteor` to crash on Mac + OSX when no computer name is set. + +* Work around a bug that caused MongoDB to fail an assertion when using + tailable cursors on non-oplog collections. + + +## v0.7.1.1 + +* Integrate with Meteor developer accounts, a new way of managing your + meteor.com deployed sites. When you use `meteor deploy`, you will be + prompted to create a developer account. + - Once you've created a developer account, you can log in and out + from the command line with `meteor login` and `meteor logout`. + - You can claim legacy sites with `meteor claim`. This command will + prompt you for your site password if you are claiming a + password-protected site; after claiming it, you will not need to + enter the site password again. + - You can add or remove authorized users, and view the list of + authorized users, for a site with `meteor authorized`. + - You can view your current username with `meteor whoami`. + - This release also includes the `accounts-meteor-developer` package + for building Meteor apps that allow users to log in with their own + developer accounts. + +* Improve the oplog tailing implementation for getting real-time database + updates from MongoDB. + - Add support for all operators except `$where` and `$near`. Limit and + skip are not supported yet. + - Add optimizations to avoid needless data fetches from MongoDB. + - Fix an error ("Cannot call method 'has' of null") in an oplog + callback. #1767 + +* Add and improve support for minimongo operators. + - Support `$comment`. + - Support `obj` name in `$where`. + - `$regexp` matches actual regexps properly. + - Improve support for `$nin`, `$ne`, `$not`. + - Support using `{ $in: [/foo/, /bar/] }`. #1707 + - Support `{$exists: false}`. + - Improve type-checking for selectors. + - Support `{x: {$elemMatch: {$gt: 5}}}`. + - Match Mongo's behavior better when there are arrays in the document. + - Support `$near` with sort. + - Implement updates with `{ $set: { 'a.$.b': 5 } }`. + - Support `{$type: 4}` queries. + - Optimize `remove({})` when observers are paused. + - Make update-by-id constant time. + - Allow `{$set: {'x._id': 1}}`. #1794 + +* Upgraded dependencies + - node: 0.10.25 (from 0.10.22). The workaround for specific Node + versions from 0.7.0 is now removed; 0.10.25+ is supported. + - jquery: 1.11.0 (from 1.8.2). See + http://jquery.com/upgrade-guide/1.9/ for upgrade instructions. + - jquery-waypoints: 2.0.4 (from 1.1.7). Contains + backwards-incompatible changes. + - source-map: 0.3.2 (from 0.3.30) #1782 + - websocket-driver: 0.3.2 (from 0.3.1) + - http-proxy: 1.0.2 (from a pre-release fork of 1.0) + - semver: 2.2.1 (from 2.1.0) + - request: 2.33.0 (from 2.27.0) + - fstream: 0.1.25 (from 0.1.24) + - tar: 0.1.19 (from 0.1.18) + - eachline: a fork of 2.4.0 (from 2.3.3) + - source-map: 0.1.31 (from 0.1.30) + - source-map-support: 0.2.5 (from 0.2.3) + - mongo: 2.4.9 (from 2.4.8) + - openssl in mongo: 1.0.1f (from 1.0.1e) + - kexec: 0.2.0 (from 0.1.1) + - less: 1.6.1 (from 1.3.3) + - stylus: 0.42.2 (from 0.37.0) + - nib: 1.0.2 (from 1.0.0) + - coffeescript: 1.7.1 (from 1.6.3) + +* CSS preprocessing and sourcemaps: + - Add sourcemap support for CSS stylesheet preprocessors. Use + sourcemaps for stylesheets compiled with LESS. + - Improve CSS minification to deal with `@import` statements correctly. + - Lint CSS files for invalid `@` directives. + - Change the recommended suffix for imported LESS files from + `.lessimport` to `.import.less`. Add `.import.styl` to allow + `stylus` imports. `.lessimport` continues to work but is deprecated. + +* Add `clientAddress` and `httpHeaders` to `this.connection` in method + calls and publish functions. + +* Hash login tokens before storing them in the database. Legacy unhashed + tokens are upgraded to hashed tokens in the database as they are used + in login requests. + +* Change default accounts-ui styling and add more CSS classes. + +* Refactor command-line tool. Add test harness and better tests. Run + `meteor self-test --help` for info on running the tools test suite. + +* Speed up application re-build in development mode by re-using file + hash computation between file change watching code and application + build code.. + +* Fix issues with documents containing a key named `length` with a + numeric value. Underscore treated these as arrays instead of objects, + leading to exceptions when . Patch Underscore to not treat plain + objects (`x.constructor === Object`) with numeric `length` fields as + arrays. #594 #1737 + +* Deprecate `Accounts.loginServiceConfiguration` in favor of + `ServiceConfiguration.configurations`, exported by the + `service-configuration` package. `Accounts.loginServiceConfiguration` + is maintained for backwards-compatibility, but it is defined in a + `Meteor.startup` block and so cannot be used from top-level code. + +* Cursors with a field specifier containing `{_id: 0}` can no longer be + used with `observeChanges` or `observe`. This includes the implicit + calls to these functions that are done when returning a cursor from a + publish function or using `{{#each}}`. + +* Transform functions must return objects and may not change the `_id` + field, though they may leave it out. + +* Remove broken IE7 support from the `localstorage` package. Meteor + accounts logins no longer persist in IE7. + +* Fix the `localstorage` package when used with Safari in private + browsing mode. This fixes a problem with login token storage and + account login. #1291 + +* Types added with `EJSON.addType` now have default `clone` and `equals` + implementations. Users may still specify `clone` or `equals` functions + to override the default behavior. #1745 + +* Add `frame-src` to `browser-policy-content` and account for + cross-browser CSP disparities. + +* Deprecate `Oauth.initiateLogin` in favor of `Oauth.showPopup`. + +* Add `WebApp.rawConnectHandlers` for adding connect handlers that run + before any other Meteor handlers, except `connect.compress()`. Raw + connect handlers see the URL's full path (even if ROOT_URL contains a + non-empty path) and they run before static assets are served. + +* Add `Accounts.connection` to allow using Meteor accounts packages with + a non-default DDP connection. -## vNEXT +* Detect and reload if minified CSS files fail to load at startup. This + prevents the application from running unstyled if the page load occurs + while the server is switching versions. + +* Allow Npm.depends to specify any http or https URL containing a full + 40-hex-digit SHA. #1686 + +* Add `retry` package for connection retry with exponential backoff. + +* Pass `update` and `remove` return values correctly when using + collections validated with `allow` and `deny` rules. #1759 + +* If you're using Deps on the server, computations and invalidation + functions are not allowed to yield. Throw an error instead of behaving + unpredictably. + +* Fix namespacing in coffeescript files added to a package with the + `bare: true` option. #1668 + +* Fix races when calling login and/or logoutOtherClients from multiple + tabs. #1616 + +* Include oauth_verifier as a header rather than a parameter in + the `oauth1` package. #1825 + +* Fix `force-ssl` to allow local development with `meteor run` in IPv6 + environments. #1751` + +* Allow cursors on named local collections to be returned from a publish + function in an array. #1820 + +* Fix build failure caused by a directory in `programs/` without a + package.js file. + +* Do a better job of handling shrinkwrap files when an npm module + depends on something that isn't a semver. #1684 + +* Fix failures updating npm dependencies when a node_modules directory + exists above the project directory. #1761 + +* Preserve permissions (eg, executable bit) on npm files. #1808 + +* SockJS tweak to support relative base URLs. + +* Don't leak sockets on error in dev-mode proxy. + +* Clone arguments to `added` and `changed` methods in publish + functions. This allows callers to reuse objects and prevents already + published data from changing after the fact. #1750 + +* Ensure springboarding to a different meteor tools version always uses + `exec` to run the old version. This simplifies process management for + wrapper scripts. + +Patches contributed by GitHub users DenisGorbachev, EOT, OyoKooN, awwx, +dandv, icellan, jfhamlin, marcandre, michaelbishop, mitar, mizzao, +mquandalle, paulswartz, rdickert, rzymek, timhaines, and yeputons. + + +## v0.7.0.1 + +* Two fixes to `meteor run` Mongo startup bugs that could lead to hangs with the + message "Initializing mongo database... this may take a moment.". #1696 + +* Apply the Node patch to 0.10.24 as well (see the 0.7.0 section for details). + +* Fix gratuitous IE7 incompatibility. #1690 + + +## v0.7.0 + +This version of Meteor contains a patch for a bug in Node 0.10 which +most commonly affects websockets. The patch is against Node version +0.10.22 and 0.10.23. We strongly recommend using one of these precise +versions of Node in production so that the patch will be applied. If you +use a newer version of Node with this version of Meteor, Meteor will not +apply the patch and will instead disable websockets. + +* Rework how Meteor gets realtime database updates from MongoDB. Meteor + now reads the MongoDB "oplog" -- a special collection that records all + the write operations as they are applied to your database. This means + changes to the database are instantly noticed and reflected in Meteor, + whether they originated from Meteor or from an external database + client. Oplog tailing is automatically enabled in development mode + with `meteor run`, and can be enabled in production with the + `MONGO_OPLOG_URL` environment variable. Currently the only supported + selectors are equality checks; `$`-operators, `limit` and `skip` + queries fall back to the original poll-and-diff algorithm. See + https://github.com/meteor/meteor/wiki/Oplog-Observe-Driver + for details. + +* Add `Meteor.onConnection` and add `this.connection` to method + invocations and publish functions. These can be used to store data + associated with individual clients between subscriptions and method + calls. See http://docs.meteor.com/#meteor_onconnection for details. #1611 + +* Bundler failures cause non-zero exit code in `meteor run`. #1515 + +* Fix error when publish function callbacks are called during session shutdown. + +* Rework hot code push. The new `autoupdate` package drives automatic + reloads on update using standard DDP messages instead of a hardcoded + message at DDP startup. Now the hot code push only triggers when + client code changes; server-only code changes will not cause the page + to reload. + +* New `facts` package publishes internal statistics about Meteor. + +* Add an explicit check that publish functions return a cursor, an array + of cursors, or a falsey value. This is a safety check to to prevent + users from accidentally returning Collection.findOne() or some other + value and expecting it to be published. + +* Implement `$each`, `$sort`, and `$slice` options for minimongo's `$push` + modifier. #1492 + +* Introduce `--raw-logs` option to `meteor run` to disable log + coloring and timestamps. + +* Add `WebAppInternals.setBundledJsCssPrefix()` to control where the + client loads bundled JavaScript and CSS files. This allows serving + files from a CDN to decrease page load times and reduce server load. + +* Attempt to exit cleanly on `SIGHUP`. Stop accepting incoming + connections, kill DDP connections, and finish all outstanding requests + for static assets. + +* In the HTTP server, only keep sockets with no active HTTP requests alive for 5 + seconds. + +* Fix handling of `fields` option in minimongo when only `_id` is present. #1651 + +* Fix issue where setting `process.env.MAIL_URL` in app code would not + alter where mail was sent. This was a regression in 0.6.6 from 0.6.5. #1649 + +* Use stderr instead of stdout (for easier automation in shell scripts) when + prompting for passwords and when downloading the dev bundle. #1600 + +* Ensure more downtime during file watching. #1506 + +* Fix `meteor run` with settings files containing non-ASCII characters. #1497 + +* Support `EJSON.clone` for `Meteor.Error`. As a result, they are properly + stringified in DDP even if thrown through a `Future`. #1482 + +* Fix passing `transform: null` option to `collection.allow()` to disable + transformation in validators. #1659 + +* Fix livedata error on `this.removed` during session shutdown. #1540 #1553 + +* Fix incompatibility with Phusion Passenger by removing an unused line. #1613 + +* Ensure install script creates /usr/local on machines where it does not + exist (eg. fresh install of OSX Mavericks). + +* Set x-forwarded-* headers in `meteor run`. + +* Clean up package dirs containing only ".build". + +* Check for matching hostname before doing end-of-oauth redirect. + +* Only count files that actually go in the cache towards the `appcache` + size check. #1653. + +* Increase the maximum size spiderable will return for a page from 200kB + to 5MB. + +* New 'facts' package publishes internal statistics about Meteor. + +* Upgraded dependencies: + * SockJS server from 0.3.7 to 0.3.8, including new faye-websocket module. + * Node from 0.10.21 to 0.10.22 + * MongoDB from 2.4.6 to 2.4.8 + * clean-css from 1.1.2 to 2.0.2 + * uglify-js from a fork of 2.4.0 to 2.4.7 + * handlebars npm module no longer available outside of handlebars package + +Patches contributed by GitHub users AlexeyMK, awwx, dandv, DenisGorbachev, +emgee3, FooBarWidget, mitar, mcbain, rzymek, and sdarnell. + + +## v0.6.6.3 + +* Fix error when publish function callbacks are called during session + shutdown. #1540 #1553 + +* Improve `meteor run` CPU usage in projects with many + directories. #1506 + + +## v0.6.6.2 + +* Upgrade Node from 0.10.20 to 0.10.21 (security update). + + +## v0.6.6.1 + +* Fix file watching on OSX. Work around Node issue #6251 by not using + fs.watch. #1483 + + +## v0.6.6 + + +#### Security + +* Add `browser-policy` package for configuring and sending + Content-Security-Policy and X-Frame-Options HTTP headers. + [See the docs](http://docs.meteor.com/#browserpolicy) for more. + +* Use cryptographically strong pseudorandom number generators when available. + +#### MongoDB + +* Add upsert support. `Collection.update` now supports the `{upsert: + true}` option. Additionally, add a `Collection.upsert` method which + returns the newly inserted object id if applicable. + +* `update` and `remove` now return the number of documents affected. #1046 + +* `$near` operator for `2d` and `2dsphere` indices. + +* The `fields` option to the collection methods `find` and `findOne` now works + on the client as well. (Operators such as `$elemMatch` and `$` are not yet + supported in `fields` projections.) #1287 + +* Pass an index and the cursor itself to the callbacks in `cursor.forEach` and + `cursor.map`, just like the corresponding `Array` methods. #63 + +* Support `c.find(query, {limit: N}).count()` on the client. #654 + +* Improve behavior of `$ne`, `$nin`, and `$not` selectors with objects containing + arrays. #1451 + +* Fix various bugs if you had two documents with the same _id field in + String and ObjectID form. + +#### Accounts + +* [Behavior Change] Expire login tokens periodically. Defaults to 90 + days. Use `Accounts.config({loginExpirationInDays: null})` to disable + token expiration. + +* [Behavior Change] Write dates generated by Meteor Accounts to Mongo as + Date instead of number; existing data can be converted by passing it + through `new Date()`. #1228 + +* Log out and close connections for users if they are deleted from the + database. + +* Add Meteor.logoutOtherClients() for logging out other connections + logged in as the current user. + +* `restrictCreationByEmailDomain` option in `Accounts.config` to restrict new + users to emails of specific domain (eg. only users with @meteor.com emails) or + a custom validator. #1332 + +* Support OAuth1 services that require request token secrets as well as + authentication token secrets. #1253 + +* Warn if `Accounts.config` is only called on the client. #828 + +* Fix bug where callbacks to login functions could be called multiple + times when the client reconnects. + +#### DDP + +* Fix infinite loop if a client disconnects while a long yielding method is + running. + +* Unfinished code to support DDP session resumption has been removed. Meteor + servers now stop processing messages from clients and reclaim memory + associated with them as soon as they are disconnected instead of a few minutes + later. + +#### Tools + +* The pre-0.6.5 `Package.register_extension` API has been removed. Use + `Package._transitional_registerBuildPlugin` instead, which was introduced in + 0.6.5. (A bug prevented the 0.6.5 reimplementation of `register_extension` + from working properly anyway.) + +* Support using an HTTP proxy in the `meteor` command line tool. This + allows the `update`, `deploy`, `logs`, and `mongo` commands to work + behind a proxy. Use the standard `http_proxy` environment variable to + specify your proxy endpoint. #429, #689, #1338 + +* Build Linux binaries on an older Linux machine. Meteor now supports + running on Linux machines with glibc 2.9 or newer (Ubuntu 10.04+, RHEL + and CentOS 6+, Fedora 10+, Debian 6+). Improve error message when running + on Linux with unsupported glibc, and include Mongo stderr if it fails + to start. + +* Install NPM modules with `--force` to avoid corrupted local caches. + +* Rebuild NPM modules in packages when upgrading to a version of Meteor that + uses a different version of Node. + +* Disable the Mongo http interface. This lets you run meteor on two ports + differing by 1000 at the same time. + +#### Misc + +* [Known issue] Breaks support for pre-release OSX 10.9 'Mavericks'. + Will be addressed shortly. See issues: + https://github.com/joyent/node/issues/6251 + https://github.com/joyent/node/issues/6296 + +* `EJSON.stringify` now takes options: + - `canonical` causes objects keys to be stringified in sorted order + - `indent` allows formatting control over the EJSON stringification + +* EJSON now supports `Infinity`, `-Infinity` and `NaN`. + +* Check that the argument to `EJSON.parse` is a string. #1401 + +* Better error from functions that use `Meteor._wrapAsync` (eg collection write + methods and `HTTP` methods) and in DDP server message processing. #1387 + +* Support `appcache` on Chrome for iOS. + +* Support literate CoffeeScript files with the extension `.coffee.md` (in + addition to the already-supported `.litcoffee` extension). #1407 + +* Make `madewith` package work again (broken in 0.6.5). #1448 + +* Better error when passing a string to `{{#each}}`. #722 + +* Add support for JSESSIONID cookies for sticky sessions. Set the + `USE_JSESSIONID` environment variable to enable placing a JSESSIONID + cookie on sockjs requests. + +* Simplify the static analysis used to detect package-scope variables. + +* Upgraded dependencies: + * Node from 0.8.24 to 0.10.20 + * MongoDB from 2.4.4 to 2.4.6 + * MongoDB driver from 1.3.17 to 1.3.19 + * http-proxy from 0.10.1 to a pre-release of 1.0.0 + * stylus from 0.30.1 to 0.37.0 + * nib from 0.8.2 to 1.0.0 + * optimist from 0.3.5 to 0.6.0 + * semver from 1.1.0 to 2.1.0 + * request from 2.12.0 to 2.27.0 + * keypress from 0.1.0 to 0.2.1 + * underscore from 1.5.1 to 1.5.2 + * fstream from 0.1.21 to 0.1.24 + * tar from 0.1.14 to 0.1.18 + * source-map from 0.1.26 to 0.1.30 + * source-map-support from a fork of 0.1.8 to 0.2.3 + * escope from a fork of 0.0.15 to 1.0.0 + * estraverse from 1.1.2-1 to 1.3.1 + * simplesmtp from 0.1.25 to 0.3.10 + * stream-buffers from 0.2.3 to 0.2.5 + * websocket from 1.0.7 to 1.0.8 + * cli-color from 0.2.2 to 0.2.3 + * clean-css from 1.0.11 to 1.1.2 + * UglifyJS2 from a fork of 2.3.6 to a different fork of 2.4.0 + * connect from 2.7.10 to 2.9.0 + * send from 0.1.0 to 0.1.4 + * useragent from 2.0.1 to 2.0.7 + * replaced byline with eachline 2.3.3 + +Patches contributed by GitHub users ansman, awwx, codeinthehole, jacott, +Maxhodges, meawoppl, mitar, mizzao, mquandalle, nathan-muir, RobertLowe, ryw, +sdarnell, and timhaines. + + +## v0.6.5.2 + +* Upgrade Node from 0.8.24 to 0.8.26 (security patch) + + +## v0.6.5.1 + +* Fix syntax errors on lines that end with a backslash. #1326 + +* Fix serving static files with special characters in their name. #1339 + +* Upgrade `esprima` JavaScript parser to fix bug parsing complex regexps. + +* Export `Spiderable` from `spiderable` package to allow users to set + `Spiderable.userAgentRegExps` to control what user agents are treated + as spiders. + +* Add EJSON to standard-app-packages. #1343 + +* Fix bug in d3 tab character parsing. + +* Fix regression when using Mongo ObjectIDs in Spark templates. + + +## v0.6.5 + +* New package system with package compiler and linker: + + * Each package now has it own namespace for variable + declarations. Global variables used in a package are limited to + package scope. + + * Packages must explicitly declare which symbols they export with + `api.export` in `package.js`. + + * Apps and packages only see the exported symbols from packages they + explicitly use. For example, if your app uses package A which in + turn depends on package B, only package A's symbols will be + available in the app. + + * Package names can only contain alphanumeric characters, dashes, and + dots. Packages with spaces and underscores must be renamed. + + * Remove hardcoded list of required packages. New default + `standard-app-packages` package adds dependencies on the core Meteor + stack. This package can be removed to make an app with only parts of + the Meteor stack. `standard-app-packages` will be automatically + added to a project when it is updated to Meteor 0.6.5. + + * Custom app packages in the `packages` directory are no longer + automatically used. They must be explicitly added to the app with + `meteor add `. To help with the transition, all + packages in the `packages` directory will be automatically added to + the project when it is updated to Meteor 0.6.5. + + * New "unipackage" on-disk format for built packages. Compiled packages are + cached and rebuilt only when their source or dependencies change. + + * Add "unordered" and "weak" package dependency modes to allow + circular package dependencies and conditional code inclusion. + + * New API (`_transitional_registerBuildPlugin`) for declaring + compilers, preprocessors, and file extension handlers. These new + build plugins are full compilation targets in their own right, and + have their own namespace, source files, NPM requirements, and package + dependencies. The old `register_extension` API is deprecated. Please + note that the `package.js` format and especially + `_transitional_registerBuildPlugin` are not frozen interfaces and + are subject to change in future releases. + + * Add `api.imply`, which allows one package to "imply" another. If + package A implies package B, then anything that depends on package + A automatically depends on package B as well (and receives package + B's imports). This is useful for creating umbrella packages + (`standard-app-packages`) or sometimes for factoring common code + out of related packages (`accounts-base`). + +* Move HTTP serving out of the server bootstrap and into the `webapp` + package. This allows building Meteor apps that are not web servers + (eg. command line tools, DDP clients, etc.). Connect middlewares can + now be registered on the new `WebApp.connectHandlers` instead of the + old `__meteor_bootstrap__.app`. + +* The entire Meteor build process now has first-class source map + support. A source map is maintained for every source file as it + passes through the build pipeline. Currently, the source maps are + only served in development mode. Not all web browsers support source + maps yet and for those that do, you may have to turn on an option to + enable them. Source maps will always be used when reporting + exceptions on the server. + +* Update the `coffeescript` package to generate source maps. + +* Add new `Assets` API and `private` subdirectory for including and + accessing static assets on the server. http://docs.meteor.com/#assets + +* Add `Meteor.disconnect`. Call this to disconnect from the + server and stop all live data updates. #1151 + +* Add `Match.Integer` to `check` for 32-bit signed integers. + +* `Meteor.connect` has been renamed to `DDP.connect` and is now fully + supported on the server. Server-to-server DDP connections use + websockets, and can be used for both method calls and subscriptions. + +* Rename `Meteor.default_connection` to `Meteor.connection` and + `Meteor.default_server` to `Meteor.server`. + +* Rename `Meteor.http` to `HTTP`. + +* `ROOT_URL` may now have a path part. This allows serving multiple + Meteor apps on the same domain. + +* Support creating named unmanaged collections with + `new Meteor.Collection("name", {connection: null})`. + +* New `Log` function in the `logging` package which prints with + timestamps, color, filenames and linenumbers. + +* Include http response in errors from oauth providers. #1246 + +* The `observe` callback `movedTo` now has a fourth argument `before`. + +* Move NPM control files for packages from `.npm` to + `.npm/package`. This is to allow build plugins such as `coffeescript` + to depend on NPM packages. Also, when removing the last NPM + dependency, clean up the `.npm` dir. + +* Remove deprecated `Meteor.is_client` and `Meteor.is_server` variables. + +* Implement "meteor bundle --debug" #748 + +* Add `forceApprovalPrompt` option to `Meteor.loginWithGoogle`. #1226 + +* Make server-side Mongo `insert`s, `update`s, and `remove`s run + asynchronously when a callback is passed. + +* Improve memory usage when calling `findOne()` on the server. + +* Delete login tokens from server when user logs out. + +* Rename package compatibility mode option to `add_files` from `raw` to + `bare`. + +* Fix Mongo selectors of the form: {$regex: /foo/}. + +* Fix Spark memory leak. #1157 + +* Fix EPIPEs during dev mode hot code reload. + +* Fix bug where we would never quiesce if we tried to revive subs that errored + out (5e7138d) + +* Fix bug where `this.fieldname` in handlebars template might refer to a + helper instead of a property of the current data context. #1143 + +* Fix submit events on IE8. #1191 + +* Handle `Meteor.loginWithX` being called with a callback but no options. #1181 + +* Work around a Chrome bug where hitting reload could cause a tab to + lose the DDP connection and never recover. #1244 + +* Upgraded dependencies: + * Node from 0.8.18 to 0.8.24 + * MongoDB from 2.4.3 to 2.4.4, now with SSL support + * CleanCSS from 0.8.3 to 1.0.11 + * Underscore from 1.4.4 to 1.5.1 + * Fibers from 1.0.0 to 1.0.1 + * MongoDB Driver from 1.3.7 to 1.3.17 + +Patches contributed by GitHub users btipling, mizzao, timhaines and zol. + + +## v0.6.4.1 + +* Update mongodb driver to use version 0.2.1 of the bson module. + + +## v0.6.4 + +* Separate OAuth flow logic from Accounts into separate packages. The + `facebook`, `github`, `google`, `meetup`, `twitter`, and `weibo` + packages can be used to perform an OAuth exchange without creating an + account and logging in. #1024 + +* If you set the `DISABLE_WEBSOCKETS` environment variable, browsers will not + attempt to connect to your app using Websockets. Use this if you know your + server environment does not properly proxy Websockets to reduce connection + startup time. + +* Make `Meteor.defer` work in an inactive tab in iOS. #1023 + +* Allow new `Random` instances to be constructed with specified seed. This + can be used to create repeatable test cases for code that picks random + values. #1033 + +* Fix CoffeeScript error reporting to include source file and line + number again. #1052 + +* Fix Mongo queries which nested JavaScript RegExp objects inside `$or`. #1089 + +* Upgraded dependencies: + * Underscore from 1.4.2 to 1.4.4 #776 + * http-proxy from 0.8.5 to 0.10.1 #513 + * connect from 1.9.2 to 2.7.10 + * Node mongodb client from 1.2.13 to 1.3.7 #1060 + +Patches contributed by GitHub users awwx, johnston, and timhaines. ## v0.6.3 @@ -150,8 +873,8 @@ Patches contributed by GitHub users andreas-karlsson and awwx. * `{{#with}}` helper now only includes its block if its argument is not falsey, and runs an `{{else}}` block if provided if the argument is falsey. #770, #866 -* Twitter login now stores profile_image_url and profile_image_url_https - attributes in the user.services.twitter namespace. #788 +* Twitter login now stores `profile_image_url` and `profile_image_url_https` + attributes in the `user.services.twitter` namespace. #788 * Allow packages to register file extensions with dots in the filename. @@ -219,7 +942,7 @@ mquandalle, Primigenus, raix, reustle, and timhaines. * Publish functions may now return an array of cursors to publish. Currently, the cursors must all be from different collections. #716 -* User documents have id's when onCreateUser and validateNewUser hooks run. +* User documents have id's when `onCreateUser` and `validateNewUser` hooks run. * Encode and store custom EJSON types in MongoDB. diff --git a/LICENSE.txt b/LICENSE.txt index 2a6fbc3e05f..082c5e26ce2 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -2,7 +2,7 @@ Meteor is licensed under the MIT License ======================================== -Copyright (C) 2011--2012 Meteor Development Group +Copyright (C) 2011--2014 Meteor Development Group Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: @@ -80,9 +80,25 @@ Copyright (c) 2011 GoalSmashers.com ---------- progress: https://github.com/visionmedia/node-progress +qs: https://github.com/visionmedia/node-querystring +debug: https://github.com/visionmedia/debug +nib: https://github.com/visionmedia/nib +bytes: https://github.com/visionmedia/bytes.js +commander: https://github.com/visionmedia/commander.js +fresh: https://github.com/visionmedia/node-fresh +github-url-from-git: https://github.com/visionmedia/node-github-url-from-git +pause: https://github.com/visionmedia/node-pause +range-parser: https://github.com/visionmedia/node-range-parser +send: https://github.com/visionmedia/send +methods: https://github.com/visionmedia/node-methods +css-parse: https://github.com/reworkcss/css-parse +css-stringify: https://github.com/reworkcss/css-stringify ---------- +Copyright (c) 2010 TJ Holowaychuk Copyright (c) 2011 TJ Holowaychuk +Copyright (c) 2012 TJ Holowaychuk +Copyright (c) 2013 TJ Holowaychuk ---------- @@ -179,20 +195,6 @@ rbytes: https://github.com/akdubya/rbytes Copyright (c) 2010 Aleksander Williams ----------- -formidable: https://github.com/felixge/node-formidable ----------- - -By Felix Geisendörfer and Tim Koschuetzki, Debuggable, Ltd. - - ----------- -node-querystring: https://github.com/visionmedia/node-querystring ----------- - -Copyright (c) 2010 TJ Holowaychuk - - ---------- colors: https://github.com/Marak/colors.js ---------- @@ -218,6 +220,7 @@ Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org ---------- node-gyp: https://github.com/TooTallNate/node-gyp keypress: https://github.com/TooTallNate/keypress +bindings: https://github.com/TooTallNate/node-bindings ---------- Copyright (c) 2012 Nathan Rajlich @@ -232,7 +235,7 @@ Copyright (c) 2010 Robert Kieffer ---------- -ansi.js: https://github.com/TooTallNate/ansi.js +ansi: https://github.com/TooTallNate/ansi.js ---------- Copyright (c) 2012 Nathan Rajlich @@ -240,9 +243,11 @@ Copyright (c) 2012 Nathan Rajlich ---------- faye-websocket: https://github.com/faye/faye-websocket-node +websocket-driver: https://github.com/faye/websocket-driver-node ---------- -Copyright (c) 2009-2012 James Coglan +Copyright (c) 2009-2013 James Coglan +Copyright (c) 2010-2013 James Coglan ---------- @@ -252,13 +257,6 @@ cssom: https://github.com/NV/CSSOM Copyright (c) Nikita Vasilyev ----------- -node-debug: https://github.com/visionmedia/debug ----------- - -Copyright (c) 2011 TJ Holowaychuk - - ---------- yamlparser: https://github.com/h4evr/commonjs-javascript-yaml-parser ---------- @@ -268,16 +266,17 @@ Copyright (c) 2011 Diogo Costa (costa.h4evr@gmail.com) ---------- semver: https://github.com/isaacs/node-semver -abbrev-js: https://github.com/isaacs/abbrev-js -node-graceful-fs: https://github.com/isaacs/node-graceful-fs -node-lru-cache: https://github.com/isaacs/node-lru-cache +abbrev: https://github.com/isaacs/abbrev-js +graceful-fs: https://github.com/isaacs/node-graceful-fs +lru-cache: https://github.com/isaacs/node-lru-cache proto-list: https://github.com/isaacs/proto-list rimraf: https://github.com/isaacs/rimraf minimatch: https://github.com/isaacs/minimatch -node-ini: https://github.com/isaacs/ini -node-nopt: https://github.com/isaacs/nopt -slide-flow-control: https://github.com/isaacs/slide-flow-control -node-which: https://github.com/isaacs/node-which +ini: https://github.com/isaacs/ini +nopt: https://github.com/isaacs/nopt +slide: https://github.com/isaacs/slide-flow-control +which: https://github.com/isaacs/node-which +minimatch: https://github.com/isaacs/minimatch ---------- Copyright 2009, 2010, 2011 Isaac Z. Schlueter. @@ -286,20 +285,17 @@ All rights reserved. ---------- optimist: https://github.com/substack/node-optimist -node-mkdirp: https://github.com/substack/node-mkdirp +mkdirp: https://github.com/substack/node-mkdirp wordwrap: https://github.com/substack/node-wordwrap -node-archy: https://github.com/substack/node-archy -node-shell-quote: https://github.com/substack/node-shell-quote ----------- - -Copyright 2010, 2011, 2012 James Halliday (mail@substack.net) - - ----------- -nib: https://github.com/visionmedia/nib +archy: https://github.com/substack/node-archy +deep-equal: https://github.com/substack/node-deep-equal +editor: https://github.com/substack/node-editor +minimist: https://github.com/substack/minimist +quotemeta: https://github.com/substack/quotemeta +text-table: https://github.com/substack/text-table ---------- -Copyright (c) 2011 TJ Holowaychuk +Copyright 2010, 2011, 2012, 2013 James Halliday (mail@substack.net) ---------- @@ -310,22 +306,22 @@ Copyright (c) 2011 Dominic Tarr ---------- -node-async: https://github.com/caolan/async +async: https://github.com/caolan/async ---------- Copyright (c) 2010 Caolan McMahon ---------- -node-combined-stream: https://github.com/felixge/node-combined-stream -node-delayed-stream: https://github.com/felixge/node-delayed-stream +combined-stream: https://github.com/felixge/node-combined-stream +delayed-stream: https://github.com/felixge/node-delayed-stream ---------- Copyright (c) 2011 Debuggable Limited ---------- -node-retry: https://github.com/felixge/node-retry +retry: https://github.com/felixge/node-retry ---------- Copyright (c) 2011: @@ -333,19 +329,230 @@ Tim Koschützki (tim@debuggable.com) Felix Geisendörfer (felix@debuggable.com) ---------- -node-form-data: https://github.com/felixge/node-form-data +form-data: https://github.com/felixge/node-form-data +multiparty: https://github.com/superjoe30/node-multiparty ---------- Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors ---------- -node-kexec: https://github.com/jprichardson/node-kexec +kexec: https://github.com/jprichardson/node-kexec ---------- Copyright (c) 2011-2012 JP Richardson +---------- +setImmediate: https://github.com/NobleJS/setImmediate +---------- + +Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola + + +---------- +asn1: https://github.com/mcavage/node-asn1 +assert-plus: https://github.com/mcavage/node-assert-plus +---------- + +Copyright (c) 2011 Mark Cavage, All rights reserved. + + +---------- +awssum: https://github.com/awssum/awssum +---------- + +Copyright 2011-2013 Apps Attic Ltd. All rights reserved. +Copyright 2013 Andrew Chilton. All rights reserved. + + +---------- +data2xml: https://github.com/chilts/data2xml +---------- + +Copyright 2011-2012 Apps Attic Ltd. All rights reserved. + + +---------- +buffer-crc32: https://github.com/brianloveswords/buffer-crc32 +---------- + +Copyright (c) 2013 Brian J. Brennan + + +---------- +child-process-close: https://github.com/piscisaureus/child-process-close +---------- + +Copyright (C) 2012 Bert Belder + + +---------- +cli-color: https://github.com/medikoo/cli-color +es5-ext: https://github.com/medikoo/es5-ext +event-emitter: https://github.com/medikoo/event-emitter +memoizee: https://github.com/medikoo/memoize +next-tick: https://github.com/medikoo/next-tick +---------- + +Copyright (C) 2011, 2012 Mariusz Nowak (www.medikoo.com) + + +---------- +connect-jsonp: https://github.com/steelThread/connect-jsonp +---------- + +Copyright (c) 2010 Sean McDaniel + + +---------- +cookie: https://github.com/shtylman/node-cookie +---------- + +Copyright (C) Roman Shtylman + + +---------- +cookie-signature: https://github.com/visionmedia/node-cookie-signature +---------- + +Copyright (c) 2012 LearnBoost + + +---------- +dateformat: https://github.com/felixge/node-dateformat +---------- + +(c) 2007-2009 Steven Levithan + + +---------- +eyes: https://github.com/cloudhead/eyes.js +vows: https://github.com/cloudhead/vows +---------- + +Copyright (c) 2009 cloudhead + + +---------- +fmt: https://github.com/appsattic/fmt +---------- + +Copyright © 2012-2013 AppsAttic Ltd + + +---------- +http-signature: https://github.com/joyent/node-http-signature +---------- + +Copyright Joyent, Inc. All rights reserved. + + +---------- +i: https://github.com/pksunkara/inflect +---------- + +Copyright Pavan Kumar Sunkara (pavan.sss1991@gmail.com) + + +---------- +ncp: https://github.com/AvianFlu/ncp +---------- + +Copyright (C) 2011 by Charlie McConnell + + +---------- +passgen: https://github.com/SDA/passgen +---------- + +Copyright (c) 2011 SDA Software Associates Inc. + + +---------- +sha: https://github.com/ForbesLindesay/sha +type-of: https://github.com/ForbesLindesay/type-of +uglify-to-browserify: https://github.com/ForbesLindesay/uglify-to-browserify +---------- + +Copyright (c) 2013 Forbes Lindesay + + +---------- +source-map-support: https://github.com/evanw/node-source-map-support +---------- + +Copyright Evan Wallace + + +---------- +utile: https://github.com/flatiron/utile +---------- + +Copyright (c) 2010 Nodejitsu Inc. + + +---------- +xml: https://github.com/dylang/node-xml +---------- + +Copyright (c) 2011 Dylan Greene + + +---------- +xml2js: https://github.com/Leonidas-from-XIV/node-xml2js +---------- + +Copyright 2010, 2011, 2012, 2013. All rights reserved. + + +---------- +ctype: https://github.com/rmustacc/node-ctype +---------- + +Copyright 2011, Robert Mustacchi. All rights reserved. +Copyright 2011, Joyent, Inc. All rights reserved. + + +---------- +eachline: https://github.com/williamwicks/node-eachline +---------- + +Copyright (c) 2013 William Wicks + + +---------- +eventemitter2: https://github.com/hij1nx/EventEmitter2 +---------- + +Copyright (c) 2011 hij1nx http://www.twitter.com/hij1nx + + +---------- +stream-counter: https://github.com/superjoe30/node-stream-counter +---------- + +Copyright (c) 2013 Andrew Kelley + +---------- +uid2: https://github.com/coreh/uid2 +---------- + +Copyright (c) 2013 Marco Aurelio + +---------- +geojson-utils: https://github.com/maxogden/geojson-js-utils +---------- + +Copyright (c) 2010 Max Ogden + + +---------- +bcrypt: https://github.com/ncb000gt/node.bcrypt.js +---------- + +Copyright (c) 2010 Nicholas Campbell + ============== Apache License @@ -362,7 +569,8 @@ Unless required by applicable law or agreed to in writing, software distributed """ ---------- -mongo-drivers: https://github.com/mongodb/node-mongodb-native +mongodb: (Node driver) https://github.com/mongodb/node-mongodb-native +kerberos: https://github.com/christkv/kerberos ---------- Copyright 2009 - 2010 Christian Amor Kvalheim. @@ -379,7 +587,7 @@ Copyright (c) 2009-2010 Alexis Sellier useragent: https://github.com/fintanf/node-useragent ---------- -This parser is based on the user agent parser; code.google.com/p/ua-parser/ +This parser is based on the user agent parser; code.google.com/p/ua-parser/ which is released under Apache license: Copyright 2009 Google Inc. @@ -387,9 +595,14 @@ Copyright 2009 Google Inc. ---------- request: https://github.com/mikeal/request +aws-sign2: https://github.com/mikeal/aws-sign +cookie-jar: https://github.com/mikeal/cookie-jar +forever-agent: https://github.com/mikeal/forever-agent +oauth-sign: https://github.com/mikeal/oauth-sign +tunnel-agent: https://github.com/mikeal/tunnel-agent ---------- -Copyright (c) 2011 Mikeal Rogers +Copyright (c) 2011, 2012, 2013 Mikeal Rogers ---------- @@ -427,17 +640,59 @@ amdefine: https://github.com/jrburke/amdefine Copyright (c) 2011, The Dojo Foundation +---------- +nlogger: https://github.com/igo/nlogger +---------- + +Copyright (c) 2010 by Igor Urmincek + + +---------- +Diff Match and Patch: http://code.google.com/p/google-diff-match-patch/ +---------- + +Copyright 2006 Google Inc. + + +---------- +ansicolors: https://github.com/thlorenz/ansicolors +ansistyles: https://github.com/thlorenz/ansistyles +---------- + +Copyright 2013 Thorsten Lorenz. + + +---------- +columnify: https://github.com/timoxley/columnify +---------- + +Copyright Tim Oxley + + +---------- +eventemitter3: https://github.com/3rd-Eden/EventEmitter3 +---------- + +Copyright Arnout Kazemier + + +---------- +punycode: https://github.com/bestiejs/punycode.js +---------- + +Copyright Mathias Bynens + + ============ BSD Licenses ============ ---------- -uglify-js: https://github.com/mishoo/UglifyJS +uglify-js: https://github.com/mishoo/UglifyJS2 ---------- -Copyright 2010 (c) Mihai Bazon -Based on parse-js (http://marijn.haverbeke.nl/parse-js/). +Copyright 2012-2013 (c) Mihai Bazon Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -528,12 +783,12 @@ openssl: http://www.openssl.org/ showdown: http://www.attacklab.net/ --------- -Copyright (c) 2007, John Fraser - +Copyright (c) 2007, John Fraser + All rights reserved. -Original Markdown copyright (c) 2004, John Gruber - +Original Markdown copyright (c) 2004, John Gruber + All rights reserved. Redistribution and use in source and binary forms, with or without @@ -581,13 +836,13 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ---------- -node-tar: https://github.com/isaacs/node-tar +tar: https://github.com/isaacs/node-tar fstream: https://github.com/isaacs/fstream fstream-npm: https://github.com/isaacs/fstream-npm fstream-ignore: https://github.com/isaacs/fstream-ignore read: https://github.com/isaacs/read block-stream: https://github.com/isaacs/block-stream -node-glob: https://github.com/isaacs/node-glob +glob: https://github.com/isaacs/node-glob chownr: https://github.com/isaacs/chownr uid-number: https://github.com/isaacs/uid-number sigmund: https://github.com/isaacs/sigmund @@ -632,6 +887,10 @@ npmconf: https://github.com/isaacs/npmconf read-installed: https://github.com/isaacs/read-installed read-package-json: https://github.com/isaacs/read-package-json promzard: https://github.com/isaacs/promzard +chmodr: https://github.com/isaacs/chmodr +cmd-shim: https://github.com/ForbesLindesay/cmd-shim +json-stringify-safe: https://github.com/isaacs/json-stringify-safe +sax: https://github.com/isaacs/sax-js ---------- Copyright (c) Isaac Z. Schlueter ("Author") @@ -713,9 +972,9 @@ the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER @@ -825,6 +1084,263 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +---------- +boom: https://github.com/spumko/boom +---------- + +Copyright (c) 2012-2013, Walmart. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Walmart nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL WALMART BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---------- +hoek: https://github.com/spumko/hoek +---------- + +Copyright (c) 2011-2013, Walmart. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Walmart nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL WALMART BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + * * * + + +Portions of this project were initially based on Postmile, Copyright (c) 2011, Yahoo Inc. +Postmile is published at https://github.com/yahoo/postmile and its licensing terms are +published at https://github.com/yahoo/postmile/blob/master/LICENSE. + + +---------- +cryptiles: https://github.com/hueniverse/cryptiles +hawk: https://github.com/hueniverse/hawk +sntp: https://github.com/hueniverse/sntp +---------- + +Copyright (c) 2012-2013, Eran Hammer. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Eran Hammer nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---------- +diff: https://github.com/kpdecker/jsdiff +---------- + +Software License Agreement (BSD License) + +Copyright (c) 2009-2011, Kevin Decker + +All rights reserved. + +Redistribution and use of this software in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Kevin Decker nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---------- +escope: https://github.com/Constellation/escope +estraverse: https://github.com/Constellation/estraverse +---------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---------- +esprima: https://github.com/ariya/esprima +---------- + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---------- +normalize-package-data: https://github.com/meryn/normalize-package-data +---------- + +This package contains code originally written by Isaac Z. Schlueter. +Used with permission. + +Copyright (c) Meryn Stol ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +---------- +npm-user-validate: https://github.com/robertkowalski/npm-user-validate +github-url-from-username-repo: https://github.com/robertkowalski/github-url-from-username-repo +---------- + +Copyright (c) Robert Kowalski +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ============= Public Domain @@ -868,7 +1384,26 @@ Other ===== ---------- -mimelib: https://github.com/andris9/mimelib +heapdump: https://github.com/bnoordhuis/node-heapdump +---------- + +Copyright (c) 2012, Ben Noordhuis + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +---------- +mimelib-noiconv: https://github.com/andris9/mimelib mailcomposer: https://github.com/andris9/mailcomposer simplesmtp: https://github.com/andris9/simplesmtp rai: https://github.com/andris9/rai @@ -917,6 +1452,7 @@ By Isaac Z. Schlueter (http://blog.izs.me/) ---------- opener: https://github.com/domenic/opener +path-is-inside: https://github.com/domenic/path-is-inside ---------- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE @@ -936,7 +1472,7 @@ opener: https://github.com/domenic/opener ---------- -node-stream-buffer: https://github.com/samcday/node-stream-buffer +stream-buffers: https://github.com/samcday/node-stream-buffer ---------- This is free and unencumbered software released into the public domain. @@ -966,7 +1502,92 @@ For more information, please refer to ---------- -mongodb: http://www.mongodb.org/ +tough-cookie: https://github.com/goinstant/tough-cookie +---------- + +Copyright GoInstant, Inc. and other contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +The following exceptions apply: + +=== + +`pubSufTest()` of generate-pubsuffix.js is in the public domain. + + // Any copyright is dedicated to the Public Domain. + // http://creativecommons.org/publicdomain/zero/1.0/ + +=== + +`public-suffix.txt` was obtained from + +via . + +That file contains the usual Mozilla triple-license, for which this project uses it +under the terms of the MPL 1.1: + + // ***** BEGIN LICENSE BLOCK ***** + // Version: MPL 1.1/GPL 2.0/LGPL 2.1 + // + // The contents of this file are subject to the Mozilla Public License Version + // 1.1 (the "License"); you may not use this file except in compliance with + // the License. You may obtain a copy of the License at + // http://www.mozilla.org/MPL/ + // + // Software distributed under the License is distributed on an "AS IS" basis, + // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + // for the specific language governing rights and limitations under the + // License. + // + // The Original Code is the Public Suffix List. + // + // The Initial Developer of the Original Code is + // Jo Hermans . + // Portions created by the Initial Developer are Copyright (C) 2007 + // the Initial Developer. All Rights Reserved. + // + // Contributor(s): + // Ruben Arakelyan + // Gervase Markham + // Pamela Greene + // David Triendl + // Jothan Frakes + // The kind representatives of many TLD registries + // + // Alternatively, the contents of this file may be used under the terms of + // either the GNU General Public License Version 2 or later (the "GPL"), or + // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + // in which case the provisions of the GPL or the LGPL are applicable instead + // of those above. If you wish to allow use of your version of this file only + // under the terms of either the GPL or the LGPL, and not to allow others to + // use your version of this file under the terms of the MPL, indicate your + // decision by deleting the provisions above and replace them with the notice + // and other provisions required by the GPL or the LGPL. If you do not delete + // the provisions above, a recipient may use your version of this file under + // the terms of any one of the MPL, the GPL or the LGPL. + // + // ***** END LICENSE BLOCK ***** + + + +---------- +MongoDB: http://www.mongodb.org/ ---------- LICENSE @@ -987,7 +1608,7 @@ MongoDB uses third-party libraries or other resources that may be distributed under licenses different than the MongoDB software. In the event that we accidentally failed to list a required notice, -please bring it to our attention through any of the ways detailed here : +please bring it to our attention through any of the ways detailed here : mongodb-dev@googlegroups.com @@ -1270,6 +1891,9 @@ The externally maintained libraries used by libuv are: ---------- nodejs: http://nodejs.org/ +readable-stream: https://github.com/isaacs/readable-stream +npm: https://github.com/isaacs/npm +init-package-json: https://github.com/isaacs/init-package-json ---------- @@ -1500,7 +2124,7 @@ maintained libraries. The externally maintained libraries used by Node are: * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -1571,7 +2195,7 @@ maintained libraries. The externally maintained libraries used by Node are: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. + IN THE SOFTWARE. """ - Closure Linter is located at tools/closure_linter. Closure's license @@ -1738,8 +2362,8 @@ maintained libraries. The externally maintained libraries used by Node are: */ """ -- npm is a package manager program located at deps/npm. - npm's license follows: +- npm is a package manager program located at deps/npm. + npm's license follows: """ Copyright 2009-2012, Isaac Z. Schlueter (the "Original Author") All rights reserved. @@ -1828,6 +2452,33 @@ maintained libraries. The externally maintained libraries used by Node are: +---------- +jsstyle + (Included through the ctype NPM module: lib/node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle) +---------- + +The contents of this file are subject to the terms of the +Common Development and Distribution License (the "License"). +You may not use this file except in compliance with the License. + +You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +or http://www.opensolaris.org/os/licensing. +See the License for the specific language governing permissions +and limitations under the License. + +When distributing Covered Code, include this CDDL HEADER in each +file and include the License file at usr/src/OPENSOLARIS.LICENSE. +If applicable, add the following below this CDDL HEADER, with the +fields enclosed by brackets "[]" replaced with your own identifying +information: Portions Copyright [yyyy] [name of copyright owner] + + +Copyright 2008 Sun Microsystems, Inc. All rights reserved. +Use is subject to license terms. + +Copyright 2011 Joyent, Inc. All rights reserved. + + ---------- OpenStreetMap: http://openstreetmap.org/ (San Francisco SOMA map in examples/parties/public/soma.jpeg) diff --git a/docs/.meteor/packages b/docs/.meteor/packages index cfb17d208a3..f4302d6960b 100644 --- a/docs/.meteor/packages +++ b/docs/.meteor/packages @@ -3,6 +3,7 @@ # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. +standard-app-packages jquery underscore showdown @@ -11,3 +12,4 @@ jquery-waypoints less spiderable appcache +handlebars diff --git a/docs/.meteor/release b/docs/.meteor/release index a50a1dcf8c5..5a848a1d77b 100644 --- a/docs/.meteor/release +++ b/docs/.meteor/release @@ -1 +1 @@ -0.6.3.1 +0.7.1.2 diff --git a/docs/client/api.html b/docs/client/api.html index d2cefaae965..2b21b170272 100644 --- a/docs/client/api.html +++ b/docs/client/api.html @@ -12,6 +12,15 @@

Meteor Core

{{> api_box isClient}} {{> api_box isServer}} + +{{#note}} +`Meteor.isServer` can be used to limit where code runs, but it does not +prevent code from being sent to the client. Any sensitive code that you +don't want served to the client, such as code containing passwords or +authentication mechanisms, should be kept in the `server` directory. +{{/note}} + + {{> api_box startup}} On a server, the function will run as soon as the server process is @@ -21,7 +30,7 @@

Meteor Core

The `startup` callbacks are called in the same order as the calls to `Meteor.startup` were made. -On a client, `startup` callbacks from smart packages will be called +On a client, `startup` callbacks from packages will be called first, followed by `` templates from your `.html` files, followed by your application code. @@ -53,9 +62,9 @@

Publish and subscribe

Publish functions can return a [`Collection.Cursor`](#meteor_collection_cursor), in which case Meteor -will publish that cursor's documents. You can also return an array of -`Collection.Cursor`s, in which case Meteor will publish all of the -cursors. +will publish that cursor's documents to each subscribed client. You can +also return an array of `Collection.Cursor`s, in which case Meteor will +publish all of the cursors. {{#warning}} If you return multiple cursors in an array, they currently must all be from @@ -83,16 +92,15 @@

Publish and subscribe

]; }); -Otherwise, the publish function should call the functions -[`added`](#publish_added) (when a new document is added to the published record -set), [`changed`](#publish_changed) (when some fields on a document in the -record set are changed or cleared), and [`removed`](#publish_removed) (when -documents are removed from the published record set) to inform subscribers about -documents. These methods are provided by `this` in your publish function. - - - - +Alternatively, a publish function can directly control its published +record set by calling the functions [`added`](#publish_added) (to add a +new document to the published record set), [`changed`](#publish_changed) +(to change or clear some fields on a document already in the published +record set), and [`removed`](#publish_removed) (to remove documents from +the published record set). Publish functions that use these functions +should also call [`ready`](#publish_ready) once the initial record set +is complete. These methods are provided by `this` in your publish +function. Example: @@ -112,7 +120,7 @@

Publish and subscribe

count--; self.changed("counts", roomId, {count: count}); } - // don't care about moved or changed + // don't care about changed }); // Observe only returns after the initial added callbacks have @@ -167,6 +175,8 @@

Publish and subscribe

{{> api_box subscription_error}} {{> api_box subscription_stop}} +{{> api_box subscription_connection}} + {{> api_box subscribe}} When you subscribe to a record set, it tells the server to send records to the @@ -268,6 +278,7 @@

Methods

begin running. * `userId`: the id of the current user. * `setUserId`: a function that associates the current client with a user. +* `connection`: on the server, the [connection](#meteor_onconnection) this method call was received on. Calling `methods` on the client defines *stub* functions associated with server methods of the same name. You don't have to define a stub for @@ -320,6 +331,8 @@

Methods

returns. However, you can change this by calling `this.unblock`. This will allow the N+1th invocation to start running in a new fiber. +{{> api_box method_invocation_connection}} + {{> api_box error}} If you want to return an error from a method, throw an exception. Methods can @@ -407,8 +420,8 @@

服务器连接

{{#dtdd name="status" type="String"}} 表示当前的重连接状态。可能的值有 `connected`(已连接并正在运行)、`connecting` - (已断开并尝试打开一个新连接)、`failed`(永久连接失败,例如:客户端与服务器 - 支持的 DDP 版本不同)和 `waiting`(连接已失败并等待尝试重新连接) + (已断开并尝试打开一个新连接)、`failed`(连接一直失败,例如:客户端与服务器 + 支持的 DDP 版本不同)、 `waiting`(连接已失败并等待尝试重新连接)和 `offline`(用户已经失去连接) {{/dtdd}} {{#dtdd name="retryCount" type="Number"}} @@ -430,10 +443,88 @@

服务器连接

{{> api_box reconnect}} +{{> api_box disconnect}} + +Call this method to disconnect from the server and stop all +live data updates. While the client is disconnected it will not receive +updates to collections, method calls will be queued until the +connection is reestablished, and hot code push will be disabled. + +Call [Meteor.reconnect](#meteor_reconnect) to reestablish the connection +and resume data transfer. + +This can be used to save battery on mobile devices when real time +updates are not required. + + +{{> api_box onConnection}} + +`onConnection` returns an object with a single method `stop`. Calling +`stop` unregisters the callback, so that this callback will no longer +be called on new connections. + +The callback is called with a single argument, the server-side +`connection` representing the connection from the client. This object +contains the following fields: + +
+{{#dtdd name="id" type="String"}} +A globally unique id for this connection. +{{/dtdd}} + +{{#dtdd name="close" type="Function"}} +Close this DDP connection. The client is free to reconnect, but will +receive a different connection with a new `id` if it does. +{{/dtdd}} + +{{#dtdd name="onClose" type="Function"}} +Register a callback to be called when the connection is closed. If the +connection is already closed, the callback will be called immediately. +{{/dtdd}} + +{{#dtdd name="clientAddress" type="String"}} + The IP address of the client in dotted form (such as `"127.0.0.1"`). + + If you're running your Meteor server behind a proxy (so that clients + are connecting to the proxy instead of to your server directly), + you'll need to set the `HTTP_FORWARDED_COUNT` environment variable + for the correct IP address to be reported by `clientAddress`. + + Set `HTTP_FORWARDED_COUNT` to an integer representing the number of + proxies in front of your server. For example, you'd set it to `"1"` + when your server was behind one proxy. +{{/dtdd}} + +{{#dtdd name="httpHeaders" type="Object"}} + When the connection came in over an HTTP transport (such as with + Meteor's default SockJS implementation), this field contains + whitelisted HTTP headers. + + Cookies are deliberately excluded from the headers as they are a + security risk for this transport. For details and alternatives, see + the [SockJS + documentation](https://github.com/sockjs/sockjs-node#authorisation). +{{/dtdd}} +
+ +{{#note}} +Currently when a client reconnects to the server (such as after +temporarily losing its Internet connection), it will get a new +connection each time. The `onConnection` callbacks will be called +again, and the new connection will have a new connection `id`. + +In the future, when client reconnection is fully implemented, +reconnecting from the client will reconnect to the same connection on +the server: the `onConnection` callback won't be called for that +connection again, and the connection will still have the same +connection `id`. +{{/note}} + + {{> api_box connect}} -要在另一个 Meteor 程序上调用方法或订阅它们的数据集合,与一个应用的 URL 一起 -调用 `Meteor.connect`。`Meteor.connect` 就会返回一个提供以下函数的对象: + +要调用另一个 Meteor 程序上的方法或订阅它的数据集合,可以调用 `DDP.connect`带上那个Meteor程序的URL。执行`DDP.connect` 会返回一个对象,这个对象提供: * `subscribe` - 订阅一个记录集。参见 [Meteor.subscribe](#meteor_subscribe)。 * `call` - 激活一个方法。参见 [Meteor.call](#meteor_call)。 @@ -448,9 +539,6 @@

服务器连接

默认情况下,客户端在它们已载入的地方打开一个连接到服务器。当你调用 `Meteor.subscribe`、 `Meteor.status`、`Meteor.call` 和 `Meteor.apply` 时,你使用的是返回默认服务器的连接。 -{{#warning}} -在这个版本中,`Meteor.connect` 只能在客户端上被调用。服务器还不能连接其他服务器。 -{{/warning}}

Collections

@@ -495,23 +583,30 @@

Collections

Specifically, when you pass a `name`, here's what happens: -* On the server, a collection with that name is created on a backend -Mongo server. When you call methods on that collection on the server, -they translate directly into normal Mongo operations (after checking that -they match your [access control rules](#allow)). +* On the server (if you do not specify a `connection`), a collection with that +name is created on a backend Mongo server. When you call methods on that +collection on the server, they translate directly into normal Mongo operations +(after checking that they match your [access control rules](#allow)). -* On the client, a Minimongo instance is -created. Minimongo is essentially an in-memory, non-persistent -implementation of Mongo in pure JavaScript. It serves as a local cache -that stores just the subset of the database that this client is working -with. Queries on the client ([`find`](#find)) are served directly out of -this cache, without talking to the server. +* On the client (and on the server if you specify a `connection`), a Minimongo +instance is created. Minimongo is essentially an in-memory, non-persistent +implementation of Mongo in pure JavaScript. It serves as a local cache that +stores just the subset of the database that this client is working with. Queries +([`find`](#find)) on these collections are served directly out of this cache, +without talking to the server. * When you write to the database on the client ([`insert`](#insert), -[`update`](#update), [`remove`](#remove)), the command is executed -immediately on the client, and, simultaneously, it's shipped up to the -server and executed there too. The `livedata` package is -responsible for this. +[`update`](#update), [`remove`](#remove)), the command is executed locally +immediately, and, simultaneously, it's sent to the server and executed +there too. This happens via [stubs](#meteor_methods), because writes are +implemented as methods. + +{{#note}} +When, on the server, you write to a collection which has a specified +`connection` to another server, it sends the corresponding method to the other +server and receives the changed values back from it over DDP. Unlike on the +client, it does not execute the write locally first. +{{/note}} If you pass `null` as the `name`, then you're creating a local collection. It's not synchronized anywhere; it's just a local scratchpad @@ -556,7 +651,8 @@

Collections

returned or passed to callbacks. This allows you to add methods or otherwise modify the contents of your collection from their database representation. You can also specify `transform` on a particular `find`, `findOne`, `allow`, or -`deny` call. +`deny` call. Transform functions must return an object and they may not change +the value of the document's `_id` field (though it's OK to leave it out). // An Animal class that takes a document in its constructor Animal = function (doc) { @@ -587,9 +683,7 @@

Collections

* `$pull` in modifiers can only accept certain kinds of selectors. -* `$` to denote the matched array position is not -supported in modifier. -* `findAndModify`, upsert, aggregate functions, and +* `findAndModify`, aggregate functions, and map/reduce aren't supported. All of these will be addressed in a future release. For full @@ -618,7 +712,7 @@

Collections

those changes may or may not appear in the result set. {{/warning}} -Cursors are a reactive data source. The first time you retrieve a +Cursors are a reactive data source. On the client, the first time you retrieve a cursor's documents with `fetch`, `map`, or `forEach` inside a reactive computation (eg, a template or [`autorun`](#deps_autorun)), Meteor will register a @@ -627,9 +721,16 @@

Collections

disable this behavior, pass `{reactive: false}` as an option to `find`. +Note that when `fields` are specified, only changes to the included +fields will trigger callbacks in `observe`, `observeChanges` and +invalidations in reactive computations using this cursor. Careful use +of `fields` allows for more fine-grained reactivity for computations +that don't depend on an entire document. + {{> api_box findone}} -Equivalent to `find(selector, options).fetch()[0]`. +Equivalent to `find(selector, options).fetch()[0]` with +`options.limit = 1`. {{> api_box insert}} @@ -677,24 +778,27 @@

Collections

`multi` to true, and can use an arbitrary [Mongo selector](#selectors) to find the documents to modify. It bypasses any access control rules set up by [`allow`](#allow) and - [`deny`](#deny). + [`deny`](#deny). The number of affected documents will be returned + from the `update` call if you don't pass a callback. - Untrusted code can only modify a single document at once, specified by its `_id`. The modification is allowed only after checking any - applicable [`allow`](#allow) and [`deny`](#deny) rules. + applicable [`allow`](#allow) and [`deny`](#deny) rules. The number + of affected documents will be returned to the callback. Untrusted + code cannot perform upserts, except in insecure mode. On the server, if you don't provide a callback, then `update` blocks until the database acknowledges the write, or throws an exception if something went wrong. If you do provide a callback, `update` returns immediately. Once the update completes, the callback is called with a -single error argument in the case of failure, or no arguments if the -update was successful. +single error argument in the case of failure, or a second argument +indicating the number of affected documents if the update was successful. On the client, `update` never blocks. If you do not provide a callback and the update fails on the server, then Meteor will log a warning to the console. If you provide a callback, Meteor will call that function -with an error argument if there was an error, or no arguments if the -update was successful. +with an error argument if there was an error, or a second argument +indicating the number of affected documents if the update was successful. Client example: @@ -720,9 +824,18 @@

Collections

} }); -{{#warning}} -The Mongo `upsert` feature is not implemented. -{{/warning}} +You can use `update` to perform a Mongo upsert by setting the `upsert` +option to true. You can also use the [`upsert`](#upsert) method to perform an +upsert that returns the _id of the document that was inserted (if there was one) +in addition to the number of affected documents. + +{{> api_box upsert}} + +Modify documents that match `selector` according to `modifier`, or insert +a document if no documents were modified. `upsert` is the same as calling +`update` with the `upsert` option set to true, except that the return +value of `upsert` is an object that contain the keys `numberAffected` +and `insertedId`. (`update` returns only the number of affected documents.) {{> api_box remove}} @@ -738,7 +851,8 @@

Collections

find the documents to remove, and can remove more than one document at once by passing a selector that matches multiple documents. It bypasses any access control rules set up by [`allow`](#allow) and - [`deny`](#deny). + [`deny`](#deny). The number of removed documents will be returned + from `remove` if you don't pass a callback. As a safety measure, if `selector` is omitted (or is `undefined`), no documents will be removed. Set `selector` to `{}` if you really @@ -746,20 +860,22 @@

Collections

- Untrusted code can only remove a single document at a time, specified by its `_id`. The document is removed only after checking - any applicable [`allow`](#allow) and [`deny`](#deny) rules. + any applicable [`allow`](#allow) and [`deny`](#deny) rules. The + number of removed documents will be returned to the callback. On the server, if you don't provide a callback, then `remove` blocks -until the database acknowledges the write, or throws an exception if +until the database acknowledges the write and then returns the number +of removed documents, or throws an exception if something went wrong. If you do provide a callback, `remove` returns immediately. Once the remove completes, the callback is called with a -single error argument in the case of failure, or no arguments if the -remove was successful. +single error argument in the case of failure, or a second argument +indicating the number of removed documents if the remove was successful. On the client, `remove` never blocks. If you do not provide a callback -and the remove fails on the server, then Meteor will log a warning to -the console. If you provide a callback, Meteor will call that function -with an error argument if there was an error, or no arguments if the -remove was successful. +and the remove fails on the server, then Meteor will log a warning to the +console. If you provide a callback, Meteor will call that function with an +error argument if there was an error, or a second argument indicating the number +of removed documents if the remove was successful. Client example: @@ -820,9 +936,11 @@

Collections

`fieldNames` is an array of the (top-level) fields in `doc` that the client wants to modify, for example -`['name',` `'score']`. `modifier` is the raw Mongo modifier that -the client wants to execute, for example `{$set: {'name.first': -"Alice"}, $inc: {score: 1}}`. +`['name',` `'score']`. + +`modifier` is the raw Mongo modifier that +the client wants to execute; for example, +`{$set: {'name.first': "Alice"}, $inc: {score: 1}}`. Only Mongo modifiers are supported (operations like `$set` and `$push`). If the user tries to replace the entire document rather than use @@ -920,6 +1038,8 @@

Cursors

{{> api_box cursor_foreach}} +This interface is compatible with [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach). + When called from a reactive computation, `forEach` registers dependencies on the matching documents. @@ -935,6 +1055,8 @@

Cursors

{{> api_box cursor_map}} +This interface is compatible with [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). + When called from a reactive computation, `map` registers dependencies on the matching documents. @@ -1131,8 +1253,12 @@

Cursors

{{#api_box_inline selectors}} -In its simplest form, a selector is just a set of keys that must -match in a document: +The simplest selectors are just a string or +[`Meteor.Collection.ObjectID`](#collection_object_id). These selectors match the +document with that value in its `_id` field. + +A slightly more complex form of selector is an object containing a set of keys +that must match in a document: // Matches all documents where deleted is false {deleted: false} @@ -1155,7 +1281,7 @@

Cursors

{fruit: {$in: ["peach", "plum", "pear"]}} See the [complete -documentation](http://www.mongodb.org/display/DOCS/Advanced+Queries). +documentation](http://docs.mongodb.org/manual/reference/operator/). {{/api_box_inline}} @@ -1203,21 +1329,46 @@

Cursors

{{#api_box_inline fieldspecifiers}} -On the server, queries can specify a particular set of fields to include -or exclude from the result object. (The field specifier is currently -ignored on the client.) +Queries can specify a particular set of fields to include or exclude from the +result object. -To exclude certain fields from the result objects, the field specifier -is a dictionary whose keys are field names and whose values are `0`. +To exclude specific fields from the result objects, the field specifier is a +dictionary whose keys are field names and whose values are `0`. All unspecified +fields are included. // Users.find({}, {fields: {password: 0, hash: 0}}) -To return an object that only includes the specified field, use `1` as -the value. The `_id` field is still included in the result. +To include only specific fields in the result documents, use `1` as +the value. The `_id` field is still included in the result. // Users.find({}, {fields: {firstname: 1, lastname: 1}}) -It is not possible to mix inclusion and exclusion styles. +With one exception, it is not possible to mix inclusion and exclusion styles: +the keys must either be all 1 or all 0. The exception is that you may specify +`_id: 0` in an inclusion specifier, which will leave `_id` out of the result +object as well. However, such field specifiers can not be used with +[`observeChanges`](#observe_changes), [`observe`](#observe), cursors returned +from a [publish function](#meteor_publish), or cursors used in +`{{dstache}}#each}}` in a template. They may be used with [`fetch`](#fetch), +[`findOne`](#findone), [`forEach`](#foreach), and [`map`](#map). + + +Field +operators such as `$` and `$elemMatch` are not available on the client side +yet. + +A more advanced example: + + Users.insert({ alterEgos: [{ name: "Kira", alliance: "murderer" }, + { name: "L", alliance: "police" }], + name: "Yagami Light" }); + + Users.findOne({}, { fields: { 'alterEgos.name': 1, _id: 0 } }); + + // returns { alterEgos: [{ name: "Kira" }, { name: "L" }] } + +See +the MongoDB docs for details of the nested field rules and array behavior. {{/api_box_inline}} @@ -1363,7 +1514,7 @@

Accounts

{ address: "cool@example.com", verified: true }, { address: "another@different.com", verified: false } ], - createdAt: 1349761684042, + createdAt: Wed Aug 21 2013 15:16:52 GMT-0700 (PDT), profile: { // The profile is writable by the user by default. name: "Joe Schmoe" @@ -1390,8 +1541,7 @@

Accounts

an email address may belong to at most one user. `verified` is a Boolean which is true if the user has [verified the address](#accounts_verifyemail) with a token sent over email. -- `createdAt`: a numeric timestamp (milliseconds since January 1 1970) - of the time the user document was created. +- `createdAt`: the Date at which the user document was created. - `profile`: an Object which (by default) the user can create and update with any data. - `services`: an Object containing data used by particular @@ -1438,6 +1588,12 @@

Accounts

{{> api_box logout}} +{{> api_box logoutOtherClients}} + +For example, when called in a user's browser, connections in that browser +remain logged in, but any other browsers or DDP clients logged in as that user +will be logged out. + {{> api_box loginWithPassword}} This function is provided by the `accounts-password` package. See the @@ -1446,6 +1602,16 @@

Accounts

{{> api_box loginWithExternalService}} +Available functions are: + +* `Meteor.loginWithMeteorDeveloperAccount` +* `Meteor.loginWithFacebook` +* `Meteor.loginWithGithub` +* `Meteor.loginWithGoogle` +* `Meteor.loginWithMeetup` +* `Meteor.loginWithTwitter` +* `Meteor.loginWithWeibo` + These functions initiate the login process with an external service (eg: Facebook, Google, etc), using OAuth. When called they open a new pop-up window that loads the provider's login page. Once the user has logged in @@ -1470,20 +1636,21 @@

Accounts

- GitHub: - Google: - Meetup: -- Twitter, Weibo: `requestPermissions` currently not supported +- Twitter, Weibo, Meteor developer accounts: `requestPermissions` currently not supported External login services typically require registering and configuring your application before use. The easiest way to do this is with the [`accounts-ui` package](#accountsui) which presents a step-by-step guide to configuring each service. However, the data can be also be entered -manually in the `Accounts.loginServiceConfiguration` collection. For -example: +manually in the `ServiceConfiguration.configurations` collection, which +is exported by the `service-configuration` package. For example, after +running `meteor add service-configuration` in your app: // first, remove configuration entry in case service is already configured - Accounts.loginServiceConfiguration.remove({ + ServiceConfiguration.configurations.remove({ service: "weibo" }); - Accounts.loginServiceConfiguration.insert({ + ServiceConfiguration.configurations.insert({ service: "weibo", clientId: "1292962797", secret: "75a730b58f5691de5522789070c319bc" @@ -1605,11 +1772,11 @@

Passwords

successful completion. On the server, it returns the newly created user id. -On the client, you must pass `password` and one of `username` or `email` -— enough information for the user to be able to log in again -later. On the server, you can pass any subset of these options, but the -user will not be able to log in until it has an identifier and a -password. +On the client, you must pass `password` and at least one of `username` or +`email` — enough information for the user to be able to log in again +later. On the server, you do not need to specify `password`, but the user will +not be able to log in until it has a password (eg, set with +[`Accounts.setPassword`](#accounts_setpassword)). To create an account without a password on the server and still let the user pick their own password, call `createUser` with the `email` option @@ -1789,7 +1956,7 @@

Templates

{{> api_box template_events}} -Declare event handers for instances of this template. Multiple calls add +Declare event handlers for instances of this template. Multiple calls add new event handlers in addition to the existing ones. See [Event Maps](#eventmaps) for a detailed description of the event @@ -2302,6 +2469,10 @@

Match

Matches a primitive of the given type. {{/dtdd}} +{{#dtdd "Match.Integer"}} +Matches a signed 32-bit integer. Doesn't match `Infinity`, `-Infinity`, or `NaN`. +{{/dtdd}} + {{#dtdd "[pattern]"}} A one-element array matches an array of elements, each of which match *pattern*. For example, `[Number]` matches a (possibly empty) array of numbers; @@ -2325,8 +2496,19 @@

Match

`Match.ObjectIncluding({})`. {{/dtdd}} -{{#dtdd "Match.Optional(pattern)"}} -Matches either `undefined` or something that matches *pattern*. +{{#dtdd "Match.Optional(pattern)"}} Matches either +`undefined` or something that matches pattern. If used in an object this matches +only if the key is not set as opposed to the value being set to `undefined`. + + // In an object + var pat = { name: Match.Optional(String) }; + check({ name: "something" }, pat) // OK + check({}, pat) // OK + check({ name: undefined }, pat) // Throws an exception + + // Outside an object + check(undefined, Match.Optional(String)); // OK + {{/dtdd}} {{#dtdd "Match.OneOf(pattern1, pattern2, ...)"}} @@ -2348,7 +2530,7 @@

Match

NonEmptyString = Match.Where(function (x) { check(x, String); return x.length > 0; - } + }); check(arg, NonEmptyString); {{/dtdd}} @@ -2364,7 +2546,9 @@

Timers

instead of `setInterval`. These functions work just like their native JavaScript equivalents. -You'll get an error if you call the native function. +If you call the native function, you'll get an error stating that Meteor +code must always run within a Fiber, and advising to use +`Meteor.bindEnvironment`. {{> api_box setTimeout}} @@ -2467,7 +2651,7 @@

Deps

of rerunning any invalidated computations. If additional invalidations happen while flushing, they are processed as part of the same flush until there is no more work to be done. Callbacks -registered with [`Meteor.afterFlush`](#deps_afterflush) are called +registered with [`Deps.afterFlush`](#deps_afterflush) are called after processing outstanding invalidations. Any auto-updating DOM elements that are found to not be in the @@ -2483,9 +2667,10 @@

Deps

{{> api_box deps_nonreactive }} -Calls `func()` with `Deps.currentComputation` temporarily set to -`null`. If `func` accesses reactive data sources, these data sources -will never cause a rerun of the enclosing computation. +Calls `func` with `Deps.currentComputation` temporarily set to `null` +and returns `func`'s own return value. If `func` accesses reactive data +sources, these data sources will never cause a rerun of the enclosing +computation. {{> api_box deps_active }} @@ -2744,10 +2929,26 @@

EJSON

{{/note}} -Instances of your type should implement the following interface: +Instances of your type must implement [`typeName`](#ejson_type_typeName) and +[`toJSONValue`](#ejson_type_toJSONValue) methods, and may implement +[`clone`](#ejson_type_clone) and [`equals`](#ejson_type_equals) methods if the +default implementations are not sufficient. + +{{> api_box ejsonTypeName}} +{{> api_box ejsonTypeToJSONValue}} + +For example, the `toJSONValue` method for +[`Meteor.Collection.ObjectID`](#collection_object_id) could be: + + function () { + return this.toHexString(); + }; {{> api_box ejsonTypeClone}} +If your type does not have a `clone` method, `EJSON.clone` will use +[`toJSONValue`](#ejson_type_toJSONValue) and the factory instead. + {{> api_box ejsonTypeEquals}} The `equals` method should define an [equivalence @@ -2758,35 +2959,29 @@

EJSON

- *Symmetry* - for any two instances `a` and `b`: `a.equals(b)` if and only if `b.equals(a)`. - *Transitivity* - for any three instances `a`, `b`, and `c`: `a.equals(b)` and `b.equals(c)` implies `a.equals(c)`. -{{> api_box ejsonTypeName}} -{{> api_box ejsonTypeToJSONValue}} +If your type does not have an `equals` method, `EJSON.equals` will compare the +result of calling [`toJSONValue`](#ejson_type_toJSONValue) instead. -For example, the `toJSONValue` method for -[`Meteor.Collection.ObjectID`](#collection_object_id) could be: - function () { - return this.toHexString(); - }; - -

Meteor.http

+

HTTP

-`Meteor.http` provides an HTTP API on the client and server. To use -these functions, add the HTTP package to your project with `$ meteor add -http`. +`HTTP` provides an HTTP request API on the client and server. To use +these functions, add the HTTP package to your project with `$ meteor add http`. {{> api_box httpcall}} -This function initiates an HTTP request to a remote server. It returns -a result object with the contents of the HTTP response. The result -object is detailed below. +This function initiates an HTTP request to a remote server. On the server, this function can be run either synchronously or -asynchronously. If the callback is omitted, it runs synchronously, -and the results are returned once the request completes. This is +asynchronously. If the callback is omitted, it runs synchronously +and the results are returned once the request completes successfully. +If the request was not successful, an error is thrown. +This is useful when making server-to-server HTTP API calls from within Meteor methods, as the method can succeed or fail based on the results of the synchronous HTTP call. In this case, consider using -[`this.unblock()`](#method_unblock) to allow other methods to run in +[`this.unblock()`](#method_unblock) to allow other methods on the same +connection to run in the mean time. On the client, this function must be used asynchronously by passing a callback. @@ -2806,7 +3001,8 @@

Meteor.http

or `data` option is used to specify a body, in which case the parameters will be appended to the URL instead. -The callback receives two arguments, `error` and `result`. The +When run in asynchronous mode, the callback receives two arguments, +`error` and `result`. The `error` argument will contain an Error if the request fails in any way, including a network error, time-out, or an HTTP status code in the 400 or 500 range. In case of a 4xx/5xx HTTP status code, the @@ -2841,22 +3037,25 @@

Meteor.http

Meteor.methods({checkTwitter: function (userId) { check(userId, String); this.unblock(); - var result = Meteor.http.call("GET", "http://api.twitter.com/xyz", - {params: {user: userId}}); - if (result.statusCode === 200) - return true - return false; + try { + var result = HTTP.call("GET", "http://api.twitter.com/xyz", + {params: {user: userId}}); + return true; + } catch (e) { + // Got a network error, time-out or HTTP error in the 400 or 500 range. + return false; + } }}); Example asynchronous HTTP call: - Meteor.http.call("POST", "http://api.twitter.com/xyz", - {data: {some: "json", stuff: 1}}, - function (error, result) { - if (result.statusCode === 200) { - Session.set("twizzled", true); - } - }); + HTTP.call("POST", "http://api.twitter.com/xyz", + {data: {some: "json", stuff: 1}}, + function (error, result) { + if (!error) { + Session.set("twizzled", true); + } + }); {{> api_box http_get}} @@ -2919,6 +3118,25 @@

Email

'This is a test of Email.send.'); {{/better_markdown}} + +

Assets

+ +{{#better_markdown}} +`Assets` allows server code in a Meteor application to access static server +assets, which are located in the `private` subdirectory of an application's +tree. + +{{> api_box assets_getText }} +{{> api_box assets_getBinary }} + +Static server assets are included by placing them in the application's `private` +subdirectory. For example, if an application's `private` subdirectory includes a +directory called `nested` with a file called `data.txt` inside it, then server +code can read `data.txt` by running: + + var data = Assets.getText('nested/data.txt'); +{{/better_markdown}} + diff --git a/docs/client/api.js b/docs/client/api.js index 0829aed171b..98efe0c945b 100644 --- a/docs/client/api.js +++ b/docs/client/api.js @@ -58,12 +58,12 @@ Template.api.settings = { id: "meteor_settings", name: "Meteor.settings", locus: "Anywhere", - descr: ["`Meteor.settings` contains any deployment-specific options that were " + - "provided using the `--settings` option for `meteor run` or `meteor deploy`. " + - "If you provide the `--settings` option, `Meteor.settings` will be the " + - "JSON object in the file you specify. Otherwise, `Meteor.settings` will " + - "be an empty object. If the object contains a key named `public`, then " + - "`Meteor.settings.public` will also be available on the client."] + descr: ["`Meteor.settings` contains deployment-specific configuration options. " + + "You can initialize settings by passing the `--settings` option (which takes a file containing JSON data) to " + + "`meteor run` or `meteor deploy`, " + + "or by setting your server process's `METEOR_SETTINGS` environment variable to a JSON string. " + + "If you don't provide any settings, `Meteor.settings` will be an empty object. If the settings object contains a key named `public`, then " + + "`Meteor.settings.public` will be available on the client as well as the server. All other properties of `Meteor.settings` are only defined on the server."] }; Template.api.release = { @@ -73,8 +73,7 @@ Template.api.release = { descr: ["`Meteor.release` is a string containing the name of the " + "[release](#meteorupdate) with which the project was built (for " + "example, `\"" + - // Put the current release in the docs as the example) - (Meteor.release ? Meteor.release : '0.6.0') + + Meteor.release + "\"`). It is `undefined` if the project was built using a git " + "checkout of Meteor."] }; @@ -89,9 +88,17 @@ Template.api.ejsonParse = { Template.api.ejsonStringify = { id: "ejson_stringify", - name: "EJSON.stringify(val)", + name: "EJSON.stringify(val, [options])", locus: "Anywhere", args: [ {name: "val", type: "EJSON-compatible value", descr: "A value to stringify."} ], + options: [ + {name: "indent", + type: "Boolean, Integer, or String", + descr: "Indents objects and arrays for easy readability. When `true`, indents by 2 spaces; when an integer, indents by that number of spaces; and when a string, uses the string as the indentation pattern."}, + {name: "canonical", + type: "Boolean", + descr: "When `true`, stringifies keys in an object in sorted order."} + ], descr: ["Serialize a value to a string.\n\nFor EJSON values, the serialization " + "fully represents the value. For non-EJSON values, serializes the " + "same way as `JSON.stringify`."] @@ -116,10 +123,15 @@ Template.api.ejsonToJSONValue = { Template.api.ejsonEquals = { id: "ejson_equals", - name: "EJSON.equals(a, b)", //doc options? + name: "EJSON.equals(a, b, [options])", locus: "Anywhere", args: [ {name: "a", type: "EJSON-compatible object"}, {name: "b", type: "EJSON-compatible object"} ], + options: [ + {name: "keyOrderSensitive", + type: "Boolean", + descr: "Compare in key sensitive order, if supported by the JavaScript implementation. For example, `{a: 1, b: 2}` is equal to `{b: 2, a: 1}` only when `keyOrderSensitive` is `false`. The default is `false`."} + ], descr: ["Return true if `a` and `b` are equal to each other. Return false otherwise." + " Uses the `equals` method on `a` if present, otherwise performs a deep comparison."] }, @@ -306,6 +318,14 @@ Template.api.subscription_userId = { }; +Template.api.subscription_connection = { + id: "publish_connection", + name: "this.connection", + locus: "Server", + descr: ["Access inside the publish function. The incoming [connection](#meteor_onconnection) for this subscription."] +}; + + Template.api.subscribe = { id: "meteor_subscribe", name: "Meteor.subscribe(name [, arg1, arg2, ... ] [, callbacks])", @@ -369,6 +389,13 @@ Template.api.method_invocation_isSimulation = { descr: ["Access inside a method invocation. Boolean value, true if this invocation is a stub."] }; +Template.api.method_invocation_connection = { + id: "method_connection", + name: "this.connection", + locus: "Server", + descr: ["Access inside a method invocation. The [connection](#meteor_onconnection) this method was received on. `null` if the method is not associated with a connection, eg. a server initiated method call."] +}; + Template.api.error = { id: "meteor_error", name: "new Meteor.Error(error, reason, details)", @@ -447,10 +474,18 @@ Template.api.reconnect = { "This method does nothing if the client is already connected."] }; -Template.api.connect = { - id: "meteor_connect", - name: "Meteor.connect(url)", +Template.api.disconnect = { + id: "meteor_disconnect", + name: "Meteor.disconnect()", locus: "Client", + descr: [ + "Disconnect the client from the server."] +}; + +Template.api.connect = { + id: "ddp_connect", + name: "DDP.connect(url)", + locus: "Anywhere", descr: ["Connect to the server of a different Meteor application to subscribe to its document sets and invoke its remote methods."], args: [ {name: "url", @@ -459,6 +494,18 @@ Template.api.connect = { ] }; +Template.api.onConnection = { + id: "meteor_onconnection", + name: "Meteor.onConnection(callback)", + locus: "Server", + descr: ["Register a callback to be called when a new DDP connection is made to the server."], + args: [ + {name: "callback", + type: "function", + descr: "The function to call when a new DDP connection is established."} + ] +}; + // onAutopublish Template.api.meteor_collection = { @@ -474,7 +521,7 @@ Template.api.meteor_collection = { options: [ {name: "connection", type: "Object", - descr: "The Meteor connection that will manage this collection, defaults to `Meteor` if null. Unmanaged (`name` is null) collections cannot specify a connection." + descr: "The server connection that will manage this collection. Uses the default connection if not specified. Pass the return value of calling [`DDP.connect`](#ddp_connect) to specify a different server. Pass `null` to specify no connection. Unmanaged (`name` is null) collections cannot specify a connection." }, {name: "idGeneration", type: "String", @@ -485,7 +532,7 @@ Template.api.meteor_collection = { }, {name: "transform", type: "Function", - descr: "An optional transformation function. Documents will be passed through this function before being returned from `fetch` or `findOne`, and before being passed to callbacks of `observe`, `allow`, and `deny`." + descr: "An optional transformation function. Documents will be passed through this function before being returned from `fetch` or `findOne`, and before being passed to callbacks of `observe`, `map`, `forEach`, `allow`, and `deny`. Transforms are *not* applied for the callbacks of `observeChanges` or to cursors returned from publish functions." } ] }; @@ -497,7 +544,7 @@ Template.api.find = { descr: ["Find the documents in a collection that match the selector."], args: [ {name: "selector", - type: "Mongo selector, or String", + type: "Mongo selector (Object or String)", type_link: "selectors", descr: "The query"} ], @@ -515,7 +562,7 @@ Template.api.find = { {name: "fields", type: "Field specifier", type_link: "fieldspecifiers", - descr: "(Server only) Dictionary of fields to return or exclude."}, + descr: "Dictionary of fields to return or exclude."}, {name: "reactive", type: "Boolean", descr: "(Client only) Default `true`; pass `false` to disable reactivity"}, @@ -532,7 +579,7 @@ Template.api.findone = { descr: ["Finds the first document that matches the selector, as ordered by sort and skip options."], args: [ {name: "selector", - type: "Mongo selector, or String", + type: "Mongo selector (Object or String)", type_link: "selectors", descr: "The query"} ], @@ -547,7 +594,7 @@ Template.api.findone = { {name: "fields", type: "Field specifier", type_link: "fieldspecifiers", - descr: "(Server only) Dictionary of fields to return or exclude."}, + descr: "Dictionary of fields to return or exclude."}, {name: "reactive", type: "Boolean", descr: "(Client only) Default true; pass false to disable reactivity"}, @@ -577,7 +624,7 @@ Template.api.update = { id: "update", name: "collection.update(selector, modifier, [options], [callback])", locus: "Anywhere", - descr: ["Modify one or more documents in the collection"], + descr: ["Modify one or more documents in the collection. Returns the number of affected documents."], args: [ {name: "selector", type: "Mongo selector, or object id", @@ -589,7 +636,37 @@ Template.api.update = { descr: "Specifies how to modify the documents"}, {name: "callback", type: "Function", - descr: "Optional. If present, called with an error object as its argument."} + descr: "Optional. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second."} + ], + options: [ + {name: "multi", + type: "Boolean", + descr: "True to modify all matching documents; false to only modify one of the matching documents (the default)."}, + {name: "upsert", + type: "Boolean", + descr: "True to insert a document if no matching documents are found."} + ] +}; + +Template.api.upsert = { + id: "upsert", + name: "collection.upsert(selector, modifier, [options], [callback])", + locus: "Anywhere", + descr: ["Modify one or more documents in the collection, or insert one if no matching documents were found. " + + "Returns an object with keys `numberAffected` (the number of documents modified) " + + " and `insertedId` (the unique _id of the document that was inserted, if any)."], + args: [ + {name: "selector", + type: "Mongo selector, or object id", + type_link: "selectors", + descr: "Specifies which documents to modify"}, + {name: "modifier", + type: "Mongo modifier", + type_link: "modifiers", + descr: "Specifies how to modify the documents"}, + {name: "callback", + type: "Function", + descr: "Optional. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second."} ], options: [ {name: "multi", @@ -598,6 +675,7 @@ Template.api.update = { ] }; + Template.api.remove = { id: "remove", name: "collection.remove(selector, [callback])", @@ -667,25 +745,31 @@ Template.api.cursor_fetch = { Template.api.cursor_foreach = { id: "foreach", - name: "cursor.forEach(callback)", + name: "cursor.forEach(callback, [thisArg])", locus: "Anywhere", descr: ["Call `callback` once for each matching document, sequentially and synchronously."], args: [ {name: "callback", type: "Function", - descr: "Function to call."} + descr: "Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself."}, + {name: "thisArg", + type: "Any", + descr: "An object which will be the value of `this` inside `callback`."} ] }; Template.api.cursor_map = { id: "map", - name: "cursor.map(callback)", + name: "cursor.map(callback, [thisArg])", locus: "Anywhere", descr: ["Map callback over all matching documents. Returns an Array."], args: [ {name: "callback", type: "Function", - descr: "Function to call."} + descr: "Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself."}, + {name: "thisArg", + type: "Any", + descr: "An object which will be the value of `this` inside `callback`."} ] }; @@ -1018,6 +1102,20 @@ Template.api.logout = { ] }; +Template.api.logoutOtherClients = { + id: "meteor_logoutotherclients", + name: "Meteor.logoutOtherClients([callback])", + locus: "Client", + descr: ["Log out other clients logged in as the current user, but does not log out the client that calls this function."], + args: [ + { + name: "callback", + type: "Function", + descr: "Optional callback. Called with no arguments on success, or with a single `Error` argument on failure." + } + ] +}; + Template.api.loginWithPassword = { id: "meteor_loginwithpassword", @@ -1066,6 +1164,11 @@ Template.api.loginWithExternalService = { name: "requestOfflineToken", type: "Boolean", descr: "If true, asks the user for permission to act on their behalf when offline. This stores an additional offline token in the `services` field of the user document. Currently only supported with Google." + }, + { + name: "forceApprovalPrompt", + type: "Boolean", + descr: "If true, forces the user to approve the app's permissions, even if previously approved. Currently only supported with Google." } ] }; @@ -1087,6 +1190,16 @@ Template.api.accounts_config = { name: "forbidClientAccountCreation", type: "Boolean", descr: "Calls to [`createUser`](#accounts_createuser) from the client will be rejected. In addition, if you are using [accounts-ui](#accountsui), the \"Create account\" link will not be available." + }, + { + name: "restrictCreationByEmailDomain", + type: "String or Function", + descr: "If set to a string, only allows new users if the domain part of their email address matches the string. If set to a function, only allows new users if the function returns true. The function is passed the full email address of the proposed new user. Works with password-based sign-in and external services that expose email addresses (Google, Facebook, GitHub). All existing users still can log in after enabling this option. Example: `Accounts.config({ restrictCreationByEmailDomain: 'school.edu' })`." + }, + { + name: "loginExpirationInDays", + type: "Number", + descr: "The number of days from when a user logs in until their token expires and they are logged out. Defaults to 90. Set to `null` to disable login expiration." } ] }; @@ -1571,8 +1684,8 @@ Template.api.equals = { }; Template.api.httpcall = { - id: "meteor_http_call", - name: "Meteor.http.call(method, url [, options] [, asyncCallback])", + id: "http_call", + name: "HTTP.call(method, url [, options] [, asyncCallback])", locus: "Anywhere", descr: ["Perform an outbound HTTP request."], args: [ @@ -1618,31 +1731,31 @@ Template.api.httpcall = { }; Template.api.http_get = { - id: "meteor_http_get", - name: "Meteor.http.get(url, [options], [asyncCallback])", + id: "http_get", + name: "HTTP.get(url, [options], [asyncCallback])", locus: "Anywhere", - descr: ["Send an HTTP GET request. Equivalent to `Meteor.http.call(\"GET\", ...)`."] + descr: ["Send an HTTP GET request. Equivalent to `HTTP.call(\"GET\", ...)`."] }; Template.api.http_post = { - id: "meteor_http_post", - name: "Meteor.http.post(url, [options], [asyncCallback])", + id: "http_post", + name: "HTTP.post(url, [options], [asyncCallback])", locus: "Anywhere", - descr: ["Send an HTTP POST request. Equivalent to `Meteor.http.call(\"POST\", ...)`."] + descr: ["Send an HTTP POST request. Equivalent to `HTTP.call(\"POST\", ...)`."] }; Template.api.http_put = { - id: "meteor_http_put", - name: "Meteor.http.put(url, [options], [asyncCallback])", + id: "http_put", + name: "HTTP.put(url, [options], [asyncCallback])", locus: "Anywhere", - descr: ["Send an HTTP PUT request. Equivalent to `Meteor.http.call(\"PUT\", ...)`."] + descr: ["Send an HTTP PUT request. Equivalent to `HTTP.call(\"PUT\", ...)`."] }; Template.api.http_del = { - id: "meteor_http_del", - name: "Meteor.http.del(url, [options], [asyncCallback])", + id: "http_del", + name: "HTTP.del(url, [options], [asyncCallback])", locus: "Anywhere", - descr: ["Send an HTTP DELETE request. Equivalent to `Meteor.http.call(\"DELETE\", ...)`. (Named `del` to avoid conflict with JavaScript's `delete`.)"] + descr: ["Send an HTTP DELETE request. Equivalent to `HTTP.call(\"DELETE\", ...)`. (Named `del` to avoid conflict with JavaScript's `delete`.)"] }; @@ -1811,3 +1924,43 @@ Template.api.email_send = { } ] }; + +Template.api.assets_getText = { + id: "assets_getText", + name: "Assets.getText(assetPath, [asyncCallback])", + locus: "Server", + descr: ["Retrieve the contents of the static server asset as a UTF8-encoded string."], + args: [ + {name: "assetPath", + type: "String", + descr: "The path of the asset, relative to the application's " + + "`private` subdirectory." + }, + {name: "asyncCallback", + type: "Function", + descr: "Optional callback, which is called asynchronously with the error " + + "or result after the function is complete. If not provided, the function " + + "runs synchronously." + } + ] +}; + +Template.api.assets_getBinary = { + id: "assets_getBinary", + name: "Assets.getBinary(assetPath, [asyncCallback])", + locus: "Server", + descr: ["Retrieve the contents of the static server asset as an [EJSON Binary](#ejson_new_binary)."], + args: [ + {name: "assetPath", + type: "String", + descr: "The path of the asset, relative to the application's " + + "`private` subdirectory." + }, + {name: "asyncCallback", + type: "Function", + descr: "Optional callback, which is called asynchronously with the error " + + "or result after the function is complete. If not provided, the function " + + "runs synchronously." + } + ] +}; diff --git a/docs/client/concepts.html b/docs/client/concepts.html index 64209e65162..75a287bbde9 100644 --- a/docs/client/concepts.html +++ b/docs/client/concepts.html @@ -4,13 +4,69 @@

概念

我们已经手工编写了很多单页面 JavaScript 程序了,只用一种语言(JavaScript)和一种数据格式(JSON)来写程序真是一种乐趣,Meteor 提供了我们写这类程序所需要的一切。 +{{> whatismeteor }} {{> structure }} {{> data }} {{> reactivity }} {{> livehtml }} {{> templates }} {{> packages_concept }} +{{> namespacing }} {{> deploying }} +{{> packages_writing }} + + + @@ -139,6 +195,7 @@

数据与安全

var party = { ... }; Parties.insert(party); + 如果服务器接受了变更,它会将其应用到数据库中并自动将变更传播给其它订阅了受影响文档的客户机。 如果服务器拒绝了变更,则更新操作失败,服务端的数据库不会受到影响,其它的客户机也不会进行更新。 @@ -148,6 +205,11 @@

数据与安全

总而言之,这些技术实现了延迟补偿。客户机持有所需的最新数据,而且不必等待与服务器交换数据。 当客户机修改数据时,这些修改能在本地立即执行而无需等待服务器的确认;同时,服务器对于变更请求仍然拥有最终定夺的权力。 +{{#note}} +Meteor现在的版本只支持MongoDB,一个流行的文档数据库,本章节使用的例子来自[MongoDB API](http://www.mongodb.org/display/DOCS/Manual)。 +将来的版本将支持其他数据库。 +{{/note}} +

认证与用户账户

Meteor 包含了 [Meteor Accounts](#accounts_api),一个最先进的认证系统。 @@ -159,13 +221,6 @@

认证与用户账户

你仅需要一行代码就能在你的应用中添加 [Accounts UI](#accountsui) 。 `accounts-ui` 智能包甚至提供了配置向导引导你一步一步的在你的应用中搭建外部登录服务。 -{{#note}} -现今发布的 Meteor 支持 MongoDB,流行的文档数据库,本节中的例子来自 - [MongoDB API](http://www.mongodb.org/display/DOCS/Manual). -今后的版本将会包含对其它数据库的支持。 -{{/note}} - -

输入验证

Meteor 允许你的方法及发布函数接受任何 @@ -335,7 +390,8 @@

模板

在这个实例中,数据来自数据库查询。一旦数据库游标传递给 `#each`,就会 高效地连接每一台机器,添加和移动 DOM 节点作为新的结果输入查询中。 -辅助对象可以带参数,然后它们将收到在 `this` 函数中的当前模板的数据: +Helpers可以带参数,然后它们将收到在 `this` 函数中的当前模板的数据。注意有些helpers的代码块中会改变上下文(尤其是`each`和`with`): + // in a JavaScript file Template.players.leagueIs = function (league) { @@ -420,31 +476,112 @@

模板

智能的包

-Meteor 有着异常强大的包系统,你读到的所有功能都已经被实现为标准的 Meteor 包。 +你已经看到的所有功能都是由standard Meteor packages实现的。这是建立在Meteor的异常强大的包之上。这些包能作用于浏览器和服务端,且包含可以扩展的插件。例如`coffeescript` ([CoffeeScript](http://coffeescript.org)compilation) 或 `templating` (compiling HTML templates). -Meteor 的包是智能的:包本身就是 JavaScript 程序。它们可以注入到客户端和服务端,或者在 bundler 中 hook 一个新的函数,所以它们可以用任意方式扩展 Meteor 环境。一些包的例子: - -* [coffeescript](#coffeescript) 的包扩展了 bundler,自动编译目录中的 `.coffee` 文件。添加后,你可以用 CoffeeScript 代替 JavaScript 开发你的应用。 - -* [jQuery](#jquery) 和 [Backbone](#backbone) 的包是 Meteor 客户端预装的 JavaScript 库。你可以通过把 JavaScript 文件复制到目录中得到同样的结果,但添加包是更快的方式。 - -* [underscore](#underscore) 的包扩展了客户端和服务端环境。 - -在很多 Meteor 的核心特性被自动作为内置包在每个 Meteor 环境中加载(包含了 Minimongo、Session 对象和反应的 Handlebars 模板)。 你可以在这里 [`meteor list`](#meteorlist) 看到 Meteor 可用包的列表,通过 [`meteor add`](#meteoradd) 添加包到你的项目里,通过 [`meteor remove`](#meteorremove) 移除它们。 -在 [Package List](#packages) 这里来看现有包的描述。 +默认所有的应用包含`standard-app-packages`这个包,在这个包自动组装了Meteor的核心栈。为了保持简单,这些核心的包也不会显示在`meteor list`的输出中,但你可以读这里[source code of `standard-app-packages`](https://github.com/meteor/meteor/blob/master/packages/standard-app-packages/package.js)看它们都包括什么(作为Meteor的 pre-1.0,它们可能是会变化的)。如果你希望构建适合你自己习惯的栈,则从你的应用中移除`standard-app-packages`并添加任何你想保持的standard +packages。 -{{#warning}} -包的 API 是快速变化的并且不会被记录,所以你现在不能制作自己的包。很快就可以。 -{{/warning}} +除了可以使用Meteor官方发布的包,`meteor list` 和 `meteor add` 也会搜索应用根目录的 `packages` 文件夹。如果你下载了一个来自 Atmosphere 的非官方包你可以把它放在这个目录(非官方命令行工具 [Meteorite](http://oortcloud.github.io/meteorite/))。你也可以把你的应用分解成`packages`的子目录的来方便使用 — 在Meteor 1.0 之前,Meteor的package格式没有文档并且会有很大的变化,如果你不在乎这些仍然希望自己写package,可以参考 [Writing Packages](#writingpackages)。 {{/better_markdown}} + + + + diff --git a/docs/client/docs.html b/docs/client/docs.html index 411c4576599..7b53f32cf3c 100644 --- a/docs/client/docs.html +++ b/docs/client/docs.html @@ -1,6 +1,8 @@ Meteor 非官方中文文档 + @@ -11,7 +13,7 @@
-

此文档最后更新于 2013-05-21

+

此文档最后更新于 2014-02-28

本翻译项目的 GitHub:https://github.com/enumerable/meteor


{{> headline }} diff --git a/docs/client/docs.js b/docs/client/docs.js index 7ef70bca809..f5b45aa2155 100644 --- a/docs/client/docs.js +++ b/docs/client/docs.js @@ -47,10 +47,17 @@ Meteor.startup(function () { } var ignore_waypoints = false; - $('body').delegate('h1, h2, h3', 'waypoint.reached', function (evt, dir) { + var lastTimeout = null; + $('h1, h2, h3').waypoint(function (evt, dir) { if (!ignore_waypoints) { var active = (dir === "up") ? this.prev : this; - Session.set("section", active.id); + if (active.id) { + if (lastTimeout) + Meteor.clearTimeout(lastTimeout); + lastTimeout = Meteor.setTimeout(function () { + Session.set("section", active.id); + }, 200); + } } }); @@ -91,13 +98,16 @@ var toc = [ "Resources" ], "Concepts", [ + "What is Meteor?", "Structuring your app", "Data and security", "Reactivity", "Live HTML", "Templates", - "Smart packages", - "Deploying" + "Using packages", + "Namespacing", + "Deploying", + "Writing packages" ], "API", [ @@ -119,7 +129,8 @@ var toc = [ {instance: "this", name: "ready", id: "publish_ready"}, {instance: "this", name: "onStop", id: "publish_onstop"}, {instance: "this", name: "error", id: "publish_error"}, - {instance: "this", name: "stop", id: "publish_stop"} + {instance: "this", name: "stop", id: "publish_stop"}, + {instance: "this", name: "connection", id: "publish_connection"} ], "Meteor.subscribe" ], @@ -129,7 +140,8 @@ var toc = [ {instance: "this", name: "userId", id: "method_userId"}, {instance: "this", name: "setUserId", id: "method_setUserId"}, {instance: "this", name: "isSimulation", id: "method_issimulation"}, - {instance: "this", name: "unblock", id: "method_unblock"} + {instance: "this", name: "unblock", id: "method_unblock"}, + {instance: "this", name: "connection", id: "method_connection"} ], "Meteor.Error", "Meteor.call", @@ -139,7 +151,9 @@ var toc = [ {name: "Server connections", id: "connections"}, [ "Meteor.status", "Meteor.reconnect", - "Meteor.connect" + "Meteor.disconnect", + "Meteor.onConnection", + "DDP.connect" ], {name: "Collections", id: "collections"}, [ @@ -148,6 +162,7 @@ var toc = [ {instance: "collection", name: "findOne"}, {instance: "collection", name: "insert"}, {instance: "collection", name: "update"}, + {instance: "collection", name: "upsert"}, {instance: "collection", name: "remove"}, {instance: "collection", name: "allow"}, {instance: "collection", name: "deny"} @@ -184,13 +199,9 @@ var toc = [ "Meteor.users", "Meteor.loggingIn", "Meteor.logout", + "Meteor.logoutOtherClients", "Meteor.loginWithPassword", - {name: "Meteor.loginWithFacebook", id: "meteor_loginwithexternalservice"}, - {name: "Meteor.loginWithGithub", id: "meteor_loginwithexternalservice"}, - {name: "Meteor.loginWithGoogle", id: "meteor_loginwithexternalservice"}, - {name: "Meteor.loginWithMeetup", id: "meteor_loginwithexternalservice"}, - {name: "Meteor.loginWithTwitter", id: "meteor_loginwithexternalservice"}, - {name: "Meteor.loginWithWeibo", id: "meteor_loginwithexternalservice"}, + {name: "Meteor.loginWith", id: "meteor_loginwithexternalservice"}, {type: "spacer"}, {name: "{{currentUser}}", id: "template_currentuser"}, @@ -297,23 +308,27 @@ var toc = [ {name: "EJSON.isBinary", id: "ejson_is_binary"}, {name: "EJSON.addType", id: "ejson_add_type"}, [ - {instance: "instance", id: "ejson_type_clone", name: "clone"}, - {instance: "instance", id: "ejson_type_equals", name: "equals"}, {instance: "instance", id: "ejson_type_typeName", name: "typeName"}, - {instance: "instance", id: "ejson_type_toJSONValue", name: "toJSONValue"} + {instance: "instance", id: "ejson_type_toJSONValue", name: "toJSONValue"}, + {instance: "instance", id: "ejson_type_clone", name: "clone"}, + {instance: "instance", id: "ejson_type_equals", name: "equals"} ] ], - "Meteor.http", [ - "Meteor.http.call", - {name: "Meteor.http.get", id: "meteor_http_get"}, - {name: "Meteor.http.post", id: "meteor_http_post"}, - {name: "Meteor.http.put", id: "meteor_http_put"}, - {name: "Meteor.http.del", id: "meteor_http_del"} + "HTTP", [ + "HTTP.call", + {name: "HTTP.get"}, + {name: "HTTP.post"}, + {name: "HTTP.put"}, + {name: "HTTP.del"} ], "Email", [ "Email.send" + ], + {name: "Assets", id: "assets"}, [ + {name: "Assets.getText", id: "assets_getText"}, + {name: "Assets.getBinary", id: "assets_getBinary"} ] ], @@ -324,6 +339,7 @@ var toc = [ "audit-argument-checks", "backbone", "bootstrap", + "browser-policy", "coffeescript", "d3", "force-ssl", diff --git a/docs/client/introduction.html b/docs/client/introduction.html index c18142f5c14..fd1a4d0530d 100644 --- a/docs/client/introduction.html +++ b/docs/client/introduction.html @@ -110,6 +110,8 @@

开发者资源

Meteor 的代码在 GitHub 上, 贡献代码的最佳方式是使用 GitHub 的 pull request 功能;提交 bug 的最佳方式使用 GitHub 的 issue 功能。如果你的 issue 中包含敏感信息或安全问题,请邮件联系安全团队: security@meteor.com
+ 如果你要贡献代码,请看Contributing to Meteor 。 + {{/markdown}} diff --git a/docs/client/packages.html b/docs/client/packages.html index 0ee701bbe8f..077e4f1cd19 100644 --- a/docs/client/packages.html +++ b/docs/client/packages.html @@ -22,6 +22,7 @@

Packages

{{> pkg_audit_argument_checks}} {{> pkg_backbone}} {{> pkg_bootstrap}} +{{> pkg_browser_policy}} {{> pkg_coffeescript}} {{> pkg_d3}} {{> pkg_force_ssl}} diff --git a/docs/client/packages/appcache.html b/docs/client/packages/appcache.html index fd7591618f7..4f2885b189a 100644 --- a/docs/client/packages/appcache.html +++ b/docs/client/packages/appcache.html @@ -44,7 +44,8 @@ }); The supported browsers that can be enabled or disabled are `android`, -`chrome`, `chromium`, `firefox`, `ie`, `mobileSafari` and `safari`. +`chrome`, `chromium`, `chromeMobileIOS`, `firefox`, `ie`, +`mobileSafari` and `safari`. Browsers limit the amount of data they will put in the application cache, which can vary due to factors such as how much disk space is diff --git a/docs/client/packages/browser-policy.html b/docs/client/packages/browser-policy.html new file mode 100644 index 00000000000..5bede3d5b24 --- /dev/null +++ b/docs/client/packages/browser-policy.html @@ -0,0 +1,174 @@ +