Skip to content

Commit 17b731e

Browse files
authored
Merge pull request #5 from filipenevola/mock-server-for-publication-strategies
Mocks the server property inside the already mocked session
2 parents d9b622d + d32314c commit 17b731e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Fast Render can improve the initial load time of your app, giving you 2-10 times
2727
- [Client Error: "Server sent add for existing id"](#client-error-server-sent-add-for-existing-id)
2828
- [No data is injected when using "AppCache" package](#no-data-is-injected-when-using-appcache-package)
2929
- [No data is injected when using Meteor Subscription Cache](#no-data-is-injected-when-using-meteor-subscription-cache)
30+
- [No support for publication strategies](#no-support-for-publication-strategies)
3031
- [Debugging](#debugging)
3132
- [Block DDP](#block-ddp)
3233
- [Get Payload](#get-payload)
@@ -205,6 +206,10 @@ Related Issue & Discussion: <https://github.com/kadirahq/fast-render/issues/136>
205206

206207
When using the subscache package (`ccorcos:subs-cache` or `blockrazor:subscache-c4`) the parameters passed to the subscription must the identical on both Fast Render and Subscache or no data will be injected.
207208

209+
### No support for publication strategies
210+
211+
This package could affect the behavior of non-default [publication strategies](https://docs.meteor.com/api/pubsub.html#Publication-strategies).
212+
208213
## Debugging
209214

210215
Sometimes, you need to test whether Fast Render is working or not. You can do this using the built-in debugger. The debugger works on the client and is safe to run it on a deployed app. It has a few useful features:

lib/server/publish_context.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ import { EJSON } from 'meteor/ejson';
44
import { Meteor } from 'meteor/meteor';
55
import { MeteorX } from 'meteor/montiapm:meteorx';
66

7+
// mock server
8+
const server = {
9+
getPublicationStrategy () {
10+
return {
11+
useCollectionView: true,
12+
doAccountingForCollection: true,
13+
};
14+
},
15+
};
16+
717
const PublishContext = function PublishContext (
818
context,
919
handler,
@@ -14,6 +24,7 @@ const PublishContext = function PublishContext (
1424
// mock session
1525
const sessionId = Random.id();
1626
const session = {
27+
server,
1728
id: sessionId,
1829
userId: context.userId,
1930
// not null

0 commit comments

Comments
 (0)