Skip to content
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

FR: client only mode (db with no remote link) #45

Closed
hville opened this issue Jun 11, 2017 · 3 comments
Closed

FR: client only mode (db with no remote link) #45

hville opened this issue Jun 11, 2017 · 3 comments

Comments

@hville
Copy link

hville commented Jun 11, 2017

It would be nice to be able to initiate a client-only database (no url, no remote link). Use cases:

  • viewStore seperate from the datastore
  • prototypes, stubs and testing
  • components with common interfaces

My specific use case is that the model data (what is shared) needs to be heavily transformed on the client side (monte carlo simulations in web worker) so that an internal view DB is needed in addition to the shared model DB.

Given that firebase database lib is already over 100kb it feels akward need another lib (pouch db, lokijs, gun, ...) for internal app use to implement similar functionalities in a different API.

This is partly related to #34 (testing) since it would also facilitate creating and unit-testing independent module and components by removing all of the console registering and development server requirements.

Edit

I found out I can use firebase.initializeApp({databaseURL: 'x.y.z'}, 'local').database().goOffline() but it feels like a bit of hack. Is it the correct way to do it or is this likely to fail in the future?

@hville hville closed this as completed Jun 11, 2017
@hville
Copy link
Author

hville commented Jun 11, 2017

FWIW i closed this issue since it could work as described.
It still doesn't work for me because the es6 exports for node and the browser are different and incompatible. I can't get it to work with rollup which is likely another issue.

@jshcrowthe
Copy link
Contributor

I'd love to hear more about the rollup issue. If you could get me an isolated repro (and open a new issue) I'd love to take a look.

@hville
Copy link
Author

hville commented Jun 12, 2017

Thanks @jshcrowthe , I don't know if what I am encountering is a bug, a feature or my incompetence so I did not really know where to park it. In any case, I've opened #47 in case something can be done.

@firebase firebase locked and limited conversation to collaborators Oct 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants