AppsScriptPulse

Master Google Apps Script UIs — Part 9: Elevating Your Game with TypeScript 👾

Taking JavaScript to the Next Level with TypeScript for your Google Apps Script Projects

A Warm Welcome Back to the Series 🎉

Hey there, and welcome back to our hands-on series on mastering Google Apps Script UIs! Now, if you’re serious about JavaScript, it’s high time we chat about TypeScript. TypeScript is a superset of JavaScript that brings static typing to the game. It’s like JavaScript put on its best suit and turned into a more organized, reliable version of itself. 😎

The reason a lot of developers are switching to TypeScript is because it can catch errors at compile-time, making debugging less of a headache (it’s like having a personal assistant who checks your work for mistakes so you don’t look silly later). In this part, we’ll let the Emojibar project rest (it’s earned it, after all!), and we’ll switch over to a different repository I frequently use as a boilerplate for my projects. This boilerplate is a work in progress, so don’t be surprised if it changes faster than you change your socks. 😅

Source: Master Google Apps Script UIs — Part 9: Elevating Your Game with TypeScript 👾

Master Google Apps Script UIs — Part 8: Deploying Across Multiple Environments

Streamlining Your Development Workflow with Multiple Deployment Environments 🚀

Kickoff: Marching Towards Deployment

Welcome back, dear coders! Our Emojibar is not just a fun prototype anymore — it’s a full-fledged tool ready to be unleashed into the wild. But before we let it run free, we need to get our house in order, or in our case, our environments. And no, I’m not talking about recycling, though you should be doing that too!

Professional development calls for setting up different environments — it’s a bit like having different outfits for different occasions. At the very least, you’ll want to have a development environment where you experiment and break things (yes, it’s encouraged!), a User Acceptance Testing (UAT) environment where your users can give your app a test drive, and a production environment, the red carpet where your app shines.

Source: Master Google Apps Script UIs — Part 8: Deploying Across Multiple Environments

Master Google Apps Script UIs — Part 7: Routing in Your GAS Front-End

Introduction

Hey there, code wranglers! 🤠 Welcome back to our Google Apps Script (GAS) UI series. Today, we’re venturing into the wild world of Single Page Applications (SPAs). For the uninitiated, a SPA is a web application that interacts with the user dynamically, rewriting the current web page with new data from the web server, instead of the default method of the browser loading entire new pages.📚

Now, why are SPAs a big deal? They help in reducing the time taken to load the entire page because only a part of the page gets updated. We’re going to bring this SPA magic to our sidebar with the help of a slick Navigo router. 🎩

No worries if ‘Navigo’ sounds like a hip new dance move. By now, you should be pretty comfy with installing dependencies from NPM. But if not, it’s like adding a shiny new tool to your utility belt. It just gives you the superpowers you need to build your web app.

Source Master Google Apps Script UIs — Part 7: Routing in Your GAS Front-End

Master Google Apps Script UIs — Part 6: Acing Client-to-Server Chatter with Promises 🤝

Welcome Back to Mastering Google Apps Script UIs: Client-to-Server Communication Spotlight

Oh, howdy folks! Just like a boomerang, you’ve found your way back to our marvelous series. If you thought the previous episodes were fire, wait till you see what’s cooking today! 🔥

We’re diving headfirst into the world of client-to-server communication. It’s like passing notes in class, but with a lot less paper and a lot more code. 📝➡️💻

Here’s the catch though — we can’t install Google Apps Script locally to run things on our dev server. Yep, that’s right. It’s like trying to install a toaster in a bathtub; it just ain’t happening. 🛁🚫🍞

But fear not, dear coder, for I’ve got a trick or two up my sleeve. We’re gonna finesse our way around this with some snazzy hacks like promises, polyfills, and mocks. Oh my!

Source: Master Google Apps Script UIs — Part 6: Acing Client-to-Server Chatter with Promises 🤝

Master Google Apps Script UIs — Part 5: Unit Testing Your Front-End With Jest 🚀

Introduction 📝

Well, well, well! Look who’s back for another session of “Weaving Magic with Code”! 😄 Today, we’re diving head-first into the magical world of unit testing. You might be wondering: “Why the fuss about unit testing?” 🤔

