Skip to content

Releases: awilderink/atollic

v0.1.0

12 Apr 22:12
d5d1f4c

Choose a tag to compare

Minor Changes

  • #13 a7e43fe Thanks @awilderink! - ## Universal components

    Plain .tsx files without a "use client" directive or @jsxImportSource pragma are now universal components. They automatically compile to the correct JSX runtime based on who imports them:

    • Imported from a server route: compiles with Atollic HTML JSX (string output)
    • Imported from a React island: compiles with React JSX (className, style objects)
    • Imported from a Solid island: compiles with Solid JSX (no transform needed)

    Write class, onClick, and string style once. It works everywhere.

    New exports

    • UniversalFC<P> - typed function component signature for universal components
    • UniversalChildren - opaque children type alias
    import type { UniversalFC } from "atollic";
    
    const Button: UniversalFC<{ variant?: "primary" | "ghost" }> = (props) => (
      <button class={props.variant}>{props.children}</button>
    );
    export default Button;

    How it works

    The Vite plugin detects when a universal component is imported from a "use client" island and resolves it with a ?framework=X query. The load hook injects the correct @jsxImportSource pragma and applies attribute mapping (e.g. class to className for React, style strings to style objects). Function-valued props like onClick are silently dropped when rendering as server HTML.

    Other changes

    • FrameworkAdapter interface gains an optional transformUniversal(code) method for framework-specific attribute mapping
    • Server HTML JSX runtime now skips function-valued props instead of rendering them as strings
    • Event handler types (on*) in Atollic's JSX namespace accept functions alongside strings

v0.0.6

08 Apr 20:26
739d860

Choose a tag to compare

Patch Changes

  • #11 e49d311 Thanks @awilderink! - Fix async children and React children hydration inside islands. Server-rendered children passed into an island now resolve correctly when they are async (promises/JSX returning a promise) and survive hydration on React islands without being reconciled away.

  • #11 e49d311 Thanks @awilderink! - Preserve hydrated island state across server HMR. Editing a server file no longer resets the state of mounted islands: the morph now skips island subtrees (via beforeNodeMorphed) and island ids stay stable across the HMR refetch thanks to a per-request id counter backed by AsyncLocalStorage.

v0.0.5

07 Apr 14:49
e2653d5

Choose a tag to compare

Patch Changes

  • 97cd69a Thanks @awilderink! - Add Atollic logo and capitalize brand name in README. Logo is now displayed at the top of the README and on the npm package page via an absolute raw.githubusercontent URL.

v0.0.4

07 Apr 12:28
4b447fe

Choose a tag to compare

Patch Changes

  • #4 784f12a Thanks @awilderink! - Fix dev:elysia and dev:hono scripts to run from inside the example
    directory. Vite's --config flag defaults root to the current working
    directory, which broke entry resolution when running from the repo root.