This is not a token module for the no-code crowd. Developing NLP solutions with Airtable formulas is a challenge, though one that comes with its own reward.
Our goal is to develop a general-purpose pseudo-language native to Airtable. To do so, we'll need to:
The syntax isn't exactly elegant:
const Async_Function = Object.getPrototypeOf(async function(){}).constructor;
The following 13 props and/or global.Window methods are available in the Scripting App via the globalThis
object:
General JavaScript
Visual Studio Code
A simple way to create a promise is to use the built-in Promise constructor:
// A promise that resolves 33% of the time. const twoInThree = new Promise( (resolve, reject) => {
After already grabbing either of the two Gumroad editions? You haven't even received all of the planned content yet, Mable will remain in active development until at least summer and there's zero chance I'll try double-dipping with such experimental content; this is still more of an information product than software.
But if you do share my enthusiasm, here's an idea: pick whatever prototype, module method, or concept from here appealed to you the most, and join me for a free consultation to see if we can figure out a way to build a cost-effective module system tailored to your specific needs.
Making a full-time switch to software is probably the best outcome I'm not-so-secretly hoping for since hearing the first reactions to this project. So, I'm eager to double down on spec work for Airtable customers, module-related or not.
AKA another reason to avoid VALUE.
VALUE('52e3') => 523
Nope.
0 + '52e3' => 52000
New this month: self-writing formulas, no-code module configuration, and then some!
Another warm welcome to Mable! Our first-ever quarterly publishing stats are as follows:
3.6k+ open-sourced lines of code - so far.
Microsoft's code editor ships with support for dozens of useful keyboard shortcuts that will work in any browser. Learning and adopting as many of them as possible can deliver a massive productivity boost. Here are some of my favorites:
CTRL + Shift + Space
You can - and you should!
Approximately half of all Mable resources published to date cover conventional module techniques and how those can be transitioned to Airtable with minimal technical debt.
Airtable’s very own remoteFetchAsync can do so reliably and easily; it also combines well with pretty much every module method we've discussed here so far.
Based on your requirements, though, you might want to jump straight into the ES6 import/export syntax and simulating resources using the File and/or Blob API, both of which are available in the Scripting block, as well as through scripted automations.
Unlock the true potential of your workspace - with your workspace.
Here are some of the many benefits of modularizing software development; applicable to everything from no- to all-code solutions:
import {solution} as noBigDeal;
The near-universal appeal of ES6 modules owes a great deal to its straightforward, no-nonsense syntax - and the easily applicable mental model such language evokes.
In short, yes. But there's a lot of ways to implement various ES module features into your Airtable scripts and apps. Settling on your technical requirements is the first step to identifying the optimal module method to use.
While we're on the subject of the JS module standard, let's just quickly go over every major benefit ES6 modules have going on for them, Airtable-wise:
Is reinventing the wheel pointless? Is anyone still rolling on stone slabs nowadays?
A quarter of a century later, ECMAScript is in a pretty terrific spot on most fronts, module galore very much included.
Without breaking into a history lesson here, let's just mention this definitely wasn't always the case; on the contrary, the sheer volume of work that went into enabling modularity throughout JavaScript happened because the platform offered few dedicated solutions of its own once upon a time.
Even if we're only accounting for globally successful solutions to modularity, the ecosystem and level of choice JavaScript offers when it comes to importing, exporting, developing, and maintaining modules is pretty bonkers.
Unless otherwise noted, the modules and unit tests distributed via this base-repository are open-sourced and made available via the standard MIT license.
Copyright © 2021 Attention Spa, vl. Dominik Bošnjak * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
var => nevar => har - har
Always use const, unless you plan on reassigning the declared reference. Like if it was a control iterator in a for... of loop:
for (let i = 0; i < 50; i+++) { }
I'll be dumping all of the most obscure errors I encounter in Airtable here.
TypeError: Cannot set property Properties of #<Object> which has only a getter at Object.get Properties [as Properties] on line 23
Boy, are we going to need a lot of these 🤖
The first step to modularizing your Airtable code base is to rethink the way you write about your code as much as the coding itself.
As both the Scripting App and Airtable Automation environments come with full-fledged support for the vanilla JSDoc standard, this choice has pretty much been made for us already.
🚧 This section is under construction.
It's not just semantics, but there's a lot of those, as well
A top-level JS file containing either import or export syntax is automatically considered a module by every modern browser.
Configure everything - including the way you configure anything.
The main Modules table now offers support for custom configurations via the newly introduced config
field.
This is a multipurpose addition to Mable that interfaces with a wide range of systems, from full-fledged modules and automations to interactive tutorials, formulas, Scripting app runtimes, and more.
Where to start? Here's an overview:
Regardless of your technical background, you should prioritize articles with the Module Method tag. This Mable label is reserved for content that introduces fundamental module techniques relevant to Airtable.
Qualifying tips, tutorials, templates, and app prototypes are the core building blocks powering every solution detailed throughout this base. As of mid-February 2022, Mable is hosting a dozen articles totaling some 10,000 words' worth of such insights, with more being added on a weekly basis.
The what now? I don't suppose you've written any functions using the Function keyword, with a capital "F", lately?
Functions are first-class citizens in JavaScript, meaning they're just objects of the "function" type. Meaning we're just making this up as we go along, anyway.
Still, declaring functions using the built-in Function object, i.e. its constructor, usually isn't recommended for a number of reasons.
const sayHi = new Function('return "Hello!"');
Does this look right to you?
Easier done than said! 😅
An immediately invoked function expression is how most JavaScript modules worked before the introduction of ES6 import/export syntax in 2015.
Like the name suggests, an IIFE is executed immediately, inside its own lexical scope.
JavaScript's JSON API is more than capable of powering a native Airtable module system.
The trick to seamless JSON modularity in Airtable is leveraging the built-in JSON object to take control of both exports and imports, in that order.
More scripts, new tutorials, low-code modules, and high-level concepts!
Welcome (back) to Mable, formerly Modulartable, an open-source initiative to extend the functionality of the Airtable Scripting app and automations through platform-native modularity.
recpm5aGlPbBiMTSm
The bind, call, and apply methods are generally used for establishing function scope. Which makes them a good fit for automating the management of copy-pasted scripts. And creating the necessary scope for our new Function invocations that cry foul because they can't even find the built-in base object without our help.
const f = Function('{ ... _ }', `return _.console.log({ ... _ })`);
For completeness' sake, let's do a practical overview of eval() imports and try not to get too upset at the static type-checking - the environment means well.
SyntaxError: JSON.parse: unterminated string literal SyntaxError: JSON.parse: bad control character in string literal SyntaxError: JSON.parse: bad character in string literal
JSON-text = object / array begin-array = ws %x5B ws ; [ left square bracket begin-object = ws %x7B ws ; { left curly bracket end-array = ws %x5D ws ; ] right square bracket end-object = ws %x7D ws ; } right curly bracket name-separator = ws %x3A ws ; : colon