Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e12027d

Browse files
committed
Make functions-next
1 parent 5582819 commit e12027d

File tree

7 files changed

+30
-9
lines changed

7 files changed

+30
-9
lines changed
File renamed without changes.

functions/src/emulator-suite.js renamed to functions-next/emulator-suite.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { initializeApp, getApp } from "firebase/app";
2-
import { getFunctions, useFunctionsEmulator, httpsCallable } from "firebase/functions";
1+
// [SNIPPETS_SEPARATION enabled]
2+
import { initializeApp } from "firebase/app";
33

44
initializeApp({
55
projectId: '### CLOUD FUNCTIONS PROJECT ID ###',
@@ -9,13 +9,19 @@ initializeApp({
99

1010
export function emulatorSettings() {
1111
// [START functions_emulator_connect]
12+
const { getApp } = require("firebase/app");
13+
const { getFunctions, useFunctionsEmulator } = require( "firebase/functions");
14+
1215
const functions = getFunctions(getApp());
1316
useFunctionsEmulator(functions, "http://localhost:5001");
1417
// [END functions_emulator_connect]
1518
}
1619

1720
export async function callFunction() {
1821
// [START functions_callable_call]
22+
const { getApp } = require("firebase/app");
23+
const { getFunctions, httpsCallable } = require( "firebase/functions");
24+
1925
const functions = getFunctions(getApp());
2026
const addMessage = httpsCallable(functions, 'addMessage');
2127

functions-next/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "functions-next",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "webpack",
6+
"compile": "cp ../tsconfig.json.template ./tsconfig.json && tsc"
7+
},
8+
"license": "Apache-2.0",
9+
"dependencies": {
10+
"firebase": "^0.800.3"
11+
}
12+
}

functions/emulator-suite.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var firebase = require('firebase/app');
2+
require('firebase/functions');
3+
4+
function emulatorSettings() {
5+
// [START functions_emulator_connect]
6+
firebase.functions().useFunctionsEmulator("http://localhost:5001")
7+
// [END functions_emulator_connect]
8+
}

functions/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22
"name": "functions",
33
"version": "1.0.0",
44
"scripts": {
5-
"build": "webpack",
65
"compile": "cp ../tsconfig.json.template ./tsconfig.json && tsc"
76
},
87
"license": "Apache-2.0",
98
"dependencies": {
10-
"firebase": "^0.800.3"
11-
},
12-
"devDependencies": {
13-
"webpack": "^4.43.0",
14-
"webpack-cli": "^3.3.12"
9+
"firebase": "^7.17.1"
1510
}
1611
}

functions/src/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

lerna.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"firestore",
88
"firestore-next",
99
"functions",
10+
"functions-next",
1011
"installations"
1112
],
1213
"version": "1.0.0"

0 commit comments

Comments
 (0)