Skip to content

Track and invalidate linked partials and typedocs in dev cache #2323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 24, 2025

Conversation

NWylynko
Copy link
Contributor

@NWylynko NWylynko commented Jun 18, 2025

What does this solve?

  • dev script isn't currently tracking and invalidating cache when a <Typedoc /> or <Include /> of a partial is used and edited

What changed?

  • Adds the typedocs and partials to be tracked
  • Invalidates the pages that use them to be re-generated

Checklist

  • I have clicked on "Files changed" and performed a thorough self-review
  • All existing checks pass

@NWylynko NWylynko requested a review from a team as a code owner June 18, 2025 14:51
Copy link

vercel bot commented Jun 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
clerk-docs ✅ Ready (Inspect) Visit Preview Jun 24, 2025 2:25pm

@NWylynko NWylynko requested a review from jescalan June 18, 2025 14:51
@@ -12,7 +12,7 @@
"lint:check-frontmatter": "node ./scripts/check-frontmatter.mjs",
"lint:validation": "npm run build",
"build": "tsx ./scripts/build-docs.ts",
"dev": "tsx ./scripts/build-docs.ts --watch",
"dev": "tsx watch ./scripts/build-docs.ts --watch",
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems weird that it would need both watch flags...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The first watch is to tell tsx to reload and restart the whole script if any of the .ts files change (eg pulling in main having an updated script). The second --watch is to run the script in dev mode holding the markdown in memory and all that.

@@ -827,5 +881,7 @@ template: wide
await fs.rename(config.distTempPath, config.distFinalPath)
}

if (abortSignal?.aborted) throw new Error('Build aborted')
Copy link
Contributor

Choose a reason for hiding this comment

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

This abortsignal thing seems crazy there are so many instances of it and it's so frequent. Is this really the best way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've cleaned it up to just abortSignal?.throwIfAborted() but this is largely just how abort controllers work, just check it throughout execution and exit early if need be.

@NWylynko NWylynko merged commit d1e3abd into main Jun 24, 2025
9 checks passed
@NWylynko NWylynko deleted the nick/fix-dev-cache-invalidation-for-partials-typedoc branch June 24, 2025 16:19
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.

3 participants