LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-sophie
createdAtJul 14, 2025, 4:03 PM
updatedAtNov 6, 2026, 11:00 AM
githubUrlhttps://github.com/neomjs/neo/issues/7047
authortobiu
commentsCount7
parentIssue6992
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 6, 2026, 11:00 AM

Task: Create Example for Deeply Nested Components

Closed v13.4.0/archive-v13-4-0-chunk-2 documentationenhancementdeveloper-experienceno auto closeai
tobiu
tobiu commented on Jul 14, 2025, 4:03 PM

Summary

Create a new example under examples/functional/ that demonstrates deep nesting of components, mixing both classic (class-based) and new functional components.

Rationale

To properly showcase the power and flexibility of the new functional component architecture, we need an example that goes beyond simple parent-child relationships. This example should illustrate:

  1. A functional component hosting multiple child components.
  2. A functional component hosting a classic component, which in turn hosts another functional component.
  3. A classic component hosting a functional component.
  4. State being passed down through multiple levels of nesting.
  5. The reactive updates (component.set()) working correctly through the entire hierarchy.

This will serve as a clear, practical guide for developers on how to structure complex UIs and manage component composition effectively.

Acceptance Criteria

  • A new folder is created under examples/functional/.
  • The example contains at least three levels of component nesting.
  • The nesting hierarchy includes a mix of functional and classic components.
  • The top-level component's state drives changes in the deeply nested children.
  • The example is clean, well-documented, and easy to understand.

Intake contract — Sophie, 2026-11-06

The five original acceptance criteria above are unchanged. Current siblings cover functional-to-classic hosting and nested template markup; this example adds the missing functional → classic → functional component chain and its state propagation. The executed composition probe demonstrated current Engine support without a source change.

Target surface Source of authority Behavior Fallback / edge case Docs Evidence
New examples/functional/nestedComponents/ app Original AC-1–3; hostComponent/ sibling A functional root owns a classic relay and a direct functional sibling; the relay owns a functional child It is an interoperability example, not a change to class-based application guidance Class/method JSDoc and visible hierarchy labels Native example route and component parent-chain inspection
Root named value and message configs Original AC-4; functional.component.Base#diffAndSet, core.Base#set Visible controls apply both configs with set(); relay config hooks forward them to its existing child Stable owner-derived IDs preserve instances; the classic relay does not rebuild its items on an update Explain parent-controlled configs at the forwarding boundary Native inputs + rendered values + App Worker configs
Independent leaf counters Original AC-5; functional/useConfig.mjs Two instances of one leaf class keep distinct local click counts as root values change Re-rendering does not reset a counter or accumulate click handlers Explain local state beside the hook Native clicks before/after root updates; retained DOM nodes
Owned child lifetime functional.component.Base#destroy, container.Base#destroy Removing/destroying the root retires the relay, both leaves and their owned buttons No module-global singleton IDs or manual instance registry Ownership comments in the example App Worker registry and DOM absence after root destruction

Prescription checked: examples/functional/hostComponent/ supplies the app shell and hosting pattern; src/functional/component/Base.mjs already reconciles child configs through set(). The classic relay uses ordinary reactive config hooks. No Engine API, global provider, custom renderer, or new state abstraction is required.

Decision Record impact: none. The later FM-specific class conversion in #14745 does not supersede this dedicated interoperability example.

tobiu assigned to @tobiu on Jul 14, 2025, 4:03 PM
tobiu added the enhancement label on Jul 14, 2025, 4:03 PM
tobiu added parent issue #6992 on Jul 14, 2025, 4:03 PM
tobiu removed the stale label on Oct 24, 2025, 12:05 PM
tobiu added the no auto close label on Oct 24, 2025, 12:05 PM