PackageTrack
Sign in Get early access

nette/component-model

⚛ Nette Component Model

v4.0.1 17M downloads/mo #2090 most downloaded on Packagist nette/component-model

What this package is like to depend on

Last release 2 months ago

21 Jun 2026

Ships fairly regularly

a new release about every 11 months

Some releases are documented

notes for 7 of 21 stable releases

Nothing withdrawn

no release was ever pulled

12 years old

22 releases · first in 2014

6 releases in the last 12 months

see the full history below

Release timeline

22 releases · Jun 2014 to Jun 2026
2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 22
  1. v4.0.1 21 Jun 2026

    Nothing published for this version

  2. v4.0.0 14 Jun 2026
    Release notes

    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.

    💥 Breaking Changes

    • 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.

    Open source →
  3. v4.0.0-RC1 21 Jun 2026 pre-release
    Release notes

    Component: attached handles are called top-down (ancestor → descendan…

    Open source →
  4. v3.2.0 26 May 2026
    Release notes

    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.

    💥 Deprecated (will be removed in 4.0)

    • Magic properties Component::$name, Component::$parent and Container::$components – use getName(), getParent(), getComponents() instead.
    • Calling monitor($type) without callbacks – pass them directly: monitor($type, $attached, $detached). Overriding attached() / detached() in subclasses is on its way out.
    • Constant IComponent::NAME_SEPARATOR – switch to IComponent::NameSeparator (the deprecation is now reported via the native #[\Deprecated] attribute).
    Open source →
  5. v3.1.4 27 Mar 2026
    Release notes

    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.

    • Reentry protection for monitor callbacksComponent::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.
    • Reliable callback deduplication – switched the in-array check for monitor callbacks to loose comparison. Closures are never === to each other unless they are literally the same instance, so the previous strict check silently let duplicates through.
    • Adopted nette/phpstan-rules – stricter ruleset enabled, with a dedicated tests/types/component-types.php driving type tests.
    Open source →
  6. v3.1.3 22 Nov 2025

    Nothing published for this version

  7. v3.1.2 06 Aug 2025
    Release notes
    • support for PHP 8.5
    • optimized global function calls
    Open source →
  8. v3.1.1 07 Aug 2024
    Release notes
    • support for PHP 8.4
    • improved phpDoc
    Open source →
  9. v3.1.0 08 Feb 2024
    Release notes
    • requires PHP 8.1
    • uses PHP 8.1 features
    • added Container::getComponentTree()
    • Container::getComponents() parameters are silently deprecated, returns array when $deep is false (BC break)
    Open source →
  10. v3.0.3 09 Jan 2023
    Release notes
    • composer: allows nette/utils 4.0
    • constants are PascalCase
    Open source →
  11. v3.0.2 25 Aug 2021

    Nothing published for this version

  12. v3.0.1 21 Apr 2020

    Nothing published for this version

  13. v3.0.0 20 Feb 2019

    Nothing published for this version

  14. v2.4.0 20 Mar 2018

    Nothing published for this version

  15. v2.3.1 11 Jul 2017

    Nothing published for this version

  16. v2.3.0 17 Jun 2016

    Nothing published for this version

  17. v2.2.5 12 Dec 2016

    Nothing published for this version

  18. v2.2.4 06 Oct 2015

    Nothing published for this version

  19. v2.2.3 11 Jul 2015

    Nothing published for this version

  20. v2.2.2 16 Jun 2015

    Nothing published for this version

  21. v2.2.1 06 Feb 2015

    Nothing published for this version

  22. v2.2.0 24 Jun 2014

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive