Skip to content

[Caching] Deprecate cacheMetaExtension(), report warning when used - #8251

Merged
TomasVotruba merged 2 commits into
mainfrom
deprecate-cache-meta-extension
Jul 31, 2026
Merged

[Caching] Deprecate cacheMetaExtension(), report warning when used#8251
TomasVotruba merged 2 commits into
mainfrom
deprecate-cache-meta-extension

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Jul 31, 2026

Copy link
Copy Markdown
Member

The cacheMetaExtension() is a niche mechanism. Let Rector handle its cache on its own; if custom invalidation is needed, CI can handle it in a more generic way, e.g. by clearing the cache directory.

The config option stays and is marked @deprecated; it only reports a warning now. The mechanism itself is no longer applied, so there is no BC layer to keep alive.

What is deprecated

  • RectorConfig::cacheMetaExtension()
  • RectorConfigBuilder::withCacheMetaExtension()
  • CacheMetaExtensionInterface

Warning on use

return RectorConfig::configure()
    ->withRules([...])
    ->withCacheMetaExtension(SomeCacheMetaExtension::class);
  [OK] Rector is done!
+
+ [WARNING] Cache meta extension "SomeCacheMetaExtension" is deprecated and no
+           longer applied. It is a niche mechanism, let Rector handle cache on
+           its own. If custom invalidation is needed, handle it in CI in a more
+           generic way, e.g. by clearing the cache directory.

Docs removal: https://github.com/rectorphp/getrector-com/pull/new/remove-cache-meta-extension-docs

Niche mechanism. Rector handles cache on its own; custom invalidation is better handled in CI in a generic way, e.g. by clearing the cache directory.

The config option is kept and marked @deprecated, it only reports a warning. The mechanism itself is no longer applied.
@TomasVotruba
TomasVotruba force-pushed the deprecate-cache-meta-extension branch from adb1717 to 3e69749 Compare July 31, 2026 20:45
@TomasVotruba TomasVotruba changed the title [Caching] Deprecate cacheMetaExtension(), add warning when used [Caching] Deprecate cacheMetaExtension(), report warning when used Jul 31, 2026
@TomasVotruba
TomasVotruba enabled auto-merge (squash) July 31, 2026 20:53
@TomasVotruba
TomasVotruba disabled auto-merge July 31, 2026 20:54
@TomasVotruba
TomasVotruba merged commit 39ac0ad into main Jul 31, 2026
63 of 65 checks passed
@TomasVotruba
TomasVotruba deleted the deprecate-cache-meta-extension branch July 31, 2026 20:54
@ruudk

ruudk commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Hi Tomas, by luck I stumbled upon this PR that removes my work from #7933. Of course I'm a bit sad to see this but it's your call after all which I respect.

I see you don't see a need for cache extensions. Would you be open for allowing configuring a custom FileComputeHasher? Then I could just override the hash method with my custom logic.

Moving this cache busting responsibility to the CI as suggested in this PR is not really an option for when using it locally.

@TomasVotruba

Copy link
Copy Markdown
Member Author

Hey, sorry to hear that. I'm trying to make Rector more and more simpler and cutting niche features. Saying that, won't accept any such feature: I'd be open to those benefiting most users and general Rector speed.
I suggest using a wrapper caching tool that would handle your specific need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants