Version: 1.0.0 Comprehensive guides for migrating to Eleva from other frameworks
Welcome to the Eleva migration guides. These guides help you transition from popular frameworks to Eleva while leveraging your existing knowledge.
Eleva is designed to be approachable for developers coming from any background. Its concepts map naturally to patterns you already know:
| Your Background | Eleva Equivalent |
|---|---|
React useState |
signal() |
React useEffect |
signal.watch() |
Vue ref/reactive |
signal() |
| Vue SFC | Component objects |
Alpine x-data |
setup() + signal() |
Alpine x-model |
value + @input |
Alpine x-for |
.map().join('') |
| jQuery DOM manipulation | Template strings |
| jQuery events | @event syntax |
If you’re coming from React, you’ll find Eleva’s signal-based reactivity familiar but simpler. No hooks rules, no virtual DOM reconciliation to worry about.
Key transitions:
useState → signal()useEffect → signal.watch()Vue developers will feel at home with Eleva’s component model and reactivity system. The main difference is Eleva’s lighter footprint and simpler API.
Key transitions:
ref()/reactive() → signal()v-if/v-for → JavaScript expressionsBoth Alpine and Eleva share a similar philosophy—lightweight, no build step, progressive enhancement. The key difference is approach: Alpine is HTML-first with directives, Eleva is JS-first with template functions.
Key transitions:
x-data → setup() + signal()x-show/x-if → Ternary expressionsx-for → .map().join('')x-model → value + @input$watch → signal.watch()Alpine.store → Eleva Store pluginMoving from jQuery to Eleva gives you modern component architecture while keeping the simplicity you love. No build step required.
Key transitions:
$('#id') → Component templates.on('click') → @click syntaxYou don’t have to migrate everything at once. Eleva can coexist with your existing code:
<!-- Your existing app -->
<div id="legacy-app">...</div>
<!-- New Eleva component -->
<div id="eleva-widget"></div>
<script type="module">
import Eleva from "eleva";
const app = new Eleva("Widget");
app.component("NewFeature", { /* ... */ });
app.mount(document.getElementById("eleva-widget"), "NewFeature");
</script>
Migrate one component at a time, starting with leaf components (those with no children):
Migrate entire features when they’re self-contained:
Before (various frameworks):
// React
const [count, setCount] = useState(0);
setCount(count + 1);
// Vue
const count = ref(0);
count.value++;
// Alpine
<div x-data="{ count: 0 }">
<button @click="count++">
</div>
// jQuery
let count = 0;
$('#count').text(++count);
After (Eleva):
const count = signal(0);
count.value++;
// Template automatically updates
Before:
// React
<button onClick={() => setCount(c => c + 1)}>
// Vue
<button @click="count++">
// Alpine
<button @click="count++">
// jQuery
$('button').on('click', () => count++);
After (Eleva):
template: (ctx) => `
<button @click="increment">Click me</button>
`
Before:
// React
{isVisible && <div>Content</div>}
// Vue
<div v-if="isVisible">Content</div>
// Alpine
<div x-if="isVisible">Content</div>
// jQuery
if (isVisible) $('#content').show();
After (Eleva):
template: (ctx) => `
${ctx.isVisible.value ? '<div>Content</div>' : ''}
`
Before:
// React
{items.map(item => <li key={item.id}>{item.name}</li>)}
// Vue
<li v-for="item in items" :key="item.id"></li>
// Alpine
<template x-for="item in items" :key="item.id">
<li x-text="item.name"></li>
</template>
// jQuery
items.forEach(item => $('ul').append(`<li>${item.name}</li>`));
After (Eleva):
template: (ctx) => `
<ul>
${ctx.items.value.map(item => `
<li key="${item.id}">${item.name}</li>
`).join('')}
</ul>
`
| ← Back to Main Docs | From React → |