Skip to content

feat(fmt): cache files using package plugins - #232

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/feat-fmt-plugin-cache
Aug 7, 2026
Merged

feat(fmt): cache files using package plugins#232
chenjiahan merged 1 commit into
mainfrom
chenjiahan/feat-fmt-plugin-cache

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Files using custom Prettier plugins currently bypass the persistent formatting cache even when the installed plugin identity is stable.

This PR resolves distinct plugin fingerprints once per invocation and injects them into per-file option hashes. Files using local, linked, or unversioned plugins continue to bypass the cache without disabling caching for other files.

Related Links

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 50522a6
Status: ✅  Deploy successful!
Preview URL: https://af2e3047.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-feat-fmt-plugin-c.rstack-cli.pages.dev

View logs

@chenjiahan
chenjiahan merged commit af8e2c4 into main Aug 7, 2026
4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/feat-fmt-plugin-cache branch August 7, 2026 07:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50522a614b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
fingerprints.push(fingerprint);
}
value = { ...options, plugins: fingerprints };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Account for plugin configuration inputs in the cache key

For plugins whose output depends on external files, such as prettier-plugin-tailwindcss reading a Tailwind config or stylesheet, changing that file leaves the formatted file content, the option containing its path, and this package fingerprint unchanged. The worker can consequently reuse the prior entry without running the plugin, causing --check to report clean or --write to do nothing even though the expected formatting changed; these plugins need their external inputs included in invalidation or must continue bypassing the cache.

Useful? React with 👍 / 👎.

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