Error tracking docs: recommend the error-tracking wizard command behind a flag - #20180
Merged
Merged
Conversation
…nd a flag Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Deploy preview
Changed pages
|
Contributor
Bundle reportTotal JS (gzip)8.78 MiB (+0.2 KiB / +0.0%) Eager graph (modules shipped in each entrypoint's initial chunks)
Largest modules in the
|
| Module | Size |
|---|---|
./src/data/mcp-tools.json |
1137.9 KiB |
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css |
773.5 KiB |
./src/components/Stickers/Stickers.tsx |
696.4 KiB |
./node_modules/.pnpm/@radix-ui+react-icons@1.3.2_react@18.3.1/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js |
481.4 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/x-ray.mjs |
480.8 KiB |
./node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js + 29 modules |
395.1 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/im-the-driver.mjs |
385.7 KiB |
./src/hooks/useCustomers.tsx + 55 modules |
370.0 KiB |
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
354.8 KiB |
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules |
351.4 KiB |
./src/components/ProductComparisonTable/index.tsx + 126 modules |
305.7 KiB |
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js |
281.9 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/doll-house.mjs |
281.7 KiB |
./node_modules/.pnpm/@posthog+brand@0.8.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/director.mjs |
275.6 KiB |
./src/components/SearchUI/index.tsx + 87 modules |
273.7 KiB |
Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes for the modules actually shipped in the entrypoint's initial chunks (post-tree-shake).
ablaszkiewicz
marked this pull request as ready for review
September 15, 2026 12:19
hpouillot
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The error tracking docs recommend the wizard on three pages. The wizard adds a dedicated
error-trackingcommand that installs the SDK, sets up exception capture, and sets up source map upload (PostHog/wizard#1185). Until that command ships, the pages must keep the current commands.This PR lets those pages swap to
error-trackingwhile the PostHog feature flagerror-tracking-new-wizardis on. With the flag off, the pages do not change.WizardCommandgets an optionalflagCommandprop. The server render and the first client render show the current command. When the flags load and the flag is on, the component shows the flagged subcommand.flagCommand={{ flag: 'error-tracking-new-wizard', command: 'error-tracking' }}.wizard error-trackingrow comes with the wizard release.The app side of the same rollout is PostHog/posthog#100838.
🗺️ PR tour
Stop 1:
WizardCommandlearns a flagged subcommand (diff)The component keeps its old props. The new
flagCommandprop names a flag and a subcommand. Without the prop, the component renders as before. With the prop,RenderInClientshows the current command as the placeholder, then rendersFlaggedWizardCommand, which reads the flag withposthog.isFeatureEnabledand picks the subcommand.posthog.com/src/components/WizardCommand/index.tsx
Lines 41 to 62 in 3cff908
rendercallback.RenderInClientcallsrender()inside its own render, so a hook in that callback would change the hook count between the placeholder and the real render.Stop 2: The three error tracking pages (installation, source maps index, source maps snippet)
Each page passes the same
flagCommand. The installation index showed the base command. The two source map call sites showedupload-source-maps. The prose around each command does not change, because theerror-trackingcommand also does what each paragraph describes.posthog.com/contents/docs/error-tracking/installation/index.mdx
Lines 10 to 14 in 3cff908
🔍 Reviewer's guide
Testing done
pnpm exec prettier --check src/components/WizardCommand/index.tsxpnpm start(Node 22), loaded/docs/error-tracking/installation,/docs/error-tracking/upload-source-maps, and/docs/error-tracking/upload-source-maps/webpackfalsefor the flag, on the three pagesmastertrueforerror-tracking-new-wizardnpx @posthog/wizard error-trackingmasterand on this branch, flag off and on, on the three pagesvalidateDOMNestingwarning whose component stack now namesFlaggedWizardCommandNot tested: the real posthog-js flag load on the production site. The local checks stub the flag answer, because the dev build does not initialize posthog-js.
Screenshots
Pending upload. The before/after grid for the three pages is captured and follows in an edit.
What to look at
FlaggedWizardCommandreads the flag once per render and does not subscribe to later flag changes.RenderInClientmounts it afteronFeatureFlagsfires, or after its five second fallback, so the first read has the flags. A page that loads flags later than that keeps the current command until a reload.error-tracking-new-wizardwhen the flag is renamed or removed.🤖 Generated with Claude Code