Upgrade to Pro — share decks privately, control downloads, hide ads and more …

フロントエンドUIフレームワークのこれまでとこれから

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

 フロントエンドUIフレームワークのこれまでとこれから

Avatar for TOMIKAWA Sotaro

TOMIKAWA Sotaro

September 11, 2026

More Decks by TOMIKAWA Sotaro

Other Decks in Programming

Transcript

  1. // 命令的UI let count = 0; const result = document.getElementById('result');

    const doubleResult = document.getElementById('double-result'); const button = document.getElementById('increment'); button.addEventListener('click', () => { count++; result.textContent = count; doubleResult.textContent = count * 2; });
  2. <div> <p data-bind="text: count"></p> <button data-bind="click: increment">+1</button> </div> <script> const

    count = ko.observable(0); function increment() { count(count() + 1); } ko.applyBindings({ count, increment }); </script>
  3. class Counter extends React.Component { constructor(props) { super(props); this.state =

    { count: 0 }; } increment() { this.setState(state => ({ count: state.count + 1 })); } render() { return <div> <p>{this.state.count}</p> <button onClick={this.increment.bind(this)}>+1</button> </div>; } }
  4. <template> <div> <p>{{ count }}</p> <button @click="increment">+1</button> </div> </template> <script>

    export default { data() { return { count: 0 }; }, methods: { increment() { this.count++; } } }; </script>
  5. function useCounter() { const [count, setCount] = useState(0); const increment

    = () => setCount(c => c + 1); return { count, increment }; } function Counter() { const { count, increment } = useCounter(); return <div> <p>{count}</p> <button onClick={increment}>+1</button> </div>; }
  6. <template> <div> <p>{{ count }}</p> <button @click="increment">+1</button> </div> </template> <script>

    <script> export default { export default { data() { setup() { return { count: 0 }; const count = ref(0); }, const increment = () => { methods: { count.value++; increment() { }; this.count++; return { count, increment }; } } } }; }; </script> </script>
  7. export function Counter() { const [count, setCount] = createSignal(0); const

    increment = () => setCount(c => c + 1); return <div> <p>{count()}</p> <button onClick={increment}>+1</button> </div>; }
  8. <script> let count = $state(0); function increment() { count =

    count + 1; } </script> <div> <p>{count}</p> <button onclick={increment}>+1</button> </div>
  9. export function Counter() { const [count, setCount] = createSignal(0); const

    increment = () => setCount(c => c + 1); const reset = () => setCount(0); return <Show when={count() > 0} fallback={<button onClick={increment}>Start</button>} > <p>{count()}</p> <button onClick={increment}>+1</button> <button onClick={reset}>Reset</button> </Show>; }
  10. function Counter() { const count = ref(0); const increment =

    () => { count.value += 1; }; const reset = () => { count.value = 0; }; } return ( <> <template v-if={count.value > 0}> <p>{count.value}</p> <button v-on={{click: increment}}>+1</button> <button v-on={{click: reset}}>Reset</button> </template> <button v-else v-on={{click: increment}}>Start</button> </> );
  11. <script> let count = $state(0); const increment = () =>

    { count += 1; }; const reset = () => { count = 0; }; </script> {#if count > 0} <p>{count}</p> <button onclick={increment}>+1</button> <button onclick={reset}>Reset</button> {:else} <button onclick={increment}>Start</button> {/if}
  12. export function Counter() @{ const [count, setCount] = createSignal(0); const

    increment = () => setCount(c => c + 1); const reset = () => setCount(0); @if (count() > 0) { <> <p>{count()}</p> <button onClick={increment}>+1</button> <button onClick={reset}>Reset</button> </> } @else { <button onClick={increment}>Start</button> } }
  13. function Profile(props) { const user = createMemo(() => fetchUser(props.id)); }

    return ( <Loading fallback={<Skeleton />}> <h1 class={{ stale: isPending(user) }}> {user().name} </h1> </Loading> );
  14. データフェッチを扱うために • UIフレームワークからのアプローチ ◦ ◦ React - React Server Components

    / Server Functions Solid 2.0 - Server Functions ◦ ◦ ◦ TanStack Start - Server Functions Nuxt - Server Components SvelteKit - Remote Functions ◦ GraphQL Fragment Colocation • メタフレームワークからのアプローチ • フレームワーク外からのアプローチ