Skip to main content

Runtime 2.3.2

BaseNative

Signals over semantic HTML. One set() settles derived computeds, then runs each affected effect once. The expression language is an allowlist. Install @basenative/runtime and @basenative/server from npmjs.org, with no token and no .npmrc.

Runtime

  • One set()

    Derived computeds settle, then each affected effect runs once.

  • BN_EFFECT_LOOP

    An effect that writes a signal it also read throws. Use .peek(), or write a different signal.

  • class and :class

    The two merge. A false binding adds nothing.

  • :value and :checked

    Those bindings write the DOM property.

  • Evaluator

    An allowlist. Gzip 9.9KB / 10KB budget.

Platform

  • @basenative/platform 2.1.0

    Apple 27 controls for iOS, iPadOS, and macOS, in light and dark.

  • npmjs.org

    npm install @basenative/runtime @basenative/server. No token.

  • /ai

    The model scorecard. Pass rates stay unpublished while the prompt corpus is empty.

  • @basenative/validate

    Flags className, htmlFor, onClick, {expr} text, useState, useEffect, and useMemo, and names the replacement.

  • bn from-jsx

    Rewrites a React or JSX draft into BaseNative.

  • Public packages

    47 on npmjs.org.

A counter

<button @click="increment()">
  Clicked {{ count() }} times
</button>

<script type="module">
  import { signal, computed, effect, hydrate } from '@basenative/runtime';

  const count = signal(0);
  const doubled = computed(() => count() * 2);

  effect(() => {
    document.title = String(doubled());
  });

  function increment() {
    count.set(count() + 1);
  }

  hydrate(document.body, { count, increment });
</script>