Skip to content

Remove unused webPageJsonLd options - #226

Merged
anonrig merged 1 commit into
anonrig:mainfrom
JonasBa:jonas/unused-props-cleanup
Sep 4, 2026
Merged

Remove unused webPageJsonLd options#226
anonrig merged 1 commit into
anonrig:mainfrom
JonasBa:jonas/unused-props-cleanup

Conversation

@JonasBa

@JonasBa JonasBa commented Sep 1, 2026

Copy link
Copy Markdown

type: chore
intent: Drop optional webPageJsonLd fields that no caller ever provides
app-source-changed: true
constraints: typescript@6
verify:

  • node --run lint
  • node --run test
  • node --run build
    preview:

Hey — I'm working on an experimental CLI that uses the tsgo toolchain to find optional component and function signatures that are never passed in practice. Dead-code elimination, complementary to something like knip.

webPageJsonLd accepted optional breadcrumbs and image, but every call site (about, contact, newsletter, press) omitted both and relied on the defaults: home → page title breadcrumbs, and the site OG image. This PR removes those options and inlines the defaults.

JSON-LD output is unchanged. Blog posts, tags, and series still build their own breadcrumb lists via blogPostingJsonLd / tagCollectionJsonLd / seriesCollectionJsonLd.

I'm opening this to help clear dead surface, and also to get feedback on the detector. False positives are always possible.

Some other PRs from the same loop:

Sentry (4k loc removed)
Tanstack
Grafana
Cal.com

Would love to hear your feedback.

Summary

  • Remove unused optional breadcrumbs and image from webPageJsonLd
  • Always use pageBreadcrumbs(title, path) and the default OG image

Non-goals

  • Layout / Page breadcrumbs (those are still passed)
  • Blog post, tag, or series JSON-LD breadcrumb construction
  • Changing emitted JSON-LD

Test plan

  • node --run lint
  • node --run test
  • node --run build
  • Spot-check /about, /contact, /newsletter, /press JSON-LD: breadcrumb list is Home → page title, primaryImageOfPage is the site OG image

Made with Cursor

No caller ever passed them, so the home-breadcrumb and default OG image paths were the only ones in use.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI 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.

🟢 Approval recommended

All in-repo webPageJsonLd call sites were verified to never pass breadcrumbs or image, so the change is a safe surface-area reduction with no functional impact.

Pull request overview

This PR simplifies the site’s JSON-LD helper API by removing webPageJsonLd options (breadcrumbs, image) that are not used anywhere in this repository, and by always using the existing defaults (home → page title breadcrumbs, and the site OG image). This reduces unused surface area in src/lib/schema.ts while keeping emitted JSON-LD stable for existing call sites.

Changes:

  • Removed unused breadcrumbs and image options from webPageJsonLd’s options type.
  • Inlined default breadcrumb construction via pageBreadcrumbs(options.title, options.path).
  • Inlined default primaryImageOfPage to ${websiteUrl}/opengraph-image.png.
File summaries
File Description
src/lib/schema.ts Removes unused webPageJsonLd option fields and hardwires the existing default breadcrumbs + OG image.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@anonrig
anonrig merged commit d0b0736 into anonrig:main Sep 4, 2026
6 checks passed
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