Skip to content

fix(docs): render the FAQ JSON-LD as a native script tag, and forbid data-typed next/script - #8875

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/guardrails-docs
Oct 10, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/guardrails-docs

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Render the docs FAQ JSON-LD as a native <script type='application/ld+json'>. next/script (default afterInteractive) renders nothing on the server and injects from an effect, so the FAQPage structured data never reached the served HTML — same bug and same fix as 025ea4d / 5da48d0
  • Extend check:source-text (already in check:audits) to fail on any next/script element in apps/** whose static type isn't JavaScript, so this can't ship a fourth time. The message points at the native-script + serializeJsonLd pattern

Type of Change

  • Bug fix

Testing

  • bun run scripts/check-source-text.ts passes on this branch; with the pre-fix faq.tsx it fails at faq.tsx:94, and with the pre-025ea4d2bd structured-data.tsx it fails at its three JSON-LD sites
  • Audited the other next/script uses in apps/sim and apps/docs — all load external JS via src, none affected
  • Full audits, lint, type-check and docs build run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…data-typed next/script

The FAQ component rendered its FAQPage JSON-LD through next/script with the
default afterInteractive strategy, which returns null on the server and injects
the tag from a client effect, so the served HTML never carried it. Render a
native <script> the way #6763 fixed the other docs JSON-LD blocks;
serializeJsonLd already escapes '<'.

check:source-text now also fails on a next/script element in apps/** whose type
is not JavaScript, naming the native-script fix.
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Oct 10, 2026 2:24am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread scripts/check-source-text.ts Outdated
Comment thread scripts/check-source-text.ts Outdated
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] No separate new issue was found that blocks merging.

Summary

The PR renders FAQ JSON-LD with a native <script> and adds a source audit for data-typed next/script elements.

  • The docs FAQ puts its JSON-LD in the HTML served to crawlers.
  • The source-text audit rejects data-typed next/script elements in app source.

Reviews (4) · Last reviewed commit: "fix(audits): keep JSX template literals ..." · Reviewed by Greptile

Comment thread scripts/check-source-text.ts Outdated
Comment thread scripts/check-source-text.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread scripts/check-source-text.ts Outdated
Comment thread scripts/check-source-text.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

Comment thread scripts/check-source-text.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit e526a91 into staging Oct 10, 2026
48 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/guardrails-docs branch October 10, 2026 03:44

This branch was successfully deployed

1 active deployment
Preview — 765cda1a Deployed Oct 10, 2026 by vercel[bot]
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