Skip to content

0.15.0

Latest

Choose a tag to compare

@somework somework released this 07 Sep 17:52
· 2 commits to main since this release

The test suite of this package stays on PHPUnit ^11.5: laravel/framework 12/13 registers its error handler in a way
PHPUnit 12.5 rejects (ErrorHandler::enable(): Argument #1 must be TestCase), so the family-wide ^11.5 || ^12.0 || ^13.0
of audit 0.13 W2 does not apply here until the framework does.

Changed

  • The artisan commands are the command classes of the packages; Console\*Command of this package is gone (wave
    M, spec 19 §2.1 and §4.1 — spec 18 §9 had said artisan commands must extend Illuminate\Console\Command, which is
    not so: Illuminate\Console\Application::resolve() takes any symfony/console command). indexnow:check,
    indexnow:config, indexnow:submit, indexnow:submit-model, indexnow:explain, indexnow:key:generate and the
    three "not installed" stubs are IndexNowKit\Console\Command\* of indexnowkit/console 0.5 (submit-model is
    SubmitSubjectsCommand, named by the vocabulary, registered through a Symfony\Component\Console\Command\LazyCommand
    so php artisan never builds it before it runs), indexnow:sitemap is IndexNowKit\Sitemap\Console\SitemapCommand
    (sitemap 0.8), indexnow:history and indexnow:status are IndexNowKit\History\Console\HistoryCommand /
    StatusCommand (history 0.4) — the same names, arguments, options, exit codes and --json as before, the same
    classes the Symfony bundle and the Yii3 package register. The class argument stays model
    (Artisan::call('indexnow:submit-model', ['model' => Post::class])), through the classArgument of the two
    commands. Each command is a binding of its own: $this->app->extend(CheckCommand::class, …) replaces one, a
    command of your own with the same name registered later shadows one. What check and config read is
    Console\ConfigSource (a Console\ConfigSourceInterface, bound). Migration: the twelve classes were final,
    nobody extended them; code that resolved one from the container resolves the package's class instead (the names
    are the same after IndexNowKit\Console\Command\, …\Sitemap\Console\, …\History\Console\).
    Check\ModelSampler is IndexNowKit\Console\SubjectSampler (the same class four adapters carried); Console\ModelLoader
    extends IndexNowKit\Console\AbstractSubjectLoader (its constructor is unchanged; findOne() / findMany() are what is Eloquent's).
  • Check\RouterCheck is the core's Check\LocalesCheck (same code router.locales, same texts, one class for the
    three adapters that print the line; the classes it reads are the --sample-class values, as before). Migration:
    the class was listed in docs/bc.md as a stable name; a check registered by hand becomes new LocalesCheck($locales, $reader, fn () => [Post::class], 'router.locales', 'locale'). Decision §6.4 of spec 19: no wrapper kept.
  • Queue\QueueDispatcher is the push onto the bus around the core's Dispatch\BatchingDispatcher (the constructor
    is unchanged); Queue\SubmitUrlsJob::newId() delegates to BatchingDispatcher::newJobId(); the log lines are the
    core's ({count} URL(s) queued as job {id}, cannot queue {count} URL(s) (job {id}), they are lost: {error} — the
    texts this adapter already printed). Url\LaravelRouteUrlResolver decides the locale expansion, the pinned origin
    and the rebase through the core's Url\RouteOrigin (the same behaviour, the warning text unchanged).
    Check\CacheStoreProbe writes the core's DebounceStoreCheck::PROBE_KEY (indexnowkit_check, no colon: PSR-16
    reserves it) where it read indexnowkit:check. indexnow:status describes the debounce store as
    cache (ArrayStore) — <store> (<StoreClass>), the text of History\Adapter\HistoryServices::describeStore() shared
    with Yii2 and Yii3 — where it said cache (array). Config\ConfigFactory folds the packages' options through
    OptionalPackage::ownedOptions() / ignoredBlocks(). The php artisan about lines of an absent package come
    from the core's predicate.
  • Eloquent\IndexNowObserver resolves through the change handler, not through the facade. Its constructor now
    takes a Closure(): ObjectChangeHandler and a Closure(list<string>): void sink instead of IndexNowKit, so the
    first save() of any model builds the rules, the resolver and the extractor and nothing else: the submitter, the
    client, the transport, the throttle and the debounce store are built in the sink, once a save actually produced a
    URL. A change handler the container cannot build is one error line per process, never an exception in save().
    Migration: an observer built by hand becomes IndexNowObserver::forKit($kit, $logger, $enabled, $router); the
    container binding is unchanged, so applications using the trait or IndexNowKit::observe() do nothing.
    Url\ObjectChangeHandler is now a binding of its own (built over AttributeReaderInterface, GuardedUrlResolver
    and ParamExtractor) and is handed to the IndexNowKit binding, so replacing it changes both.
  • Psr\Clock\ClockInterface is a container binding (IndexNowKit\Clock\SystemClock by default, bound only when
    the application has not bound one) and reaches the throttle, the debounce store, the submitter and the command
    submitter factory. Binding IndexNowKit\Testing\FrozenClock makes the debounce window and the submission records
    of indexnowkit/history deterministic in tests (docs/extending.md, docs/testing.md).
  • Queue\SubmitUrlsJob carries the attempts its batch already spent ($spentAttempts, appended to the
    constructor with a default; attempt() is the batch-wide attempt number, tries is what is left of
    retry.max_attempts). A partially accepted batch is re-queued as a new job whose attempts() starts at one again,
    so before this retry.max_attempts bounded each job instead of the batch, and a steadily shrinking batch could be
    retried far more often than configured. Queued jobs from an older version keep running (spentAttempts defaults to 0).
  • Check\SampleOptions and Check\VerifySampleCheck are removed: they were copies of the core's
    IndexNowKit\Check\SampleOptions and IndexNowKit\Check\SampleGateCheck (core 0.13), which are now bound under
    their own class names. Same container mechanics, same verify.installed lines, same --sample behaviour.
  • The resolver: container lookup no longer wraps the container's exception itself: Url\ArrayResolverLocator does
    it for every adapter, so any failure (not only a BindingResolutionException) is now the one family text
    IndexNow URL resolver "…" cannot be built by the container: ….

