Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jthegedus/firebase-functions-es6-example
Use ES6 to develop Cloud Functions for Firebase today!
https://github.com/jthegedus/firebase-functions-es6-example
cloud-function-for-firebase cloud-functions es6 firebase firebase-functions google-cloud-functions serverless
Last synced: 3 months ago
JSON representation
Use ES6 to develop Cloud Functions for Firebase today!
- Host: GitHub
- URL: https://github.com/jthegedus/firebase-functions-es6-example
- Owner: jthegedus
- License: other
- Archived: true
- Created: 2017-04-26T12:27:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-04T05:37:02.000Z (almost 7 years ago)
- Last Synced: 2024-07-18T04:33:49.415Z (4 months ago)
- Topics: cloud-function-for-firebase, cloud-functions, es6, firebase, firebase-functions, google-cloud-functions, serverless
- Language: JavaScript
- Homepage: https://codeburst.io/es6-in-cloud-functions-for-firebase-959b35e31cb0
- Size: 65.4 KB
- Stars: 20
- Watchers: 2
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [DEPRECATED] ES6+ in Cloud Functions for Firebase
This example is deprecated in favour of [ES6+ in Cloud Functions 2](https://medium.com/@jthegedus/es6-in-cloud-functions-for-firebase-2-415d15205468) and it's folder in my [blog-examples](https://github.com/jthegedus/blog-examples/tree/master/firebase-functions-es6-babel) repo.
---
Use ES6+ to develop Cloud Functions for Firebase today!
Here is the accompanying [Medium post](https://medium.com/@jthegedus/es6-in-cloud-functions-for-firebase-959b35e31cb0).
## TLDR;
Develop your Coud Functions in a different directory to the default `./functions` directory. I suggest `./functionsES6`. Then use `babel-cli`, `babel-preset-es2015` and `rimraf` with some npm scripts to transpile to ES2015 into the default `./functions` directory on deploy (`yarn deploy`).
Files of interest:
* Root [package.json](https://github.com/jthegedus/firebase-functions-es6-example/blob/master/package.json)
* Cloud Functions [package.json](https://github.com/jthegedus/firebase-functions-es6-example/blob/master/functionsES6/package.json)
* Cloud Functions [index.js](https://github.com/jthegedus/firebase-functions-es6-example/blob/master/functionsES6/index.js)## Installation
```
git clone https://github.com/jthegedus/firebase-functions-es6-example
cd firebase-functions-es6-example
yarn install
```## Deploy to Firebase
```
yarn deploy
```N.B.: You will need to connect the project to your Firebase project. Edit the name in [.firebaserc](https://github.com/jthegedus/firebase-functions-es6-example/blob/master/.firebaserc)
## A note on Code Compatibility
Everything was tested on Ubuntu 17.04. If you wish for Windows native support please [submit an issue](https://github.com/jthegedus/firebase-functions-es6-example/issues/new) so we can work on a Windows branch. Please report any macOS errors as I do not have access to a device to test. [My development environment can be found here](https://github.com/jthegedus/dotfiles).