Title
1
Static code analysis with Airtable Regex formulas
2
Constructing asynchronous functions
3
Niche Airtable scripting insights
4
Free Learning Resources
5
Resolving promises
6
Supporting Mable development
7
How to use scientific notation in Airtable formulas
8
Mable March 2022 Update
9
Monaco Shortcuts
10
Importing modules from files, attachments, and then some
11
The many benefits of modularity
12
Do ES6 modules work with Airtable?
13
Putting Mable in its humble context
14
Licensing
15
When to use var?
16
Common errors (and those you have to work for)
17
Mable JSDoc Hub
18
Scripts vs modules
19
Module configurations are here!
20
Mable Module Methods
21
Importing modules with the Function constructor
22
IIFEs, aka the 'baseline' modules
23
JSON-based Airtable modules
24
Mable February 2022 Update
25
Making Modularity
26
Binding, calling, and applying (for) modules
27
eval() imports & woes
28
JSON.parse syntax errors
29
JSON Grammar Cheatsheet
Drag to adjust the number of frozen columns
Body
Files
articleStats
Meta

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:

  • accept user input
  • tokenize it
  • lex the tokens
Module method: asynchronous function construction
  • optimal for importing asynchronous modules
  • syntax and other features are otherwise identical to the Function constructor


The syntax isn't exactly elegant:

const Async_Function = Object.getPrototypeOf(async function(){}).constructor;
avgSentence length
avgParagraph length
avgWord length
avgSentence length: 7.06 avgParagraph length: 0.78 avgWord length: 5.3
global.Window in the Scripting App

The following 13 props and/or global.Window methods are available in the Scripting App via the globalThis object:

  • navigator
  • self
  • EventTarget
  • AbortController
file names
file names: []
Free Resources


General JavaScript

  • The Modern JavaScript Tutorial


Visual Studio Code

id
avgSentence length
file names
paragraphs
id: recT95Z7tHNQKYb3Z avgSentence length: 30.75 file names: [883764e5, image.png, memoization_theory_harvard_paper.pdf] paragraphs: 25

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) => 
{
paragraphs
words
sentences
paragraphs: 15 words: 164 sentences: 14
How to best support this project?

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.

bytes
lines
bytes: 1588 lines: 12

AKA another reason to avoid VALUE.


VALUE('52e3') => 523

Nope.


0 + '52e3' => 52000
file count
file count: 0

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:


🆕 59 modules

3.6k+ open-sourced lines of code - so far.

file count
file count: 1
Monaco Shortcuts


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:


Parameter hints
  • PC: CTRL + Shift + Space
file count
file count: 1
Can I import Airtable modules from actual attachments/files?

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.

file count
file names
file links
file count: 2 file names: [this_aint_it_chief.png, you_want_this.png] file links: [https://dl.airtable.com/.attachments/e779d8a48a5b2c4722c9650bbacf876e/57fb128f/image.png, https://dl.airtable.com/.attachments/7e51928c477921e8bd64b7191a3e3f16/738aac77/image.png]
Why modules are the best Airtable upgrade you'll ever make

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:


Faster testing with better results
What about on Airtable?
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:

chars
chars: 2492
Modularity across the JavaScript ecosystem

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.

lines
lines: 22
Licensing

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:


  • The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
words
words: 193
const vs let vs var

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+++) { }
Troubleshooting time!

I'll be dumping all of the most obscure errors I encounter in Airtable here.


ERROR
TypeError: Cannot set property Properties of #<Object> which has only a getter
    at Object.get Properties [as Properties] on line 23
JSDoc Resources

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.

What 'scripts' and 'modules' mean to your browser

🚧 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.


Supported Settings
  • one-liner

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.


Don't miss the forest for the frees

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?

Immediately invoked function expressions

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.

chars
sentences
chars: 4671 sentences: 53
Developing Airtable modules from JSON objects


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.


Mable February 2022 Update

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.


More of everything!
Making Modularity


eval()

recpm5aGlPbBiMTSm


Function constructor
function.prototype.bind || call || apply


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.


Bringing modules into scope using function.prototype.call():
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.


Key things to keep in mind about eval():
  • it's the most straightforward option for prototyping and asynchronous unit testing
  • it's what many of today's JS module systems are still using under the hood
  • it's also the most dangerous and least performant, on account of its dynamic scoping which can expose sensitive data and cannot be auto-optimized during first phase of code execution
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
29 records
Extensions

Alert

Lorem ipsum
Okay