NPDev Collection - easier wrapper for Offline first, SSR enabled collections for Meteor with React

I finally got that module up I’ve been talking about. It has been graciously contributed by the folks at PixStori, where a version of this is already used in production (and this exact version will soon be deployed). It’s a bit messy right now (especially the readme) but it works. I called it NPDev:Collections, because I"m terrible at naming things. Have a look if you are interested - feedback would be wonderful. (Note: This is not published on atmosphere yet.)

What does it do? It provides a utility function for creating collections and connectors, which allows one to easily wire up offline collections for use in React based projects, with data delivered over methods with pagination, SSR and fast-render style data hydration, all built on top of DDP and mongo/mini-mongo.

The idea was to make it just as easy to set all that up as it is to set up DDP - basically to do things the meteor way. Really, I was getting overwhelmed trying to keep all the various parts of a modern app together while trying to also rapidly iteration on my collections. Putting all this in a nice easy to configure package allows me to separate my efforts - when I’m thinking about my app development, I don’t want to have to think about how to keep everything offline and SSR friendly all the time - that’s too much cognitive overhead.

The readme does not have anything like a tutorial for setting this up yet. If there is interest, I’ve been thinking about trying to get together a how I develop meteor apps type book, which could even include some of the thought process that lead to this. I thought I’d get some feedback on just this to start.

7 Likes

I update the readme to explain how to use this. Have a look!.

Next, I’ll try to update my starter repo to included this package this week.

1 Like

NPDev:Collections has been published! Grab it from atmosphere. This should be considered very early alpha, as the API is likely to change (it actually already has).

I also updated my starter, which shows how to wire everything up. Check out the commit history for an almost step by step for setting it up.

4 Likes

I’ve added a little SSR helper functions that can be used along with the NPDev:Collections to manage the hydration of user and other custom data during SSR.

You can find it here. I’m linking to NPDev Collection because both aim to make the SSR story a bit easier. Maybe we can create Server-Render-Plus to provider a set of tools to make Meteor’s SSR much easier.

2 Likes

I saw that you posted that in announce - looks pretty sweet! I’m going to be away this weekend, but I’ll check it out next week. Nice work!

1 Like