NewYour coding agent can read the release notes before it upgrades.Set up the MCP server β
Packagist
Packagist, #1475 most downloaded on Packagist
π§© Nette Component Model: the tree of named components that presenters, controls and forms in Nette are built on.
Latest stable
v4.0.2
Last release 24 days ago
29 Oct 2026
Ships fairly regularly
a new release about every 6 months
Most releases are documented
notes for 20 of 23 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
24 releases Β· first in 2014
Drag across the ruler to compare, or tap a release to open it.
Removed the internal _isCloning() method; no code outside the library calls it
lookup() and the attached/detached notifications consistent$detached callbacks still see it in its place, and lookup() inside them still finds the ancestor being leftNothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server β
If you've been carrying around deprecated attached() / detached() hooks or the magic getComponents() parameters, this is your cue to clean up β the paβ¦
A focused, modern major release. The component model drops legacy baggage, demands PHP 8.3+, and ships a smarter monitoring system that finally behaves predictably when listeners reshape the tree. If you've been carrying around deprecated attached()/detached() hooks or the magic getComponents() parameters, this is your cue to clean up β the payoff is a leaner, stricter, more reliable foundation.
Monitoring handlers now fire top-down (ancestor β descendant). When a subtree is attached, monitor() listeners are invoked from the outermost ancestor inward, matching the natural order of tree construction. The new implementation is robust against listeners that mutate the tree mid-flight: it re-checks validity before descending into children, deduplicates so the same listener never runs twice, and guards against reentry to prevent infinite loops. If your code relied on the old ordering, review listeners that depend on sibling or parent state.
attached() / detached() methods removed. These long-deprecated lifecycle hooks are gone. Migrate to explicit callbacks: replace overridden attached($obj) / detached($obj) with monitor($type, attached: ..., detached: ...). Calling monitor() with no handler at all now throws an InvalidStateException β at least one of attached or detached is required.
Container::getComponents() parameters removed. The method now takes no arguments and returns a plain array of immediate children (previously iterable). The old recursive flag and filter-type argument are gone β passing them throws a DeprecatedException. For recursive traversal use getComponentTree() instead. The internal RecursiveComponentIterator has been removed.
IContainer::addComponent() signature tightened. Now declared as addComponent(IComponent $component, ?string $name): static. Implementations and callers must match the new return type hint.
Nette\SmartObject dropped from Component. The component no longer pulls in the SmartObject trait, and the magic $name, $parent, and $components properties are gone. Use the explicit methods (getName(), getParent(), getComponents()) directly.
IComponent::NAME_SEPARATOR removed. Use IComponent::NameSeparator instead.
PHP 8.3 required.
Component: attached handles are called top-down (ancestor β descendanβ¦
Component: attached handles are called top-down (ancestor β descendanβ¦
Ready for PHP 8.6 β the supported range is now PHP 8.1 to 8.6
A transitional release ahead of 4.0. Nothing is removed yet, this version just lights up deprecation notices on things that will disappear in 4.0, soβ¦
A transitional release ahead of 4.0. Nothing is removed yet, this version just lights up deprecation notices on things that will disappear in 4.0, so you can get your code ready in peace.
Component::$name, Component::$parent and Container::$components β use getName(), getParent(), getComponents() instead.monitor($type) without callbacks β pass them directly: monitor($type, $attached, $detached). Overriding attached() / detached() in subclasses is on its way out.IComponent::NAME_SEPARATOR β switch to IComponent::NameSeparator (the deprecation is now reported via the native #[\Deprecated] attribute).A focused maintenance release for the Component layer. The headline is hardening of the monitor callback machinery: nested re-entry is now safely guar
A focused maintenance release for the Component layer. The headline is hardening of the monitor callback machinery: nested re-entry is now safely guarded, callbacks are normalized to \Closure for consistent deduplication, and the whole codebase has been brought under mandatory static analysis with nette/phpstan-rules.
Component::refreshMonitors() now refuses to re-enter itself while listeners are running. If a listener removes and re-adds the same component (or otherwise triggers another refresh), each component is processed exactly once instead of looping or double-firing.=== to each other unless they are literally the same instance, so the previous strict check silently let duplicates through.nette/phpstan-rules β stricter ruleset enabled, with a dedicated tests/types/component-types.php driving type tests.Nothing published for this version
optimized global function calls
support for PHP 8.4 improved phpDoc
Container::getComponents() parameters are silently deprecated, returns array when $deep is false (BC break)
Container::getComponentTree()Container::getComponents() parameters are silently deprecated, returns array when $deep is false (BC break)composer: allows nette/utils 4.0
Nothing published for this version
Container: component name may be number or null
For the details you can have a look at the diff.
Component::__construct($parent) is deprecated (BC break)
Component: attached() and detached() marked as deprecated in favor of monitoring callbacks
coding style: fixes, lowercase true/false/null
For the details you can have a look at the diff.
Component::__construct() parameters $parent & $name are deprecated
Container::getComponent() optimizationComponent::__construct() parameters $parent & $name are deprecatedFor the details you can have a look at the diff.
Container::getComponent() optimization
getComponent() optimizationFor the details you can have a look at the diff.
Container: shows suggestions for missing components
For the details you can have a look at the diff.
travis: migrating to container-based infrastructure
For the details you can have a look at the diff.
Component: attached() is called only once for each object #2
attached() is called only once for each object #2For the details you can have a look at the diff.
Container::getComponent() uses better exception message when component has parent #1
The first standalone release. For more information see readme.md.
The first standalone release. For more information see readme.md.
One column per quarter.