跳到正文
cccskills
免费在 GitHub 公开

solidjs-expert

Expert guide for SolidJS 2 and SolidStart — fine-grained reactivity, signals, createResource, and server-first rendering / Panduan ahli SolidJS 2 dan SolidStart — reaktivitas fine-grained, signals, createResource, dan rendering server-first.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md7.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

SolidJS & SolidStart Expert (2026 Edition)

English | Bahasa Indonesia


<a name="english"></a>

English

Description

Expert guide for SolidJS 2 and SolidStart, the reactive framework with zero Virtual DOM overhead. Covers fine-grained reactivity primitives (createSignal, createMemo, createEffect), reactive state trees (createStore), avoiding reactivity destruction (proper usage of mergeProps and splitProps), SolidStart server functions ("use server"), streaming SSR, and micro-benchmarked UI rendering patterns.

Trigger Conditions

  • Developing high-performance, real-time web applications where Virtual DOM diffing is a bottleneck.
  • Choosing SolidJS or SolidStart for low-latency dashboards, streaming financial terminals, or edge-rendered apps.
  • Migrating from React to SolidJS while maintaining clean reactive state boundaries.
  • Building reactive components with Tailwind CSS v4.

Core Architectural Rules: SolidJS vs React

  1. Components Run Exactly Once: A SolidJS component function is a setup function, not a render function. Do NOT write side-effects directly in the function body; place them in createEffect or onMount.
  2. Never Destructure Props: Destructuring const { name } = props strips reactive getters. Always use props.name, mergeProps(defaultProps, props), or splitProps(props, ['keys']).
  3. Control Flow Primitives: Always use <Show>, <For>, <Index>, and <Switch> instead of JavaScript ternary operators or array.map() to maximize DOM node reuse.

Production SolidStart Server Action & Store Pattern

// src/components/CartManager.tsx
import { createSignal, createResource, For, Show } from 'solid-js';
import { createStore, produce } from 'solid-js/store';
import { action, json } from '@solidjs/router';

interface CartItem {
  id: string;
  title: string;
  quantity: number;
  priceCents: number;
}

// Server Action executing strictly on the server
export const updateCartServerAction = action(async (formData: FormData) => {
  'use server';
  const itemId = formData.get('itemId') as string;
  const quantity = parseInt(formData.get('quantity') as string, 10);
  // Atomic database update via ORM...
  return json({ success: true, itemId, quantity });
});

export function CartManager() {
  const [store, setStore] = createStore<{ items: CartItem[]; promoCode: string }>({
    items: [
      { id: '1', title: 'Developer Pro License', quantity: 1, priceCents: 9900 }
    ],
    promoCode: ''
  });

  const totalCents = () => store.items.reduce((acc, i) => acc + i.priceCents * i.quantity, 0);

  const incrementItem = (id: string) => {
    setStore(
      'items',
      (item) => item.id === id,
      produce((item) => {
        item.quantity += 1;
      })
    );
  };

  return (
    <div class="rounded-xl border border-slate-200 bg-white p-6 shadow-sm">
      <h2 class="text-xl font-bold text-slate-900">Shopping Cart</h2>
      <div class="mt-4 divide-y divide-slate-100">
        <For each={store.items}>
          {(item) => (
            <div class="flex items-center justify-between py-3">
              <span class="font-medium text-slate-800">{item.title}</span>
              <div class="flex items-center gap-3">
                <span class="text-sm text-slate-500">Qty: {item.quantity}</span>
                <button
                  onClick={() => incrementItem(item.id)}
                  class="rounded bg-slate-100 px-2 py-1 text-xs font-semibold hover:bg-slate-200 transition"
                >
                  +
                </button>
              </div>
            </div>
          )}
        </For>
      </div>
      <div class="mt-4 border-t border-slate-100 pt-4 flex justify-between font-bold text-slate-900">
        <span>Total:</span>
        <span class="tabular-nums">${(totalCents() / 100).toFixed(2)}</span>
      </div>
    </div>
  );
}

Orchestration & Integration

  • performance-web-vitals: Leverages Solid's direct DOM manipulation for near-zero INP and top-tier Lighthouse scores.
  • tailwind-expert: Styles Solid components with Tailwind CSS v4 @theme design tokens.
  • state-management-expert: Explains fine-grained signal patterns compared to React hooks and Zustand.
  • typescript-expert: Provides type-safe store and props interfaces.

<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Deskripsi

