Skip to content

Instantly share code, notes, and snippets.

@christianalfoni
Created May 3, 2026 09:12
Show Gist options
  • Select an option

  • Save christianalfoni/20bb20510dc2fae3ff3bc2590b64629b to your computer and use it in GitHub Desktop.

Select an option

Save christianalfoni/20bb20510dc2fae3ff3bc2590b64629b to your computer and use it in GitHub Desktop.

Agent Contribution Report

Type component children without leaving the Rask namespace

Before

// No Rask-namespaced node type existed.
// Developers had to import from inferno directly or use `any`:
import { InfernoNode } from "inferno";

interface Props {
  children: InfernoNode; // breaks out of the Rask namespace
  // — or —
  children: any;         // loses type safety
}

After

// Two equivalent aliases are now available under the Rask namespace:
interface Props {
  children: Rask.Children;  // idiomatic — mirrors React.ReactNode
  // — or —
  node: Rask.RaskNode;      // convenience alias for the same type
}

// Both cover the full union:
// Inferno.InfernoElement | string | number | boolean | null | undefined | array/fragment

No additional imports are needed — Rask is a global namespace already declared in the project.

Assumptions

  • Rask.Children should mirror what React.ReactNode provides: the broadest useful node union
  • Rask.RaskNode is a pure convenience alias; both types are identical (InfernoNode)
  • InfernoNode was already imported in types.ts, so no new dependency was introduced

Decisions

  • Named the primary alias Rask.Children (not Rask.Node) to stay parallel with the React.ReactNode / React.Children naming convention consumers are familiar with
  • Added Rask.RaskNode as a second alias rather than consolidating, keeping both options available

Testing

  • Not tested — no test runs observed in the session

Install Rust and WebAssembly target for SWC plugin builds

Before

flowchart LR
  A[npm run build core] --> B{cargo available?}
  B -- No --> C[sh: cargo: command not found ❌]
  B -- Yes --> D{wasm32-wasip1 target?}
  D -- No --> E[E0463: can't find crate for std ❌]
Loading

After

flowchart LR
  A[npm run build core] --> B{cargo available?}
  B -- Yes --> D{wasm32-wasip1 target?}
  D -- Yes --> F[SWC plugin compiles ✅]
Loading

The core package includes an SWC plugin that compiles to WebAssembly. Both Rust and the explicit wasm32-wasip1 target are now present on the machine.

Assumptions

  • The host is Apple Silicon macOS (aarch64-apple-darwin) — that native target was installed automatically; only the WASI target needed to be added manually
  • New terminal sessions will pick up ~/.cargo/env automatically; existing shells need source "$HOME/.cargo/env" once

Decisions

  • Used the official rustup installer (curl … | sh -s -- -y) for a non-interactive, non-root install
  • Added wasm32-wasip1 (the WASI Preview 1 target) rather than the older wasm32-wasi, matching what the error message specified

Testing

  • cargo --version confirmed cargo 1.94.1 after install
  • rustup target add wasm32-wasip1 completed successfully; build outcome not re-verified in the transcript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment