Skip to content

✨ Add sveltekit router integration#4499

Draft
amortemousque wants to merge 12 commits into
mainfrom
aymeric/sveltekit-router-integration-29695
Draft

✨ Add sveltekit router integration#4499
amortemousque wants to merge 12 commits into
mainfrom
aymeric/sveltekit-router-integration-29695

Conversation

@amortemousque
Copy link
Copy Markdown
Collaborator

Summary

Auto-generated router integration for sveltekit using the router integration pipeline.

  • Router view tracking via startView() on route changes
  • Unit tests for view name computation and navigation filtering

Design Artifacts

Full design trail at docs/integrations/sveltekit/:

  • 01-router-concepts.json — structured routing concepts extracted from framework docs
  • 02-design-decisions.json — hook selection, wrapping strategy, algorithm family decisions
  • 03-generation-manifest.md — list of generated files with lineage

Key Decisions

  • Hook: afterNavigate — only post-cancellation/post-redirect SvelteKit hook that fires uniformly on initial mount (type: 'enter') and subsequent client navigations; onNavigate excludes the initial load so would drop the first RUM view, and page-state reactive hooks require $effect diffing with no timing benefit.
  • Wrapping strategy: renderless component (<DatadogRumRouter />) — afterNavigate has no imperative API and must run during Svelte component init; SvelteKit's file-based routing offers no createRouter factory to wrap, so a renderless component placed in root +layout.svelte is the idiomatic attach point (matches how View Transitions and analytics libs wire in).
  • View-name algorithm: route-id familynavigation.to.route.id already is the collapsed parameterized pattern (e.g. /blog/[slug], /(app)/dashboard); computeViewName is a one-liner that falls back to url.pathname when route.id is null (unmatched/404) and preserves bracket syntax / route groups / matchers verbatim.
  • Reference implementation: rum-vue — closest match on plugin shape (top-level factory + router: boolean + onRumInit queue), subscription pattern (single event-based post-redirect hook, router.afterEachafterNavigate), and view-name algorithm (pure-function computeViewName split from subscription site); the wrapping surface differs but the RUM-facing side transfers directly.

Test plan

  • Review design artifacts in docs/integrations/sveltekit/
  • Review generated code against reference implementations
  • Run yarn typecheck to verify type correctness
  • Run yarn test:unit --spec packages/rum-sveltekit/ to verify tests pass
  • Manual review of computeViewName() edge cases

🤖 Generated with the router integration pipeline

amortemousque and others added 12 commits April 8, 2026 17:14
Design for a fully automated Claude Code skill pipeline that generates
draft Browser SDK router integration PRs from framework public docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Updated spec: skills use separate subdirectories (SKILL.md per dir)
- Plan covers 7 tasks: orchestrator + 5 stage skills + validation
- Each task has step-by-step instructions with exact file paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Six Claude Code skills forming an automated pipeline:
- router:pipeline — orchestrator chaining all stages
- router:fetch-docs — Stage 1: fetch & extract router concepts
- router:analyze — Stage 2: map to SDK patterns
- router:design — Stage 3: produce design decisions
- router:generate — Stage 4: generate package code
- router:pr — Stage 5: create draft PR

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Generated by the router integration pipeline.
Artifacts: router concepts, design decisions, generation manifest.
Auto-generated from framework documentation using the router integration pipeline.
See docs/integrations/sveltekit/ for design artifacts and decision rationale.
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Apr 17, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 177.94 KiB 177.94 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.03 KiB 27.03 KiB 0 B 0.00%
Logs 56.40 KiB 56.40 KiB 0 B 0.00%
Rum Slim 133.81 KiB 133.81 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0085 0.0044 -48.24%
RUM - add action 0.0264 0.0143 -45.83%
RUM - add error 0.0247 0.0136 -44.94%
RUM - add timing 0.0053 0.004 -24.53%
RUM - start view 0.0233 0.0131 -43.78%
RUM - start/stop session replay recording 0.0014 0.001 -28.57%
Logs - log message 0.0306 0.0186 -39.22%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 25.97 KiB 27.77 KiB +1.80 KiB
RUM - add action 98.72 KiB 100.26 KiB +1.54 KiB
RUM - add timing 26.43 KiB 27.04 KiB +628 B
RUM - add error 85.28 KiB 90.61 KiB +5.34 KiB
RUM - start/stop session replay recording 26.30 KiB 26.01 KiB -300 B
RUM - start view 486.03 KiB 482.55 KiB -3.48 KiB
Logs - log message 92.85 KiB 98.19 KiB +5.35 KiB

🔗 RealWorld

@datadog-official
Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 77.78%
Overall Coverage: 77.60% (+0.57%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: efba2dc | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

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