Is there a way to remove ember-data from emberfire? - firebase

My app does not use ember-data, it uses only apollo for graphql to retrieve/manage data.
But after installing emberfire, we must have to install ember-data too.
We just use emberfire/firebase for authentication :)
If I try to remove it I've got an error:
Cannot find module 'ember-data/package.json' from '/Users/bruno/octane-graphql/node_modules/emberfire'

The solution here is simple: don't use emberfire!
Basically the entire concept of emberfire is to intergrate firebase into ember-data. If you just want to use some firebase services use the firebase sdk directly.

emberfire uses ember-data under the hood. So you need to have it installed.

Related

Generating Swagger Docs in Firebase Cloud Functions project

Is it possible to generate Swagger Spec file from function comments in firebase cloud functions? If so, how can we do it?
I see the cloud functions code to be more like serverless, so wondering if this is possible.
I haven't found an automatic way, but there are plenty of libraries to choose from.
I'm using express and nodejs in my Firebase Function implementations, and for me,
Swagger doc generation can be implemented via the following libraries:
https://github.com/scottie1984/swagger-ui-express
https://github.com/Surnet/swagger-jsdoc
You can find other libraries at:
https://swagger.io/tools/open-source/open-source-integrations/
This will create a new HTTP endpoint, which will serve an HTML page of a swagger doc.
There is not an automatic way to do this at this time. I think you could build your own but seems like it would be a lot of work.

How to integrate jsreport to meteor application

Can anyone help me how to integrate jsreport to meteor application and how to use it to generate pdfs using data from database?
You can use the node package for that.
Link:: here
Don't forget to import the package before use.
You can also check the following example also which is using jsreport-client.
Link:: Here

Firebase Auth reports 'provider is not enabled' when it is enabled

I have a Firebase app written in Polymer and I can't use Auth.
It tells me 'Error: The specified authentication provider is not enabled for this Firebase.' but I have allowed this in the console.
I tried switched the Firebase URL to the one used in the demo and it worked like a charm but when I tried using my URL it doesn't.
Am I using a wrong URL?
My Firebase element is below
<firebase-auth
id="firebaseLogin"
user="{{user}}"
status-known="{{statusKnown}}"
location="https://teste-firebase-822c4.firebaseio.com"
provider="{{provider}}"
on-error="errorHandler"
on-user-created="userSuccessHandler"
on-password-changed="userSuccessHandler"
on-password-reset="userSuccessHandler"
on-user-removed="userSuccessHandler"></firebase-auth>
Is this wrong? https://teste-firebase-822c4.firebaseio.com
Thanks for your time.
The current version of the Polymer firebase-auth component (1.0.12), is built for the Firebase version from firebase.com:
Element wrapper for the Firebase authentication API (https://www.firebase.com/docs/web/guide/user-auth.html).
That means it uses the 2.x version of the Firebase JavaScript SDK.
If you created your Firebase project on the new Firebase Console, it will only work with the 3.x version of the JavaScript SDK. You'll need an updated version of the component, which doesn't seem to be available yet.
I suspect the plan is to deprecate firebase-element and firebase-auth and migrate to the new Polymerfire element.
Here the relevant Github issue discussion.

Firebase client on ReactNative

When using Firebase on ReactNative, it will show such error message:
can't find variable process
However, if I require firebase/lib/firebase-web.js manually, it will show:
can't find variable document
How can I resolve this?
I just went through the same issue while trying to use sockets.io in my react native app so hopefully I can help.
The reason that you cannot use firebase's node module is because there hasn't been a polyfill created yet for websockets support (which firebase is dependent on) in react native.
If you take a look at issue #619 in react native's repo you'll find the current discussion on creating a websockets api polyfill.
The way that we solved it is by using Jason's modified version of the sockets library and creating our own repo around just that file. Then we added the line below to our package.json dependencies.
"react-sockets": "crewapp/react-native-sockets-io"
The reason that Jason's version of the sockets.io client file works is because react-native is added as a user agent. You can find the code that makes this change at the top of the file:
window.navigator = {
userAgent: "react-native"
}
Once you've gone through these steps you should be able to require sockets.io / firebase as normal.
Just figuring it our. Pavan's answer is helpful, but it is not quite true when using with Firebase.
For firebase, please follow the steps:
Download the firebase-debug.js from wsExample. Or you can just install wsExample by npm and require the firebase-debug.js inside it.
Use badfortrains's forked React-Native:
"react-native": "git://github.com/badfortrains/react-native#WebSocket"
New the Firebase like this:
var firebase = require("../../firebase-debug.js");
var rootRef = new Firebase(Const.FB_ROOT);
Things should just work now!
I had issues with socket.io on React Native too, solution was to get notifications about new data and if data is big enough - get it by simple RESTfull request. in my case data was small enough to be sent all within notifications API.
I was using GCM service to send notification to phone from nodejs server. BTW, it uses less battery then socket connection and works great :)

Custom Meteor Accounts

I need to implement a new accounts package with trakt.tv service via OAuth2.
How can I use the source of accounts-facebook or other already implemented to create my own?
This already has been answered here, in resume, you need to create a
local package
and take a look into the meteor-accounts-stripe to get the idea about how to create a new OAuth package
If you check out the Meteor Packages at GitHub you can reverse engineer a solution.
Also see the Accounts project page at Meteor.

Resources