Unit testing, my friends, is the silent hero of software development. Picture it as a mini-pit stop where your code gets a once-over before it hits the road. The automated tests ensure that our code does exactly what we expect it to. The benefits?

  • Makes us ponder deeply about our app’s architecture, like a philosopher musing about the meaning of life 🧐
  • Forces us to clarify our expectations from functions and classes.
  • Ensures that as we revamp and update our code, we aren’t unknowingly playing host to bugs, much like a surprise party you didn’t want 🐛

Source: Master Google Apps Script UIs — Part 5: Unit Testing Your Front-End With Jest 🚀

Master Google Apps Script UIs — Part 4: Spice Up Your Project with Dev Dependencies! 🔧

Introduction

Welcome back, code wranglers! Today, we’re diving into the world of developer dependencies that make developing projects more efficient than a coffee-fueled coder on a deadline. 🚀 You can find the complete source code in the part-04 branch of the Github repository. Also, feel free to mess around with this demo spreadsheet and play with Emojibar. I’ll be updating it with every new blog post!

What Are Dev Dependencies?

Dev dependencies are like your car’s GPS: they’re not necessary for the car to run, but they sure make getting to your destination a lot easier! 🗺️ They’re modules necessary for the development and testing processes of a project, but not for its production runtime environment. They’re not bundled with the source code and help automate tasks that would otherwise make you pull your hair out.

Source: Master Google Apps Script UIs — Part 4: Spice Up Your Project with Dev Dependencies! 🔧

Building the Ultimate Google Apps Script Front Ends. Part 3: Styling with Tailwind CSS 😎

Let’s take our UI to the next level with Tailwind CSS!

Introduction

In the previous article, we learned how to bundle NPM modules with Vite. Today, we’re going to add some style with Tailwind CSS. If you’ve been following my series, you’ll breeze through this like a true professional. 🚀

Check out the part-03 branch in the Github repository for the full source code.

 

What Is Tailwind CSS

Tailwind CSS is a utility-first CSS framework that makes styling a breeze. Think of it like a wardrobe filled with every piece of clothing that you’ll ever need, with everything neatly organized and ready to go. 💃🕺

Source: Building the Ultimate Google Apps Script Front Ends. Part 3: Styling with Tailwind CSS 😎

Building the Ultimate Google Apps Script Front Ends, Part 1: Bundling with Vite 🚀

 

Last week, we talked about the best way to build front-ends for Google Apps Script. Today, let’s roll up our sleeves and dive in! 😎

Source: Building the Ultimate Google Apps Script Front Ends, Part 1: Bundling with Vite 🚀

The Ultimate Google Apps Script Front-End Development Guide. Part 0: The Worst and the Best Practices

Welcome to the Ultimate Google Ultimate Google Apps Script Front-End Development Guide!

If you are reading this post, then you likely have experience with Google Apps Script. Essentially, there are three types of front-ends that you can create with Apps Script:

  • Web apps
  • Modal/modeless dialogues
  • Sidebars

In this blog post series, we will only discuss HTML front-ends, as this is where you can create the most powerful and sophisticated user experiences. Unfortunately, the Card Service is outside the scope of this series, and it is not nearly as powerful as an HTML front-end. With that in mind, Google, how about allowing HTML front-ends for Workspace add-ons?

Source: The Ultimate Google Apps Script Front-End Development Guide. Part 0: The Worst and the Best Practices

Using design patterns in Google Apps Script

Google Apps Script is a JavaScript-based language that has access to Google Workspace-specific libraries for Gmail, Google Sheets, Google Forms, Google Drive, etc., and allows you to quickly and efficiently automate your tasks and program business applications.

A lot of users try and quickly learn GAS and use it to make their lives easier. It’s all great, however the code we sometimes tend to come across on StackOverflow and other sites lacks best practices, hence I thought it was time to start bringing them up and I will start today with design patterns.

I’m all for copy/paste coding and it one of the things I love about the Google Apps Script developer community, there are lots of great snippets out there and in Pulse we’ve now over 800 posts and counting. When you start going beyond quick script solutions into more complex projects investing time planning how you’ll structure your code can save you headaches and frustrations further down the line.

Using design patterns are one way to produce better code that is more readable which in turn is more maintainable and can lead to faster development. This post from Dmitry Kostyuk a nice opportunity to learn about a design pattern for a very common use case of maintaining data in a Google Sheet from a third party API.

Source: Using Design Patterns in Google Apps Script