Skip to main content

Writing Code Overview

Superblocks supports writing code to query and transform your data on the backend, as well as conditionally format data and components displayed on the frontend.

Backend

For backend Application APIs, Workflows, and Scheduled Jobs, you can incorporate custom business logic with programming languages like Python and JavaScript (Node.js).

Frontend

For frontend Application UIs, write browser based JavaScript functions to change the state of components based on any condition.

Code formatting

As you write code in Superblocks, you may notice your code is is automatically formatted. Formatting is enabled by default to help you write clean and consistent code across your Superblocks apps.

You can format code as you wish in any supported editor using the keyboard shortcut ⌘S (CTRL + S on Windows).

Available configuration

You can control the timing of when code is formatted using Developer Preferences. With these preferences, you can choose to format code:

  1. Automatically when you click outside the editor (default)
  2. Automatically when you run an API (all steps will be formatted)
  3. Never automatically, relying only on the keyboard shortcut ⌘S to format code

Superblocks does not currently support modifying specific formatting options (i.e. spaces vs tabs for indents) or opting in/out of formatting for a specific language.

Supported languages and dialects

Superblocks currently supports formatting in the following languages and locations:

  • JavaScript (backend JS steps, frontend Run JS actions, JS bindings within SQL queries)
  • Python (using PEP 8 formatting standard)
  • SQL (PostgreSQL, MySQL, Micosoft SQL Server, MariaDB, Amazon Redshift, Google BigQuery, OracleDB)

Superblocks does not currently support formatting:

  • JavaScript inputs (i.e. properties panel, Control Flow inputs)
  • JSON
  • A small subset of platform-specific SQL dialects, including Snowflake, DynamoDB, Rockset