Code Monkey home page Code Monkey logo

firebase-js-sdk's Introduction

Build Status

Firebase Javascript SDK

The Firebase JavaScript SDK implements the client-side libraries used by applications using Firebase services. This SDK is distributed via:

To get started using Firebase, see Add Firebase to your JavaScript Project.

SDK Dev Workflow

Prerequisites

Before you can start working on the Firebase JS SDK, you need to have Node.js 6.0 or greater installed on your machine. After doing this, you must also install the dependencies for this package.

To download Node.js visit https://nodejs.org/en/download/.

Once you've verified that you are using version 6.0 or later (run node -v to see your current running version of Node.js), you can install the dependencies by running:

$ npm install

NOTE: This package also maintains a yarn.lock so you can get faster installs by installing dependencies with yarn instead.

Pipeline Instructions

The Firebase JS SDK is built and tested through a gulp pipeline. You will need to have the gulp command available on your system to run the tasks yourself.

To install gulp simply run:

$ npm install -g gulp-cli

NOTE: Installing gulp-cli is optional as you can simply leverage the npm commands for most interactions.

Gulp Pipeline

Most of the tasks for interacting with the SDK are defined through gulp. If you installed gulp globally, you can run the following to see all of the available gulp tasks:

gulp --tasks

Testing the SDK

To run all tests for the SDK you must first supply a firebase project config for your tests. This is done by creating a file called project.json and at the following path:

tests/config/project.json

This file should contain a JSON object with your app information (i.e. the same information you would pass to firebase.initializeApp).

After you have done this, simply run: npm test at the root of this package.

There are several types of available tests:

  • Unit Tests (gulp test:unit)
  • Integration Tests (gulp test:integration)

NOTE: You can execute each of these tasks on their own (e.g. you can run gulp test:unit to run exclusively the smoke tests from your CLI)

Building the SDK

Introduction

The Javascript SDK is built through a gulp pipeline.

To build the project run npm run build in your CLI.

This will generate all of the output assets in a /dist folder available at the root of this project.

Each of the different types of source files are explained more in detail below.

Source File Handling

Our source files are all located in the /src directory. This currently contains a variety of different sources (typescript, prebuilt binaries, legacy). We handle each of these cases in our gulp pipeline.

Typescript Source

This is the planned source language for this repo. As we are able, all components will be migrated to typescript and processed in the following flow:

  1. TS Files are compiled to ES6 using the Typescript compiler
  2. ES6 Files are transpiled to CJS Modules using Babel
  3. ES6 Files are processed with webpack to attach to the window global

Prebuilt Binaries

To allow firebase to build from Github we consume prebuilt binaries of our components until the source is migrated to this repo.

These files are processed in the following flow:

  1. Prebuilt browser binaries are ready to consume individually in the browser however we need to wrap them in a CJS module wrapper for node/webpack/browserify consumption.
  2. The Firebase App binary is generated (from TS) and concatenated with the browser binaries of each individual module to create firebase.js.

Legacy Files

These files are built in this repo but are being migrated to typescript as we are able. Once these files are migrated, the associated build process, will be removed.

Contributing

See Contributing for more information on contributing to the Firebase JavaScript SDK.

firebase-js-sdk's People

Contributors

bojeil-google avatar ileoww avatar ismailbaskin avatar jimihford avatar jsayol avatar jshcrowthe avatar knpwrs avatar rockwotj avatar schmidt-sebastian avatar sphippen avatar tracker1 avatar vikrum avatar

Watchers

 avatar  avatar

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.