Panduan ahli untuk SolidJS 2 dan SolidStart, framework reaktif tanpa overhead Virtual DOM. Mencakup primitif reaktivitas fine-grained (createSignal, createMemo, createEffect), pohon state reaktif (createStore), pencegahan hilangnya reaktivitas (penggunaan mergeProps dan splitProps), fungsi server SolidStart ("use server"), streaming SSR, dan pola rendering antarmuka berkecepatan tinggi.

Kondisi Pemicu

  • Membangun aplikasi web dengan tuntutan performa ekstrem di mana proses rekonsiliasi Virtual DOM menjadi beban (bottleneck).
  • Memilih SolidJS atau SolidStart untuk dashboard analitik real-time atau terminal data streaming.
  • Migrasi kode dari React ke SolidJS dengan pemisahan batas reaktivitas yang benar.
  • Mengembangkan komponen dengan sistem desain Tailwind CSS v4.

3 Hukum Utama Reaktivitas SolidJS

  1. Fungsi Komponen Hanya Dijalankan Sekali: Berbeda dari React yang mengeksekusi ulang seluruh fungsi komponen saat state berubah, SolidJS hanya menjalankan fungsi komponen satu kali saat inisialisasi. Jangan taruh side-effect langsung di badan fungsi; gunakan createEffect atau onMount.
  2. Jangan Pernah Melakukan Destrukturisasi Props: Menulis const { nama } = props akan memutus getter reaktif. Selalu gunakan props.nama, mergeProps(defaultProps, props), atau splitProps.
  3. Gunakan Komponen Kontrol Bawaan: Gunakan <Show> dan <For> alih-alih && atau .map() agar DOM node dapat digunakan kembali secara optimal tanpa rekonsiliasi ulang.

Contoh Pelestarian Reaktivitas Props

// src/components/UserCard.tsx
import { mergeProps, splitProps } from 'solid-js';

interface CardProps {
  name: string;
  role?: string;
  class?: string;
}

export function UserCard(rawProps: CardProps) {
  // Gabungkan nilai default tanpa merusak reaktivitas
  const props = mergeProps({ role: 'Member' }, rawProps);
  
  // Pisahkan styling class dari data bisnis
  const [local, others] = splitProps(props, ['class']);

  return (
    <div class={`rounded-lg border p-4 ${local.class || ''}`} {...others}>
      <h3 class="font-bold">{props.name}</h3>
      <p class="text-sm text-slate-500">{props.role}</p>
    </div>
  );
}

Integrasi Orkestrasi

  • performance-web-vitals: Memaksimalkan manipulasi DOM langsung untuk mencapai responsivitas instan (<10ms).
  • tailwind-expert: Menata gaya komponen Solid dengan utilitas Tailwind CSS v4.
  • state-management-expert: Menjelaskan perbandingan arsitektur signal vs selector Zustand.
  • typescript-expert: Menjaga keamanan tipe pada Store dan Server Actions.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug772026年10月18日 更新

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug772026年10月18日 更新

Expert guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan ahli komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug772026年10月18日 更新

Expert guide for AI-assisted coding workflows — agentic code generation, multi-agent code swarms, self-healing CI/CD, automated PR review, spec-to-code pipelines, codebase knowledge graphs, and human-in-the-loop approval gates / Panduan ahli untuk workflow pengkodean berbasis AI — generasi kode agentic, code swarm multi-agen, CI/CD self-healing, review PR otomatis, pipeline spec-to-code, knowledge graph codebase, dan gate persetujuan human-in-the-loop.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug772026年10月18日 更新

Expert guide for autonomous Machine-to-Machine (M2M) agent settlement, dual-rail fiat & stablecoin micro-clearing, dynamic budget envelopes, and cryptographic agent invoicing / Panduan ahli settlement otonom antar-agen (M2M), kliring mikro dual-rail fiat & stablecoin, pagu anggaran dinamis, dan penagihan agen kriptografis.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug772026年10月18日 更新

Expert guide for long-term episodic memory integration (Mem0 v2, Letta/MemGPT, Zep v2), memory tier architecture, pgvector HNSW storage, and unified context management for autonomous AI agents / Panduan ahli untuk integrasi memori episodik jangka panjang (Mem0 v2, Letta/MemGPT, Zep v2), arsitektur tier memori, penyimpanan pgvector HNSW, dan manajemen konteks terpadu untuk agen AI otonom.

中文简介正在准备中。当前显示原文说明。

roedyrustam/vibes-plug772026年10月18日 更新

查看 roedyrustam 的全部技能

报告此技能的问题