Skip to content

imports

imports

Legacy section. imports is the original dependency declaration syntax. It is still accepted by the parser for backward compatibility, but the canonical replacement is uses. Run mashin fmt to auto-migrate imports blocks to uses statements.

When to use

Do not use imports in new code. Use uses instead.

The parser accepts imports with nested import statements and will continue to do so during the migration period. If you encounter imports in existing .mashin files, either rewrite it manually or run mashin fmt to convert automatically.

Syntax (legacy)

imports
import "@mashin/actions/http" { get, post }
import "@mashin/actions/db" { query }

Canonical replacement

uses "@mashin/actions/http/get"
uses "@mashin/actions/http/post"
uses "@mashin/actions/db/query"

The uses form is flatter (no nesting, no redundant import verb) and reads more naturally as English.

Migration

The mashin fmt formatter automatically converts:

// Before (legacy)
imports
import "@mashin/actions/http" { get, post }
// After (canonical)
uses "@mashin/actions/http/get"
uses "@mashin/actions/http/post"

Translations

LanguageKeyword
Englishimports
Spanishimporta
Frenchimporte
Germanimportiert
Japanese取込
Chinese引入
Korean가져오기

See also

  • uses - Canonical dependency declaration (replaces imports)