From c9ea1f2d9e48bee1aad398ee084bb85e79799018 Mon Sep 17 00:00:00 2001 From: Jan Dvorak Date: Tue, 31 Aug 2021 13:59:34 +0200 Subject: [PATCH] Update docs and guide for recent changes --- History.md | 5 +++++ packages/ddp-server/livedata_server.js | 28 ++++++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/History.md b/History.md index 561805541b..4aab1c0a96 100644 --- a/History.md +++ b/History.md @@ -7,6 +7,7 @@ * Use `createIndex` instead of `_ensureIndex` to align with new MongoDB naming. * Apollo skeleton has been upgraded for [Apollo server v3](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md#v300) * `reify` has been updated to v0.22.1 which reduces the overhead of `import` statements and some uses of `export ... from`, especially when a module is imported a large number of times or re-exports a large number of exports from other modules. PRs [1](https://github.com/benjamn/reify/pull/246), [2](https://github.com/benjamn/reify/pull/291) +* Meteor NPM installer is [now available for all platforms](https://github.com/meteor/meteor/pull/11590). #### Meteor Version Release @@ -24,6 +25,7 @@ - npm dependencies have been updated - Added option to change runtime config in your app, [read more](https://github.com/meteor/meteor/pull/11506) - `@vlasky/whomst@0.1.7` + - Added `addUpdateNotifyHook` that gets called when runtime configuration is updated * `logging@1.3.0` - Switch from `cli-color` to `chalk` to have the same dependency as meteor-tool @@ -55,6 +57,9 @@ * `oauth1@1.5.0` - Migrated usage of `_ensureIndex` to `createIndex` +* `facebook-oauth@1.10.0` + - Added login handler hook, like in the Google package for easier management in React Native and similar apps. [PR](https://github.com/meteor/meteor/pull/11603) + * `service-configuration@1.5.0` - Migrated usage of `_ensureIndex` to `createIndex` diff --git a/packages/ddp-server/livedata_server.js b/packages/ddp-server/livedata_server.js index 2dd24f3003..3fa377a833 100644 --- a/packages/ddp-server/livedata_server.js +++ b/packages/ddp-server/livedata_server.js @@ -1335,7 +1335,7 @@ Object.assign(Subscription.prototype, { } ids.add(id); } - + this._session.added(this._subscriptionHandle, collectionName, id, fields); }, @@ -1516,16 +1516,32 @@ Object.assign(Server.prototype, { return self.onConnectionHook.register(fn); }, - setPublicationStrategy(collectionName, strategy) { + /** + * @summary Set publication strategy for the given publication. Publications strategies are available from `DDPServer.publicationStrategies` + * @locus Server + * @param publicationName {String} + * @param strategy {{useCollectionView: boolean, doAccountingForCollection: boolean}} + * @memberOf Meteor + * @importFromPackage meteor + */ + setPublicationStrategy(publicationName, strategy) { if (!Object.values(publicationStrategies).includes(strategy)) { throw new Error(`Invalid merge strategy: ${strategy} - for collection ${collectionName}`); + for collection ${publicationName}`); } - this._publicationStrategies[collectionName] = strategy; + this._publicationStrategies[publicationName] = strategy; }, - getPublicationStrategy(collectionName) { - return this._publicationStrategies[collectionName] + /** + * @summary Gets the publication strategy for the requested publication. + * @locus Server + * @param publicationName {String} + * @memberOf Meteor + * @importFromPackage meteor + * @return {{useCollectionView: boolean, doAccountingForCollection: boolean}} + */ + getPublicationStrategy(publicationName) { + return this._publicationStrategies[publicationName] || this.options.defaultPublicationStrategy; },