GithubHelp home page GithubHelp logo

ampatspell / ember-cli-zuglet Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 0.0 9.43 MB

🔥 Easiest way to use Google Firebase services in your Ember.js Octane app

Home Page: https://www.ember-cli-zuglet.com

License: MIT License

JavaScript 90.99% HTML 0.84% Handlebars 5.09% SCSS 3.08%
emberjs ember-addon firebase firestore persistence documents ember-octane glimmer ember ember-cli-zuglet

ember-cli-zuglet's Introduction

ember-cli-zuglet CI npm version

This addon is dead simple way to use Google Firebase services in your Ember.js apps. Cloud Firestore, Storage, Auth, Functions.

ember-cli-zuglet is built and maintained by Arnis Vuskans, contact me for Ember.js, ember-cli-zuglet and Google Firebase consulting.

ember-cli-zuglet@^2.0.0 is a complete rewrite for Ember.js Octane edition.

Open source apps built using ember-cli-zuglet:

Install

$ ember new foof --skip-npm
"devDependencies": {
-    "ember-data": "~3.22.0",
}
$ ember install ember-cli-zuglet

Open app/store.js and add your Firebase config.

Documentation

See the ember-cli-zuglet website for documentation and dummy app for examples.

Tweaks

// jsconfig.json
{
  "compilerOptions": {
    "target": "es6",
    "experimentalDecorators": true
  },
  "exclude": [ "node_modules", ".git" ]
}

Other useful addons to install

$ ember install tracked-toolbox
$ ember install macro-decorators

ember-cli-zuglet's People

Contributors

ampatspell avatar dependabot[bot] avatar ember-tomster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ember-cli-zuglet's Issues

Update storage API

  • deprecate storage ref.child in favor of ref.ref
  • add toStringExtension to storage refs

Fastboot shoebox support

  • Queries and doc loads can be identified identified
  • query() and doc.load() can have a fastboot configuration (cache in memory, in rtdb and so on)
  • all the loaded documents and query states are put in shoebox (all?)
  • in client there are now three sources -- cached, server and shoebox/fastboot

add `store.models`

  • factoryFor(name)
  • create(name, props)
  • consider exposing generated models
store.models.generate('foo', Mixin, {}); // throws if exists
store.models.factoryFor('foo') // proxy or null
store.models.create('foo', { ok: true });

add `doc.observer().until(..)`

await doc.observer().until('data.status', 'exists', doc => {
  return doc.exists && doc.get('data.status') !== 'pending';
}, 1000);
  • resolves with doc when last arg returns true
  • rejects on timeout (if provided)
  • after resolve/reject observer is cancelled

document observers.promise should optionally reject

// order: observed()
let order = this.store.doc(`orders/${order_id}`).existing();
this.setProperties({ order });
await order.observers.promise;
  • this behavior should be configurable (optional: true)
  • should reject if document was not found

Optimize data array deserialize

Right now if array has any changes, array content is replaced which forces models() content to be recreated.

Instead of that do separate adds and removes.

In addition to deserialize, replaceModelValues does basically the same.

Unify observer.doc and observer.query as observer.content

let doc = this.store.doc('ducks/yellow').existing();
let observer = doc.observe();
observer.content //  => doc
let query = this.store.collection('ducks').query();
let observer = query.observe();
observer.content //  => query
  • move props
  • deprecate doc and query

`observed()` should support arrays

Observed should support arrays

feathers: observed().owner('duck').content(owner => {
  let ids = owner.duck.data.get('feathers');
  return ids.map(id => this.store.doc(`feathers/${id}`).existing());
  // returns array of documents which needs to be observed
  // all(this.feathers.map(doc => doc.observers.promise)) -- to resolve
}),

Also observer-for and resolve-observers should be aware of this

Implement `reusable()` for `model` and `models`

If model is reusable, it is not recreated, only prepare is called with new values

if reusable is a function:

model().owner('foo', 'bar').named('thing').reusable((owner, prev) => {
  let { foo, bar } = prev;
  return true;
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.