
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
MiVue is simple, slim JS UI framework inspired from Vue.js and Alpine.js A lightweight, reactive MiVue provides the core reactivity features of Vue with a simple and intuitive API of Alpine making is easier for beginners and non-ui devs to get the job done.
NOTE: Python pyvue is also in the making
{{ value }} for text interpolation
Simply include the script in your HTML:
<script src="mivue.js"></script>
<div id="app">
<p>{{ message }}</p>
<input m-model="message">
</div>
<script>
const app = new MiVue({
el: '#app',
data: {
message: 'Hello MiVue!'
}
});
</script>
Use double curly braces to display reactive data in your templates:
<p>Hello, {{ name }}!</p>
Creates two-way data binding on form elements:
<!-- Text input -->
<input type="text" m-model="message">
<!-- Checkbox -->
<input type="checkbox" m-model="isChecked">
<!-- Radio buttons -->
<input type="radio" m-model="selectedOption" value="option1">
<input type="radio" m-model="selectedOption" value="option2">
<!-- Select dropdown -->
<select m-model="selected">
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
</select>
<!-- Textarea -->
<textarea m-model="description"></textarea>
Conditionally render an element based on a boolean value:
<div m-if="showContent">
This content will only show when showContent is true.
</div>
Dynamically bind HTML attributes based on expressions:
<!-- Regular syntax -->
<input m-bind:placeholder="inputPlaceholder">
<button m-bind:disabled="isDisabled">Submit</button>
<!-- Shorthand syntax using ":" -->
<img :src="imageUrl" :alt="imageDescription">
<a :href="linkUrl">Visit Website</a>
<!-- Expressions are supported -->
<div :style="'color: ' + textColor">Colored Text</div>
<progress :value="progress" :max="100"></progress>
Bind event listeners with multiple syntax options:
<!-- Regular syntax -->
<button m-on:click="handleClick">Click Me</button>
<!-- Shorthand syntax -->
<button @click="handleClick">Click Me</button>
<!-- With parameters -->
<button @click="increment(5)">Add 5</button>
<!-- Using $event to access the original DOM event -->
<input @input="updateValue($event)">
<!-- Multiple event types -->
<div @mouseenter="handleMouseEnter" @mouseleave="handleMouseLeave">
Hover over me
</div>
Render lists of items:
<ul>
<li m-for="item in items">{{ item.name }}</li>
</ul>
You can also include an index:
<div m-for="(item, index) in items">
{{ index }}: {{ item.name }}
</div>
Inside m-for loops, you can access:
item.propertyExample with events and conditional styling:
<div m-for="todo in todos" :class="{'completed': todo.completed}">
<input type="checkbox" m-model="todo.completed">
<span>{{ todo.text }}</span>
<button @click="removeTodo(todo)">Delete</button>
</div>
const app = new MiVue({
// Element to mount to
el: '#app',
// Debug mode
debug: true,
// Data properties (reactive)
data: {
message: 'Hello MiVue!',
count: 0,
isVisible: true,
buttonColor: 'blue',
linkUrl: 'https://example.com'
},
// Methods
methods: {
increment(amount = 1) {
this.count += amount;
},
toggleVisibility() {
this.isVisible = !this.isVisible;
},
handleEvent(event) {
console.log('Event triggered:', event.type);
}
}
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MiVue Example</title>
<style>
.btn {
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
margin-right: 8px;
}
</style>
</head>
<body>
<div id="app">
<h1>{{ title }}</h1>
<input type="text" m-model="title" :placeholder="titlePlaceholder">
<p>Count: {{ count }}</p>
<button @click="increment" class="btn" :style="'background-color: ' + buttonColor">Increment</button>
<button @click="increment(5)" class="btn" :disabled="isMaxedOut">Add 5</button>
<button @click="decrement" class="btn">Decrement</button>
<div>
<label>
<input type="checkbox" m-model="showExtra"> Show extra content
</label>
<div m-if="showExtra">
<p>This is additional content that can be toggled.</p>
<input type="text" m-model="linkUrl">
<p><a :href="linkUrl" target="_blank">Visit link</a></p>
</div>
</div>
<div class="mouse-tracker"
@mousemove="trackMouse($event)"
:style="'border: 1px solid #ccc; height: 100px; display: flex; align-items: center; justify-content: center;'">
<span>Mouse position: X: {{ mouseX }}, Y: {{ mouseY }}</span>
</div>
</div>
<script src="mivue.js"></script>
<script>
const app = new MiVue({
el: '#app',
debug: true,
data: {
title: 'MiVue Demo',
titlePlaceholder: 'Enter a title',
count: 0,
buttonColor: '#42b883',
showExtra: true,
linkUrl: 'https://github.com',
mouseX: 0,
mouseY: 0,
isMaxedOut: false
},
methods: {
increment(amount = 1) {
this.count += amount;
this.isMaxedOut = this.count >= 10;
},
decrement() {
if (this.count > 0) {
this.count--;
this.isMaxedOut = false;
}
},
trackMouse(event) {
this.mouseX = event.offsetX;
this.mouseY = event.offsetY;
}
}
});
</script>
</body>
</html>
MiVue uses JavaScript's Object.defineProperty to make data properties reactive. When a property is accessed during rendering, it's registered as a dependency. When the property changes, all registered dependencies are notified to update.
The update process uses a publisher-subscriber pattern with Dep (dependency) and Watcher classes inspired by Vue's implementation.
MiVue's event handling supports:
@click="handleClick")@click="increment(5)")$event parameterThe attribute binding system allows:
Being a minimal implementation, MiVue lacks some Vue.js features:
MIT
MiVue includes a comprehensive test suite to ensure all framework features work correctly.
The test suite uses:
To run tests, make sure you have Node.js installed, then:
Install dependencies first:
npm install
Run the test suite:
npm test
For continuous testing during development:
npm run test:watch
The test suite verifies all core functionality:
If you encounter issues:
debug: true in your MiVue instanceFAQs
A lightweight, reactive JavaScript framework inspired by Vue.js and Alpine.js
The npm package mivue receives a total of 2 weekly downloads. As such, mivue popularity was classified as not popular.
We found that mivue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.