Skip to content

Docs: disable the Reddit pixel and enable Docusaurus Faster - #9408

Open
pubkey wants to merge 3 commits into
masterfrom
ccr-72a2a03f-fpszmo
Open

pubkey wants to merge 3 commits into
masterfrom
ccr-72a2a03f-fpszmo

Conversation

@pubkey

@pubkey pubkey commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

This PR contains:

  • IMPROVED DOCS (page load and build performance)

Describe the problem you have without this PR

Every docs page loaded the Reddit pixel (https://www.redditstatic.com/ads/pixel.js, about 25 KB) and sent two preconnect hints to www.redditstatic.com and pixel-config.reddit.com. These compete with the page's own critical requests during first load. The docs build also used webpack and Babel, which is slower and produces larger bundles than Rspack and SWC.

Changes:

  • docs-src/src/theme/Root.tsx: the Reddit pixel loader in loadMarketingPixels() is commented out (kept for later re-enabling). triggerTrackingEvent() already checks typeof window.rdt === 'function', so the existing Reddit event calls become no-ops.
  • docs-src/docusaurus.config.ts: removed the two Reddit preconnect head tags.
  • docs-src/package.json + docusaurus.config.ts: added @docusaurus/faster and enabled future.experimental_faster (Rspack, SWC loader and minifier, Lightning CSS minifier, SSG worker threads). The SSG worker threads require future.v4.removeLegacyPostBuildHeadAttribute: true.
  • docs-src/docs/articles/electron-sqlite.md: the header image block produced a nested <p> (invalid HTML). The HTML minifier used by Docusaurus Faster reported it as an SSG warning. Now on one line, so the output is a single <p align="center">.

Not changed: the privacy page (docs-src/src/pages/privacy.tsx) still describes the Reddit Pixel.

Verification

Local docusaurus build with clean caches, after npm install, npm run build in the root and npm install in docs-src:

webpack (before) Docusaurus Faster (this PR)
Build result success success, no SSG warnings
Client compile / full build client compile alone 1.33 min full build 32 s
main.js (raw) 604 KB
Broken-anchor warnings 11 the same 11

The docs are only built in the Publish Docs workflow (on release or manual dispatch), so PR CI does not cover this change. The example-ionic failure on this PR comes from #9102 on master, see the comment below.

Todos

  • Tests (not applicable, docs site only)

Assisted by

  • YES, CLAUDE CODE

🤖 Generated with Claude Code

https://claude.ai/code/session_015P6w6i7rSbhg1u7Qqj6d2U

The Reddit pixel (pixel.js, about 25 KB) was loaded on every docs page and
the two preconnect hints competed with critical requests on first load.
The loader code is kept commented out in Root.tsx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015P6w6i7rSbhg1u7Qqj6d2U
Adds @docusaurus/faster and sets future.experimental_faster so the docs
build uses Rspack, SWC and the Lightning CSS minifier. The SSG worker
threads option requires future.v4.removeLegacyPostBuildHeadAttribute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015P6w6i7rSbhg1u7Qqj6d2U

pubkey commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

The example-ionic failure is not caused by this PR. This PR only changes files in docs-src/.

The job fails with TS2307: Cannot find module '@ionic/angular/standalone' in examples/ionic/src/main.ts. PR CI runs on a merge with the current master, which now includes #9102 (@ionic/angular updated to v9, merged at 00:32 UTC). The Ionic example still imports from @ionic/angular/standalone, which does not resolve with v9. No fix for the example exists on master yet. It has to be fixed there (or #9102 reverted), and this PR picks the fix up on the next CI run.


Generated by Claude Code

MDX wrapped the multi-line image block into an inner <p>, which produced
invalid nested paragraphs. The HTML minifier of Docusaurus Faster reported
this as a static site generation warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015P6w6i7rSbhg1u7Qqj6d2U
@pubkey pubkey changed the title Docs: disable the Reddit pixel and remove its preconnect hints Docs: disable the Reddit pixel and enable Docusaurus Faster Nov 5, 2026

This branch has not been deployed

No deployments
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.

2 participants