No description
Find a file
Ersin KOÇ d224188913
Merge pull request #12 from ersinkoc/claude/typescript-codebase-review-dts9I
Add comprehensive TypeScript codebase review document
2026-02-10 12:45:34 +02:00
cli feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
dist feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
docs feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
examples feat: implement core routing, layout management and i18n functionality 2025-07-16 18:00:16 +03:00
scripts feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
src fix: Resolve scoping bug in modal backdrop click handler cleanup 2025-12-14 15:52:20 +00:00
tests fix: Session 4 - Partial bug fixes (3/8 bugs resolved) 2025-11-16 03:47:52 +00:00
tools feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
types feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
.eslintrc.cjs feat: implement core routing, layout management and i18n functionality 2025-07-16 18:00:16 +03:00
.gitignore chore: Add test output files to .gitignore 2025-11-16 03:49:19 +00:00
.prettierrc.cjs feat: implement core routing, layout management and i18n functionality 2025-07-16 18:00:16 +03:00
babel.config.cjs fix useEffect initial run with empty deps 2025-08-28 10:32:51 +03:00
bug-analysis-2025-11-08.csv fix: Comprehensive bug fixes - 7 critical/high priority issues (Session 2) 2025-11-08 11:19:10 +00:00
bug-analysis-2025-11-08.json fix: Comprehensive bug fixes - 7 critical/high priority issues (Session 2) 2025-11-08 11:19:10 +00:00
bug-database-session-5.csv feat: Session 5 - Comprehensive bug analysis & critical fixes (93+ bugs identified, 5 fixed) 2025-11-17 12:19:02 +00:00
bug-database-session-5.json feat: Session 5 - Comprehensive bug analysis & critical fixes (93+ bugs identified, 5 fixed) 2025-11-17 12:19:02 +00:00
bug-report.csv docs: Add JSON and CSV output formats for bug tracking systems 2025-11-07 14:59:01 +00:00
bug-report.json docs: Add JSON and CSV output formats for bug tracking systems 2025-11-07 14:59:01 +00:00
BUG_REPORT.md fix: Comprehensive bug fixes - 11 critical/high priority issues resolved 2025-11-07 14:07:32 +00:00
COMPREHENSIVE_BUG_ANALYSIS_2025-11-08.md fix: Comprehensive bug fixes - 7 critical/high priority issues (Session 2) 2025-11-08 11:19:10 +00:00
COMPREHENSIVE_BUG_ANALYSIS_SESSION_6_2025-11-17.md fix: Session 6 - Critical bug fixes (6/212 bugs resolved, 212 documented) 2025-11-17 17:15:57 +00:00
COMPREHENSIVE_BUG_REPORT_SESSION_3.md fix: Comprehensive bug fixes - 9 critical/high priority issues (Session 3) 2025-11-09 00:24:33 +00:00
COMPREHENSIVE_BUG_REPORT_SESSION_5.md feat: Session 5 - Comprehensive bug analysis & critical fixes (93+ bugs identified, 5 fixed) 2025-11-17 12:19:02 +00:00
debug.js feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
DUAL-SYNTAX-SUMMARY.md feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
EXECUTIVE_SUMMARY_2025-11-08.md fix: Comprehensive bug fixes - 7 critical/high priority issues (Session 2) 2025-11-08 11:19:10 +00:00
EXECUTIVE_SUMMARY_SESSION_5_2025-11-17.md feat: Session 5 - Comprehensive bug analysis & critical fixes (93+ bugs identified, 5 fixed) 2025-11-17 12:19:02 +00:00
EXECUTIVE_SUMMARY_SESSION_6_2025-11-17.md docs: Add executive summary for Session 6 bug analysis 2025-11-17 17:17:17 +00:00
FINAL_REPORT.md docs: Add comprehensive final report with executive summary 2025-11-07 15:01:20 +00:00
FIXES_SUMMARY.md fix: Comprehensive bug fixes - 11 critical/high priority issues resolved 2025-11-07 14:07:32 +00:00
jest.config.cjs fix: Comprehensive bug fixes - 11 critical/high priority issues resolved 2025-11-07 14:07:32 +00:00
package-lock.json fix: Comprehensive bug fixes - 11 critical/high priority issues resolved 2025-11-07 14:07:32 +00:00
package.json feat: implement core routing, layout management and i18n functionality 2025-07-16 18:00:16 +03:00
PRODUCTION_READY_PLAN.md feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
README-dual-syntax.md feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
README.md docs: Improve and update README.md 2025-10-25 12:51:35 +00:00
rollup.config.js feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
session-3-bug-fixes.csv fix: Comprehensive bug fixes - 9 critical/high priority issues (Session 3) 2025-11-09 00:24:33 +00:00
session-3-bug-fixes.json fix: Comprehensive bug fixes - 9 critical/high priority issues (Session 3) 2025-11-09 00:24:33 +00:00
SESSION_3_FIXES_SUMMARY.md fix: Comprehensive bug fixes - 9 critical/high priority issues (Session 3) 2025-11-09 00:24:33 +00:00
SESSION_4_BUG_ANALYSIS.md fix: Session 4 - Partial bug fixes (3/8 bugs resolved) 2025-11-16 03:47:52 +00:00
SESSION_4_EXECUTIVE_SUMMARY.md fix: Session 4 - Partial bug fixes (3/8 bugs resolved) 2025-11-16 03:47:52 +00:00
test-component.js feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
test-output.txt fix: Comprehensive bug fixes - 9 critical/high priority issues (Session 3) 2025-11-09 00:24:33 +00:00
test-performance.js feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
test-signal.js feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00
tsconfig.json feat: implement core routing, layout management and i18n functionality 2025-07-16 18:00:16 +03:00
TYPESCRIPT_CODEBASE_REVIEW.md docs: Add comprehensive TypeScript codebase review 2026-02-10 09:47:56 +00:00
vite.config.js feat: implement core hooks system with state, signal, computed and effect APIs 2025-07-16 17:47:28 +03:00

