Prevent stale developer playground PR previews - #8556
Conversation
Signed-off-by: Christoph Knittel <ck@cca.io>
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8556 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d15a81fabb
ℹ️ 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".
| let versionAssetUrl = (version, path) => { | ||
| let url = `${versionRoot(version)}/${path}` | ||
| version->isPreviewVersion ? `${url}?cacheBust=${previewCacheBust}` : url | ||
| } |
There was a problem hiding this comment.
Add regression coverage for preview asset cache busting
Add an automated test covering this URL-generation behavior: a pr-123 selection should apply the same cache-busting value to compiler.js and both runtime-library scripts, while configured and local versions remain unchanged. The commit currently relies only on manual verification, so a later loader refactor could silently restore the stale-preview behavior this bug fix addresses.
AGENTS.md reference: AGENTS.md:L169-L174
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The developer playground does not currently have an automated test harness. Adding one would require introducing and wiring up new test infrastructure, which feels outside the scope of this targeted cache fix.
Signed-off-by: Christoph Knittel <ck@cca.io>
Summary
Add a per-page cache-busting parameter to compiler and library assets loaded for PR previews.
Configured compiler versions and local bundles retain their existing cache behavior.
Motivation
PR preview bundles are uploaded repeatedly to the same URLs. Because the CDN caches these assets for several hours, the developer playground can continue loading an older compiler or library bundle after a successful upload.
The existing
cache=falseoption only bypasses the playground's in-memory script cache; it does not bypass the browser or CDN cache.Verification
yarn workspace dev-playground build.cacheBustparameter.