Frontmatter
| title | fix/functional.component.Base: enhance destroy() signature |
| author | ad1tyayadav |
| state | Merged |
| createdAt | Oct 26, 2025, 3:04 PM |
| updatedAt | Oct 27, 2025, 11:45 AM |
| closedAt | Oct 27, 2025, 11:45 AM |
| mergedAt | Oct 27, 2025, 11:45 AM |
| branches | dev ← fix-functional-destroy |
| url | https://github.com/neomjs/neo/pull/7667 |
Merged

ad1tyayadav
commented on Oct 26, 2025, 3:16 PM
Hey @tobiu can you please review this pr?

tobiu
commented on Oct 27, 2025, 11:44 AM
Input from Gemini:
✦ This is an excellent and crucial optimization. My initial review was too superficial. After reviewing the 'Functional Components' epic and the base classes, I have a much deeper appreciation for this change.
When a
functional.component.Basehosts classic components, it must act as a responsible owner for their lifecycle. This PR correctly applies the established, performant destruction pattern fromcontainer.Baseto the functional component's classic children. By callingdestroy(false, true), it prevents a potential storm of VDOM updates and ensures that the two component paradigms can interoperate efficiently.This is a great catch and a solid implementation. LGTM!
Closes #7062
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The PR fulfills this requirement:
devbranch, not themainbranchOther information:
Summary
Enhanced the
destroy()method signature infunctional.component.Baseto match the pattern used incomponent.Baseandcontainer.Base.Changes
updateParentVdomandsilentparameters to thedestroy()methodsilent=truewhen destroying child components to prevent unnecessary vdom updatessuper.destroy()for consistency with component hierarchyWhy This Change?
component.Base(L1144) andcontainer.Base(L476)Testing
The change follows the existing pattern from:
src/component/Base.mjs#L1144src/container/Base.mjs#L476src/component/Abstract.mjs#L284No breaking changes - the method remains backwards compatible with default parameter values.