Berryact JS Framework

A modern, lightweight JavaScript UI framework designed to be a simpler alternative to React and Vue. At under 15KB uncompressed (~5KB gzipped), Berryact provides a powerful reactive system, component model, and full-featured ecosystem while maintaining exceptional performance.

Table of Contents

Why Berryact?

In a world of complex build tools and heavy frameworks, Berryact offers a simpler, more direct approach to building web applications. Here's why you might choose Berryact for your next project:

  • Simplicity and Speed: With no build step required and zero dependencies, you can get started in seconds. The small bundle size means faster load times for your users.
  • Modern and Performant: Berryact leverages modern browser features to deliver exceptional performance. Its fine-grained reactivity system avoids the overhead of a virtual DOM, ensuring that your application is always fast and responsive.
  • Intuitive and Productive: The API is designed to be simple and intuitive. Features like tagged template literals for UI, a built-in state management store, and a powerful component model help you be more productive.

Key Features

  • 🚀 Ultra Lightweight: < 15KB uncompressed, ~5KB gzipped
  • Zero Dependencies: No external runtime dependencies
  • 🎯 No Build Step Required: Works directly in browsers via ES modules
  • 🔄 Fine-grained Reactivity: Only updates what changes, no virtual DOM
  • 🔥 Modern JavaScript: Uses Proxy, async/await, ES modules
  • 📘 TypeScript Support: Full TypeScript definitions included
  • 🛠️ Great DX: Intuitive API, helpful error messages, devtools

Quick Start

Installation

npm install @oxog/berryact

Basic Usage

<!DOCTYPE html>
<html>
<head>
    <title>Berryact App</title>
</head>
<body>
    <div id="app"></div>
    <script type="module">
        import { createApp, signal, html } from 'https://unpkg.com/@oxog/berryact';

        function Counter() {
            const count = signal(0);
            return html`
                <div>
                    <h1>Count: ${count}</h1>
                    <button @click=${() => count.value++}>Increment</button>
                </div>
            `;
        }

        createApp(Counter).mount('#app');
    </script>
</body>
</html>

Core Concepts

Reactive Signals

Signals are the foundation of Berryact's reactivity system:

import { signal, computed, effect } from '@oxog/berryact';

// Create reactive state
const count = signal(0);
const name = signal('John');

// Create computed values
const greeting = computed(() => `Hello, ${name.value}!`);
const doubled = computed(() => count.value * 2);

// Create side effects
effect(() => {
    console.log(`Count is: ${count.value}`);
});

// Update values
count.value = 5; // Automatically triggers effects and updates UI
name.value = 'Jane';

Component System

Create reusable components with hooks:

import { defineComponent, useState, useEffect } from '@oxog/berryact';

function UserProfile({ userId }) {
    const [user, setUser] = useState(null);
    const [loading, setLoading] = useState(true);

    useEffect(async () => {
        setLoading(true);
        const userData = await fetchUser(userId);
        setUser(userData);
        setLoading(false);
    }, [userId]);

    if (loading) {
        return html`<div>Loading...</div>`;
    }

    return html`
        <div class="user-profile">
            <h2>${user.name}</h2>
            <p>${user.email}</p>
        </div>
    `;
}

Template System

Use tagged template literals for JSX-like syntax without build tools:

import { html } from '@oxog/berryact';

function TodoList({ todos }) {
    return html`
        <ul class="todo-list">
            ${todos.map(todo => html`
                <li class="todo-item ${todo.completed ? 'completed' : ''}">
                    <input 
                        type="checkbox" 
                        checked=${todo.completed}
                        @change=${() => toggleTodo(todo.id)}
                    />
                    <span>${todo.text}</span>
                </li>
            `)}
        </ul>
    `;
}

State Management

Built-in store for application state:

import { createStore } from '@oxog/berryact';

const store = createStore({
    state: {
        count: 0,
        user: null
    },
    getters: {
        doubledCount: (state) => state.count * 2,
        isLoggedIn: (state) => !!state.user
    },
    mutations: {
        increment(state) {
            state.count++;
        },
        setUser(state, user) {
            state.user = user;
        }
    },
    actions: {
        async login(context, credentials) {
            const user = await api.login(credentials);
            context.commit('setUser', user);
        }
    }
});

// Use in components
store.commit('increment');
await store.dispatch('login', { email, password });

Routing

Client-side routing with nested routes:

import { createRouter } from '@oxog/berryact';

const router = createRouter({
    mode: 'history',
    routes: [
        { path: '/', component: Home },
        { path: '/about', component: About },
        { path: '/users/:id', component: UserProfile },
        {
            path: '/admin',
            component: AdminLayout,
            beforeEnter: requireAuth,
            children: [
                { path: 'users', component: AdminUsers },
                { path: 'settings', component: AdminSettings }
            ]
        }
    ]
});

const app = createApp(App);
app.useRouter(router);
app.mount('#app');

Advanced Features

Directives

Built-in directives for common patterns:

// Conditional rendering
html`<div n-if=${isVisible}>Content</div>`

// Show/hide
html`<div n-show=${isVisible}>Content</div>`

// Two-way data binding
html`<input n-model=${inputValue} />`

// Class binding
html`<div n-class=${{ active: isActive, disabled: isDisabled }}>Content</div>`

// Style binding
html`<div n-style=${{ color: textColor, fontSize: size + 'px' }}>Content</div>`

Custom Directives

Register your own directives:

import { registerDirective } from '@oxog/berryact';

registerDirective('focus', (element, value) => {
    if (value) {
        element.focus();
    }
});

// Usage
html`<input n-focus=${shouldFocus} />`

Plugins

Extend functionality with plugins:

import { createLogger, createPersistedState } from '@oxog/berryact';

const store = createStore({
    // ... store config
    plugins: [
        createLogger({ collapsed: false }),
        createPersistedState({ key: 'my-app' })
    ]
});

Performance

Berryact is designed for exceptional performance:

  • Fine-grained reactivity: Only components that depend on changed data re-render
  • No virtual DOM: Direct DOM manipulation with efficient diffing
  • Lazy evaluation: Computed values only recalculate when dependencies change
  • Automatic batching: Multiple updates in the same tick are batched
  • Memory efficient: Weak references prevent memory leaks

Browser Support

  • Chrome 63+
  • Firefox 67+
  • Safari 11.1+
  • Edge 79+

Comparison

Feature Berryact React Vue
Bundle Size (gzipped) ~5KB ~45KB ~35KB
Runtime Dependencies 0 2 1
Build Step Required No Yes Optional
Learning Curve Low Medium Low
Performance Excellent Good Good
TypeScript Support Built-in Good Good

Examples

See the examples/ directory for complete applications:

Documentation

Contributing

We welcome contributions! Please read our Contributing Guide for details.

License

MIT © OXOG


Berryact: Modern web development, simplified. 🚀