GithubHelp home page GithubHelp logo

appscurrystep1's Introduction

Using ES6 in Google Apps Script (example project)

This is an example project where we use ES6 features in Google Apps Script

This project uses webpack and babel to bundle ES6 code and then use the clasp command line tool to upload the project to your Google Account.

See the full article here

Usage

Install clasp command line tool

npm install @google/clasp -g

Then login to your Google account

clasp login

Open terminal and clone this project.

You have to create an Apps Script project to run this code.

clasp create --type standalone --title "Apps Script with Webpack and babel"

Now build the project and upload to your newly created Apps Script project

npm install
npm run deploy

Approach

Google Apps Script expects to have some global functions in your code. For a standalone web app project, it is the doGet() function. doGet() function renders the standalone web app's main page. You can see this function in server/api.js

In server/lib.js, we have the advanced ES6 code. we use babel and webpack to cross compile lib.js and place it in the distribution. (see the webpack configutaion file) We upload only the compiled bundle and api.js (api.js is uploaded unmodified)

Next steps

See AppsCurry Step 2 where we add npm modules (momentjs and lodash) to the project.

See the complete article series here.

Disclaimers

The author does not represent nor associated with Google in any way. This is project is only for learning purposes.

appscurrystep1's People

Contributors

prasanthmj avatar

Stargazers

jinzaizhichi avatar Ryan Rubush avatar Arthur Godinho Barbosa avatar yoemie avatar Saleeh avatar Dan avatar Chiu, Yung-Hsiang  avatar Dawn Brendle Jackson avatar Leonardo Santos avatar Goran Kukurin avatar Chris McDermut avatar  avatar Spencer Watson avatar Jon Repp avatar Manuel Puentes avatar  avatar Cal Herries avatar Laura Taylor avatar

Watchers

Aakarsh Nair avatar James Cloos avatar  avatar

appscurrystep1's Issues

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.