Added

  • The router.locales line of indexnow:check (the core's Check\LocalesCheck, see "Changed"): the locales
    locales: 'all' expands to, and a warning naming router.locales when a rule the command can see
    (--sample-class=<FQCN>) asks for every locale while the list is empty. At run time the same situation is one
    warning per process from Url\LaravelRouteUrlResolver, which used to collapse to a single URL without a word.
  • A service tagged indexnowkit.check that is not a Check\CheckInterface is now a ConfigurationException naming
    the tag when the checker is built, instead of a fatal in the middle of the check run.

Fixed

  • Fixed: the package was a fatal without indexnowkit/sitemap, indexnowkit/verify or indexnowkit/history
    (Class "IndexNowKit\Sitemap\Adapter\SitemapServices" not found when the provider registered or the config was
    built): Config\ConfigFactory::factory() and the provider asked the packages' *Services::package() whether the
    package is installed, and those classes live in the packages. They now ask the core's Adapter\OptionalPackage::sitemap()
    / verify() / history() (core 0.13.0); Sitemap\SitemapServices::package(), Verify\VerifyServices::package() and
    History\HistoryServices::package() delegate there too, so overrideApplicationBindings() in tests is unchanged.
    Same texts, same container ids. A new CI job removes the three packages and boots the application with detection
    (OptionalPackagesDetectionTest).
  • Requires indexnowkit/core ^0.13, indexnowkit/console ^0.5 and, when installed, indexnowkit/history ^0.4 (the
    version cascade of wave L, spec 18: the artisan commands keep parsing over the runners, nothing changes here).