Skip to content

0.14.0

Latest

Choose a tag to compare

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

Removed

  • Debounce\YiiCacheDebounceStore (wave M, spec 19 §2.9): it was the core's Debounce\Psr16DebounceStore written
    once more over the Yii cache API; the component wires new Psr16DebounceStore(new Cache\Psr16Cache($component), $prefix) for a debounce.store naming a cache component — the same keys, the same window. Migration: code that
    constructed it does the same two lines; the class was not in docs/bc.md.
  • Check\RouterCheck and Check\RecordSampler: the router.locales line is the core's Check\LocalesCheck
    (same code, one text for the three adapters that print it: the ok line now names the route parameter, and with an
    empty list and no rule asking for every locale the line is not printed — it used to be an ok line), the
    --sample-class sampler is Console\SubjectSampler of indexnowkit/console (the same class four adapters carried).

Changed

  • Log\YiiLogger throws Psr\Log\InvalidArgumentException on a level PSR-3 does not define (wave M, spec 19 §3),
    as the standard requires ("MUST throw"); it used to log the line at info. Migration: a call with a level of your
    own ($logger->log('verbose', …)) must use one of the eight of Psr\Log\LogLevel.
  • Wave M, the rest (spec 19): ActiveRecord\ActiveRecordLoader extends Console\AbstractSubjectLoader of
    indexnowkit/console (its constructor is unchanged); Queue\QueueDispatcher is the push onto the queue component
    around the core's Dispatch\BatchingDispatcher (constructor unchanged, the log lines are the core's, the texts this
    adapter already printed), Queue\SubmitUrlsJob::newId() delegates to BatchingDispatcher::newJobId();
    Url\YiiRouteUrlResolver decides the locale expansion, the pinned origin and the rebase through the core's
    Url\RouteOrigin and takes the graph's logger as an appended optional parameter, so locales: 'all' over an empty
    router.locales is warned about once per process (it collapsed silently); Check\CacheProbe writes the core's
    DebounceStoreCheck::PROBE_KEY (indexnowkit_check, no colon: PSR-16 reserves it) where it wrote indexnowkit:check;
    indexnow/status describes the debounce store through History\Adapter\HistoryServices::describeStore() (the same
    <id> (<Class>) line as before, shared with Laravel and Yii3); indexnow/sitemap leaves sitemap.enabled: false
    to the runner (same answer, exit 2) and hands it the graph's clock, so --changed-since "1 day" counts back from a
    clock override; indexnow/history --limit and key-generate --length fall back to HistoryCommand::DEFAULT_LIMIT
    and KeyGenerateCommand::DEFAULT_LENGTH instead of literals; Config\ConfigFactory folds the packages' options
    through OptionalPackage::ownedOptions() / ignoredBlocks().
  • The ActiveRecord observer no longer takes the facade: ActiveRecord\IndexNowObserver::__construct() takes a
    Closure(): Adapter\Services where it took an IndexNowKit, and builds Hook\ObserverHelper::forChanges() from
    Services::changes() on the first hook, inside a try/catch. A save() therefore resolves URLs without building
    the client, the transport or the debounce store, and a graph that cannot be built at all is one error line instead
    of an exception out of save(). Migration: nobody needs to construct the observer — use
    Yii::$app->indexnow->observer(); code that did should pass fn () => Yii::$app->indexnow->services().
  • Configuration errors of the adapter are IndexNowKit\Exception\ConfigurationException, not Yii's
    InvalidConfigException: an override (transport, debounceStore, dispatcher, urlResolver, clock, checks)
    that names nothing or the wrong type, a queue.component that is not a yii\queue\Queue, a history.store whose
    connection or cache does not resolve, --component naming something that is not the component, and the queue job's
    "component is not configured in the worker application". Yii's exception is left to what Yii itself throws.
    Migration: catch IndexNowKit\Exception\ConfigurationException (it is an InvalidArgumentException).
  • The clock is a node of the graph: the new clock component property (PSR-20, an instance, a class or a
    component id) reaches the throttle, the debounce window and the submission timestamps, because Wiring now
    passes Services::clock() to the Submitter it builds for the pre-flight and to DebounceStoreFactory::fromConfig().
    IndexNowKit\Testing\FrozenClock makes a whole flush deterministic, recorded history included.
  • history.store is wired by the package: History\Adapter\HistoryServices::storeFor() replaces the adapter's own
    twenty lines; the adapter passes only "the PDO of this db component" and "a PSR-16 view of this cache component".
    The texts and the exception are the same in every adapter (needs indexnowkit/history ^0.3.1).
  • Check\VerifySampleCheck and Check\SampleOptions are removed: the core's Check\SampleGateCheck and
    Check\SampleOptions (code verify.installed, same lines). IndexNowComponent::$samples is now the core's type.
  • An insert is verified against the values the record wrote, an update against the columns it changed, and the core
    compares only what every driver spells the same way — a DECIMAL, a date or a JSON document no longer discards the
    announcement of a new page. An update or a delete is staged under the subject (Post#7), so a second change of the
    same record in one transaction joins the first instead of discarding its URLs.

Added

  • The router.locales line of indexnow/check (the core's Check\LocalesCheck, see "Removed"): it names the
    locales locales: 'all' expands to, and warns when router.locales is empty while a hooked model carries a rule
    that asks for all of them.
  • The clock component property (see "Changed").

Fixed

  • PHP 8.5 without deprecations — ActiveRecord\IndexNowObserver uses the SplObjectStorage offset methods
    (attach()/contains() are deprecated since 8.5). No runtime change.
  • Fixed: the component was a fatal without indexnowkit/sitemap, indexnowkit/verify or indexnowkit/history
    (Class "IndexNowKit\Sitemap\Adapter\SitemapServices" not found at the first configuration build):
    Config\ConfigFactory::factory() and IndexNowComponent::sitemapPackage() / verifyPackage() / historyPackage()
    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). Same texts,
    same properties. A new CI job removes the three packages and boots the application with detection
    (OptionalPackagesDetectionTest).
  • Requires indexnowkit/core ^0.13, indexnowkit/console ^0.5; indexnowkit/history ^0.4 when installed
    (HistoryServices::storeFor(); the version cascade of wave L, spec 18 — the Yii2 controller keeps parsing over the
    runners, nothing changes here).