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.
Manually copying Google Sheets macros from one spreadsheet to another can be time consuming and error-prone. This Google Workspace Add-on automatically copies a script project and attaches it to a user-specified spreadsheet. Though this solution focuses on Sheets macros, you can use it to copy and share any container-bound script.
Are you looking for a way to centralize your codebase but deploy it to container-bound scripts? Here is a tutorial for you from the Apps Script samples on the Google Developers site, highlighted by Steve Webster, which gives an alternative approach to deploying as an add-on or sharing a container-bound template.
In the tutorial, you’ll find code that uses the Apps Script API to perform functions like getting, creating, and updating container-bound scripts. As part of the solution you’ll see how you can get the source project content using the Apps Script API, then opening a target Google Sheet to either create or update the container script.
This solution is not limited to Google Sheets only. You can use the same process to update code in other Google Workspace editors like Docs, Forms, and Slides. Usually, I would recommend maintaining and distributing your code as an add-on, however, in certain scenarios, this alternative approach could work well.
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!
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 🐛
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.
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. 💃🕺
Hey there, friends! 👋 Our Emojibar — yes, that’s what we’re calling it now — is coming along nicely! In the previous post, we learned how to bundle the project with Vite and vite-plugin-singlefile, and it’s now time to add some real functionality!
To complete our Emojibar, we’ll use two NPM modules:
Unicode-Emoji-JSON: We need a complete list of emojis, and this simple module provides them in JSON format. Perfect!
ToastifyJS: When users click on an emoji, it’ll be copied into their buffer. Just so they have some feedback, we’ll show them a confirmation toast. This library is great for this purpose.
We’ll also add search and navigation functionality, meaning that we’ll have the entire backbone of the application ready by the end of this post.
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! 😎
As I mentioned in my previous post, we’re going to create a super cool sidebar in Google Sheets that’ll help us select emojis with ease. 😎 Google Docs already has this functionality natively: simply head over to the “Insert” menu, select “Emoji,” and voilà! You’ll see a neat dialogue window with all emojis organized by category, as well as a handy search function:
However, we want more, so, we’ll be building our own version. 😏 Unlike Docs, we’ll have a full sidebar to work with, and clicking on an emoji won’t automatically insert it. Instead, it’ll copy it into our buffer, so we can paste it wherever we need it. 🎉
That being said, let’s dive into using our most important tool: Vite. ⚡
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?
For read-heavy applications that don’t involve components external to Apps Script accessing the cache and don’t exceed the CacheService limits, use CacheService. For write-heavy applications or for when some external parts require access to the same cache, use Spreadsheet App.
An interesting report from Ignacio Lopezosa Serrano on the relative performance of CacheService and SpreadsheetApp for reading/writing data with Google Apps Script. Some surprising results and something I think to be kept in mind is how these tests compare to ‘real world’ conditions. As also pointed out in the post there are some service limitations of CacheService to keep in mind particularly around storage size limits.