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
| Language | Keyword |
|---|---|
| English | imports |
| Spanish | importa |
| French | importe |
| German | importiert |
| Japanese | 取込 |
| Chinese | 引入 |
| Korean | 가져오기 |
See also
- uses - Canonical dependency declaration (replaces imports)