Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Namespacing of functions / aliasing imports #433

Open

Description

@rkalis

Right now, imports are full-file flat imports (import "./lib.cash"). That works fine on a small scale, but when people are publishing libraries to npm, it becomes harder to manage potential name collisions. That is why we want to allow aliasing/namespacing of imports, and also potentially only importing specific functions/globals from a file. See below:

// Alias imports + import specific functions
import { func1, func2 as funcX } from "./lib.cash";

// Alias the entire import (accessed as Lib.func1(...)
import * as Lib from "./lib.cash"
// Alternative syntax
import "./lib.cash" as Lib;

(created from #369)

Activity

  1. added
    cashc-compiler
    on Aug 6, 2026
  2. added this to the v0.15.0 milestone on Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cashc-compiler

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions