LearnNewsExamplesServices
Frontmatter
id7010
titleProof of Concept: Beginner Mode Functional Component
stateClosed
labels
enhancement
assignees[]
createdAtJul 11, 2025, 3:57 AM
updatedAtJul 13, 2025, 7:32 PM
githubUrlhttps://github.com/neomjs/neo/issues/7010
authortobiu
commentsCount1
parentIssue6992
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 13, 2025, 7:32 PM

Proof of Concept: Beginner Mode Functional Component

Closed v10.0.0-beta.6 enhancement
tobiu
tobiu commented on Jul 11, 2025, 3:57 AM

1. Summary

Create a simple, working example of a "Beginner Mode" functional component using Neo.functional.defineComponent and Neo.functional.useConfig.

2. Rationale

This PoC is crucial to validate the end-to-end developer experience for the simplified functional component definition. It will demonstrate that a developer can define a reactive component as a plain function, leveraging hooks for state, and that it renders correctly and updates reactively.

3. Scope & Implementation Plan

  1. Create a Simple Component: Define a basic functional component (e.g., a counter or a text display) using the defineComponent factory and useConfig hook.
  2. Render the Component: Instantiate and render this component within a test environment or a minimal application.
  3. Verify Reactivity: Ensure that changes to the state managed by useConfig correctly trigger re-renders of the component.

4. Example Usage

// In a component file (e.g., MyCounter.mjs)
import { defineComponent } from 'neo/functional/defineComponent.mjs';
import { useConfig }       from 'neo/functional/useConfig.mjs';

export default defineComponent(function MyCounter(config) { // The functional component is now the function itself
    const [count, setCount] = useConfig(0);

    return {
        tag: 'button',
        text: `Count: ${count}`,
        // No listeners property directly in VDOM for beginner mode
    };
});

// In your app's MainView or a test file
// Neo.create(MyCounter, { id: 'my-counter-instance' });
tobiu added the enhancement label on Jul 11, 2025, 3:57 AM
tobiu added parent issue #6992 on Jul 11, 2025, 3:57 AM
tobiu closed this issue on Jul 13, 2025, 7:32 PM