-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question]usage with meteor 1.3 #153
Comments
I was wondering about the same. Looking forward to get an answer here. |
Looking to the alpha 1.0 branch, there is no update since August '15? Is this project frozen? |
I simply tried:
I got: So I think it is not compatible yet. |
Try |
Yep, it is what I did, I pasted the wrong part. Plus, the package removes So for now, it is not usable in 1.3. |
Too bad. It's a package I used for a mobile app with great success. It's perfect for offline mobile apps. I hope the library will eventually be updated for Meteor 1.3 |
I hope so much too! And I will attempt a nasty ping to @raix to know his plans about this :) |
Hi guys - working on it :) |
<3 |
Great! :) |
Is the issue fixed for Meteor 1.3 version? |
Hi @raix do you need some help for the next grounddb version? I don't know if I have the level for collaborating on this but if you have got clear task todo I can look at it. |
@dagatsoin thanks sorry about the delay - solving this issue just got in my sprint - I'll try to outline things in issues/milestones so others can contribute and help out. |
Ok, count me in. |
Hey guys, cc.: @dagatsoin Take a look at I've decoupled the new ground db to be a pure caching db (at least for now) - The major reason is that it's more important to have better control of the cached data. Second reason is than you might want to swap out the source at some point. MigrationMigration would probably look something like: // current "connection-driver"
var foo = Ground.Collection('bar', {
cleanupLocalData: false, // Manually trigger cleanup
});
Meteor.subscribe('bar', () => {
foo.removeLocalOnly(); // Match grounded data with subscription
}); // current "ground db II"
const bar = new Mongo.Collection('bar');
const foo = new Ground.Collection('foo');
foo.observeSource(bar.find()); // Cache bar or a subset of bar
Meteor.subscribe('bar', () => {
foo.keep(bar.find()); // Match grounded data with subscription or a subset
});
// You might also want to point bar finds to foo - this is a custom case depending
// on implementation
bar.find = function(...args) {
return foo.find(...args);
};
bar.findOne = function(...args) {
return foo.findOne(...args);
}; Again the GroundDB II does not cache/resume outstanding method calls or try to be clever about things - but it supports localforage (localstorage/indexeddb/websql and SQLite on cordova) so it's non blocking. Comparison with approximate 2.000 documents:Current ground db: (Notice the white screen at first while ground db is blocking) |
Hi @raix, I'm just showing up to the Meteor+GroundDB party and seeing this note about your next version, specifically the bit about no longer resuming outstanding methods. It's a little confusing to me, though. Suppose I want to insert an object into a collection. Can that be done securely without using a server method? |
@raix I am ready to dive in groundb. Question: how to manage storage system? I use Cordova and will surely use the SQLite plugin. So how to make sure that grounddb will use SQLite? |
And which SQLite plugin must we use? https://github.com/litehelpers/Cordova-sqlite-storage or https://github.com/nolanlawson/cordova-plugin-sqlite-2? |
@raix I'm building an app for a clinic and would require data offline. Its on Meteor 1.3. Which version should I go ahead with? Ground DB 1 or if 2 alpha is usable on production as well? Any help or alternatives would be useful! |
@dagatsoin the import localforage from 'localforage';
import Ground from 'meteor/ground:db';
const fooStorageAdapter = localforage.createInstance({
driver: window.cordovaSQLiteDriver._driver, // Not tested - depends on the plugin
name: 'foo',
version: 1.0,
});
const foo = new Ground.Collection('foo', {
storageAdapter: fooStorageAdapter,
});
foo.observeSource(bar.find()); @atulmy on Meteor 1.3 I would use |
hi @raix I don't get how to install the The terminal displayed:
So I guess it is OK. But When I try to import it with |
and import Could be useful to know the installation steps. Thx :) EDIT: note I am using Typescript. I will look on the type definition file side. |
oh - there might be issues with the typescript/meteor import syntax - not sure if it's actually working. the latest ground db is not using SQLite - it should add the npm version of localstorage however. ref |
You mean it does not use SQLite "directly"? |
What is the best approach to abstract Mongo.collection and Ground.collection? EDIT:
|
Yep, resume of methods is very needed and it was what made V1 stand out, I mean perfect. |
Hi @raix , ok , I get the idea of Ground:DB II, maybe that would make it easier to implement something like offline storage for React/GraphQL, more decoupled and adaptable. Would it be possible to have a sample/demo app or some more documentation then so we can understand the new functionality and implement it into our apps? Regards |
@Der-Ede I'm not sure, theres already a nice implementation for redux https://github.com/rt2zz/redux-persist At the moment I'm holding back just a bit on Meteor and GraphQL |
Hi @raix
But I have errors:
|
@dagatsoin I think you might have to hijack the Meteor.users collection on the client, eg.: export const GUser = new GroundCollection('user');
GUser.observeSource(Meteor.users.find());
Meteor.users.find = function(args...) {
return GUser.find(...args);
} |
No, ever tried bit as as I log into:
Or when I want to just keeping the current user with
I get
|
Personally meteor.user can be grounded (tough the doc would gain to be more clear about keep/observeSource etc.) |
@raix why do you say :
In the description :
Actually when I make changes in a tab, reactivity makes that my other tab are updated accordingly to the changes I made from one tab. When I read you first, I've been thinking that when an user make a change in one tab, others tabs would keep an old, not updated accordingly to the other tab, version but it's not the case. |
@raix can you explain why do you say that there's no sync between tabs, we're some to be confused |
If you disconnect the server tab updates will stop working |
what do you mean by "core principle" of Meteor? |
The behavior you described is not related with data persistence. It is related to network. |
In anyway as methods doesn't work offline when tab are needed to be synced when offline ? |
sorry to ask, but what is it with the tabs? |
In my website people will be likely to have multiple tabs open. |
@nitrobay: I was just thinking whether I open multiple tabs on a site and actually I do, but only on google search and on my cloud bookkeeping software, in the second case of which this could be omitted if the service was programmed better. |
Yeah I'll definitely test this use case |
Hi @dagatsoin any luck caching Meteor.user? Thanks |
Hi,
I just found your package while looking around to have a CouchDB like behavior with sync offline/online and persistant data. I will use Cordova and Meteor 1.3 for my project.
Do you know any issues to use the alpha version of GroundDB with 1.3?
The text was updated successfully, but these errors were encountered: