Scripting Block Editor: Set() & Spread Operator

I’m wondering if this is intentional behavior…

In the Scripting Block’s editor, when I try to use the spread operator [...] to spread a Set() into an array, I get syntax highlighting for an error:

Using Array.from() on the same Set() works just fine (no syntax highlighting). But, curiously, the Scripting Block also runs the script just fine with the Spread operator version of that line of code, even though it’s highlighted as an error.

The same code does not produce any error highlighting in a JavaScript environment in VS Code:

Not a real issue, and probably an edge case, but I figured I’d report it anyhow, just in case 1) it’s an unintended bug, or 2) I’m unaware that shouldn’t be using the Spread operator on Sets.

Side-note… The built-in editor in the Scripting Block is a surprisingly excellent experience! I’m curious if you guys rolled your own, or if you utilized some open-source editor library?

1 Like

Agree 100%. One of the gems of this new feature.

1 Like

Thanks for the report – this is not intentional. Using the spread operator should be fine. We will remove the warning.

1 Like

The scripting block uses Monaco, which is actually the editor that powers VS Code!

5 Likes

Thank you for letting us know more about the scripting block editor. I am accustomed to a different editor and my transition to this editor has been rough.

By the way, I am having some trouble with the editor. For me, the keyboard shortcuts for select all code and Undo last action do no work as documented on the support website in the screenshot below. (Ctrl+V also has two documented actions, but for me it only does the first.)

Which editor?

I also had some issues initially with VS Code, but overall, the transition has produced far greater benefits.

I currently use Atom.

Thanks for flagging this! These appear to be errors in our support documentation — we’ll get those fixed ASAP.

On Windows:

  • Ctrl + A - Select all code
  • Ctrl + Y - Redo last action

On Mac:

  • Cmd + A - Select all code
  • Shift + Cmd + Z - Redo last action

For me, on Windows, these do not work.
Ctrl+A has a different behavior. Ctrl+Y does nothing.
Ctrl+Z also does nothing.

I could go on, but I assume that Airtable has Q/A people testing stuff like this and will get them fixed soon (along with several other quirky things I see in scripting block).

There also appears to be a lot of undocumented keyboard shortcuts. Some of them are really useful. However, I understand if you want to leave some keyboard shortcuts undocumented for now.

Is the editor focused? I am able to successfully use these shortcuts on Windows.

Yes, we intentionally don’t document all the keyboard shortcuts to keep the support article light. You can use the F1 key to pull up the command palette, which can assist in discovering new commands and keyboard shortcuts.

Yes, the editor has the focus.
For me, Ctrl+A moves the cursor to the beginning of the line.
For me, Ctrl+Z has unpredictable results. Sometimes it does nothing. Sometimes it does crazy-I-have-no-idea-why-it-does-that things.
For me, Ctrl+Y does not redo the last edit. I have not not tried it nearly as often as I have tried the other two.

I’ve use F1 and I find it helpful. That is how I found some of the undocumented keyboard shortcuts. However, for me it lists keyboard shortcuts in Mac format, not in Windows format. I have tried several times to get the various Fold shortcuts to work, but I eventually gave up because I wasn’t even sure if they would work at all.

I agree with this decision, which I indicated in my previous post. However, eventually, I hope that they will get documented in a reference section. Or at least a link to Monaco’s keyboard shortcuts, provided that they are all actually supported.

Errors in documentation are very frustrating. I would rather have undocumented features than documented features that don’t work. For example, your documentation states that output.table() mirrors the console.table() functionality and provides a convenient link. Except that output.table() doesn’t actually provide all the functionality listed in that link.

In contrast, you do not document the rate limit for scripting block, unlike how you document the rate limit for the Standard API. I really wished you’d published that there was a rate limit, but I’m okay if you want to keep the actual rate limit secret for now. I ran up against what I suspected was a rate limit, made some guesses about the rate limit, and I got my code to work. No muss, no fuss.

1 Like

:+1:

At least some of the errors are already corrected!

But there are still errors. Maybe you are still in the process of making the corrections, but I thought I’d post in case some of them still slipped by.

image

(By the way, I mean there are still documentation errors because the documentation does not match what you described as the expected behavior in this thread. For me there are still non-documentation errors because my editor does not behave as you described in this thread.)

!!!

This is great. Thank you. Or thank you to Monaco, if that’s the origin.

@kuovonne It looks like the Monaco editor might be incorrectly identifying your computer as a Mac. Can you share your OS and browser version numbers?

@Stephen_Suen My keyboard shortcuts in the scripting block editor work now! Thanks a bunch.

1 Like