Skip to content

refactor: require pollora/discovery instead of shipping it - #461

Merged
ogorzalka merged 2 commits into
release/v13.36.0from
feat/require-discovery-package
Oct 12, 2026
Merged

ogorzalka merged 2 commits into
release/v13.36.0from
feat/require-discovery-package

Conversation

@ogorzalka

@ogorzalka ogorzalka commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Second step of the discovery extraction: the framework requires pollora/discovery (v0.1.0 on Packagist) instead of shipping it. Builds on #460, whose commit it carries: it targets release/v13.36.0 directly because CI only runs on pull requests to main, develop and release/**. Merge #460 first; this one then shows its own commit only.

What moves to the package

The engine and its services (DiscoveryEngine, DiscoveryCacheManager, InstancePool, ReflectionCache), the contracts and models (Domain/*), DiscoveryManager, the resolvers, Psr16DiscoverCacheDriver and #[SkipDiscovery] — with their unit tests and the benchmarks, which now run in the package's CI with a memory bound. Class names do not change.

What stays in the framework

What needs Laravel: DiscoveryServiceProvider, discovery:run / discovery:clear, DiscoveryRegistrar, ServiceProviderDiscovery, the Laravel adapters (LaravelInstanceResolver, LaravelDiscoveryCacheManagerFactory, LaravelDiscoveryCache), and HasConfiguringSupport / ConfigurableDiscoveryInterface, which build post types and taxonomies through pollora/entity. They keep their namespaces: Composer resolves Pollora\Discovery\* in the package first, then in the framework's src/.

Constraint

pollora/discovery: ^0.1 || ^1.0. The package is tagged 1.0.0 with the framework release, and the constraint becomes ^1.0 then.

Checks

  • Installed from Packagist (zip, no symlink): Pest 1 954 passed (the 59 others moved with the package, which has 76), PHPStan 0 errors.
  • Package CI: PHP 8.3/8.4 × lowest/stable, PHPStan, Pint, benchmark (1 000 classes, 206 ms, 16.8 MB on the runner).

Two ports, InstanceResolverInterface and DiscoveryRegistrarInterface,
replace the container in the engine, the instance pool and the reflection
cache; DiscoveryCacheManager takes its driver and logger, and the Laravel
provider builds them. Adds a PSR-16 cache driver, an architecture test for
the part that becomes pollora/discovery, and fixes the benchmarks' memory
measurement.
The engine, its contracts, the cache and #[SkipDiscovery] now come from
pollora/discovery, with the same class names. The framework keeps the
Laravel side: provider, commands, registrar, adapters, and the
post type and taxonomy support.
@ogorzalka
ogorzalka changed the base branch from feat/discovery-decoupling to release/v13.36.0 October 12, 2026 09:53
@ogorzalka ogorzalka closed this Oct 12, 2026
@ogorzalka ogorzalka reopened this Oct 12, 2026
@ogorzalka
ogorzalka merged commit 6f47ded into release/v13.36.0 Oct 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant