From f8da6b0714ae400bb07eebeae923c654b0064369 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Sun, 21 Jun 2026 16:41:07 +0530 Subject: [PATCH 1/6] docs: align Node page titles with Python --- docs/content/docs/node/getting-started/capabilities.mdx | 2 +- docs/content/docs/node/guides/core/execution-model.mdx | 2 +- docs/content/docs/node/guides/core/predicates.mdx | 2 +- docs/content/docs/node/guides/core/queues.mdx | 2 +- docs/content/docs/node/guides/core/scheduling.mdx | 2 +- docs/content/docs/node/guides/extensibility/middleware.mdx | 2 +- docs/content/docs/node/guides/extensibility/serializers.mdx | 2 +- docs/content/docs/node/guides/integrations/express.mdx | 2 +- docs/content/docs/node/guides/integrations/fastify.mdx | 2 +- docs/content/docs/node/guides/integrations/nest.mdx | 2 +- docs/content/docs/node/guides/integrations/otel.mdx | 2 +- docs/content/docs/node/guides/integrations/prometheus.mdx | 2 +- docs/content/docs/node/guides/integrations/sentry.mdx | 2 +- docs/content/docs/node/guides/observability/logging.mdx | 2 +- docs/content/docs/node/guides/observability/monitoring.mdx | 2 +- docs/content/docs/node/guides/operations/inspection.mdx | 2 +- docs/content/docs/node/guides/operations/keda.mdx | 2 +- docs/content/docs/node/guides/operations/mesh.mdx | 2 +- .../docs/node/guides/reliability/circuit-breakers.mdx | 2 +- docs/content/docs/node/guides/reliability/error-handling.mdx | 2 +- docs/content/docs/node/guides/reliability/guarantees.mdx | 2 +- docs/content/docs/node/guides/reliability/locks.mdx | 2 +- docs/content/docs/node/guides/reliability/rate-limiting.mdx | 2 +- .../docs/node/guides/resources/dependency-injection.mdx | 2 +- docs/content/docs/node/guides/resources/index.mdx | 2 +- docs/content/docs/node/guides/resources/interception.mdx | 2 +- docs/content/docs/node/guides/workflows/analysis.mdx | 2 +- docs/content/docs/node/guides/workflows/caching.mdx | 2 +- docs/content/docs/node/guides/workflows/canvas.mdx | 2 +- docs/content/docs/node/guides/workflows/conditions.mdx | 2 +- docs/content/docs/node/guides/workflows/saga.mdx | 2 +- docs/content/docs/node/guides/workflows/sub-workflows.mdx | 2 +- docs/content/docs/node/more/examples/bulk-emails.mdx | 2 +- docs/content/docs/node/more/examples/data-pipeline.mdx | 2 +- docs/content/docs/node/more/examples/express-service.mdx | 2 +- docs/content/docs/node/more/examples/notifications.mdx | 2 +- .../content/docs/node/more/examples/predicate-gated-jobs.mdx | 2 +- docs/content/docs/node/more/examples/web-scraper.mdx | 2 +- docs/content/docs/node/more/examples/workflows.mdx | 2 +- docs/content/docs/node/more/meta.json | 5 +++++ 40 files changed, 44 insertions(+), 39 deletions(-) create mode 100644 docs/content/docs/node/more/meta.json diff --git a/docs/content/docs/node/getting-started/capabilities.mdx b/docs/content/docs/node/getting-started/capabilities.mdx index a25793d4..5e2d850e 100644 --- a/docs/content/docs/node/getting-started/capabilities.mdx +++ b/docs/content/docs/node/getting-started/capabilities.mdx @@ -1,5 +1,5 @@ --- -title: Capabilities +title: Capabilities at a glance description: "Everything the Node SDK can do, with a link to each guide." --- diff --git a/docs/content/docs/node/guides/core/execution-model.mdx b/docs/content/docs/node/guides/core/execution-model.mdx index 713e8a51..ec57ecc5 100644 --- a/docs/content/docs/node/guides/core/execution-model.mdx +++ b/docs/content/docs/node/guides/core/execution-model.mdx @@ -1,5 +1,5 @@ --- -title: Execution model +title: Execution Models description: "How the Node worker runs jobs — the event loop, concurrency, and CPU-bound work." --- diff --git a/docs/content/docs/node/guides/core/predicates.mdx b/docs/content/docs/node/guides/core/predicates.mdx index b93beaf9..77a7cbef 100644 --- a/docs/content/docs/node/guides/core/predicates.mdx +++ b/docs/content/docs/node/guides/core/predicates.mdx @@ -1,5 +1,5 @@ --- -title: Predicate gates +title: Predicates description: "Gate enqueues with composable predicates evaluated at submit time." --- diff --git a/docs/content/docs/node/guides/core/queues.mdx b/docs/content/docs/node/guides/core/queues.mdx index 389e13ce..c467a25d 100644 --- a/docs/content/docs/node/guides/core/queues.mdx +++ b/docs/content/docs/node/guides/core/queues.mdx @@ -1,5 +1,5 @@ --- -title: Queues +title: Queues & Priority description: "Route jobs to named queues, set priority, and pause/resume." --- diff --git a/docs/content/docs/node/guides/core/scheduling.mdx b/docs/content/docs/node/guides/core/scheduling.mdx index 15ec121c..3231227f 100644 --- a/docs/content/docs/node/guides/core/scheduling.mdx +++ b/docs/content/docs/node/guides/core/scheduling.mdx @@ -1,5 +1,5 @@ --- -title: Scheduling (cron) +title: Scheduling description: "Register periodic tasks on a cron expression; a worker fires them when due." --- diff --git a/docs/content/docs/node/guides/extensibility/middleware.mdx b/docs/content/docs/node/guides/extensibility/middleware.mdx index f0c59278..bad54c6f 100644 --- a/docs/content/docs/node/guides/extensibility/middleware.mdx +++ b/docs/content/docs/node/guides/extensibility/middleware.mdx @@ -1,5 +1,5 @@ --- -title: Middleware +title: Per-Task Middleware description: "Wrap task execution with before/after/error and outcome hooks." --- diff --git a/docs/content/docs/node/guides/extensibility/serializers.mdx b/docs/content/docs/node/guides/extensibility/serializers.mdx index e6dc2a95..eba847c7 100644 --- a/docs/content/docs/node/guides/extensibility/serializers.mdx +++ b/docs/content/docs/node/guides/extensibility/serializers.mdx @@ -1,5 +1,5 @@ --- -title: Serializers +title: Pluggable Serializers description: "Pluggable arg/result serialization — JSON or msgpack." --- diff --git a/docs/content/docs/node/guides/integrations/express.mdx b/docs/content/docs/node/guides/integrations/express.mdx index b28ca13d..9fe71e13 100644 --- a/docs/content/docs/node/guides/integrations/express.mdx +++ b/docs/content/docs/node/guides/integrations/express.mdx @@ -1,5 +1,5 @@ --- -title: Express +title: Express Integration description: "Mount a REST API and the dashboard into an Express app." --- diff --git a/docs/content/docs/node/guides/integrations/fastify.mdx b/docs/content/docs/node/guides/integrations/fastify.mdx index 4df61a92..c2140a8d 100644 --- a/docs/content/docs/node/guides/integrations/fastify.mdx +++ b/docs/content/docs/node/guides/integrations/fastify.mdx @@ -1,5 +1,5 @@ --- -title: Fastify +title: Fastify Integration description: "Register the REST API and dashboard as Fastify plugins." --- diff --git a/docs/content/docs/node/guides/integrations/nest.mdx b/docs/content/docs/node/guides/integrations/nest.mdx index ef59c125..03d8d3a5 100644 --- a/docs/content/docs/node/guides/integrations/nest.mdx +++ b/docs/content/docs/node/guides/integrations/nest.mdx @@ -1,5 +1,5 @@ --- -title: NestJS +title: NestJS Integration description: "Inject a TaskitoService into your Nest providers." --- diff --git a/docs/content/docs/node/guides/integrations/otel.mdx b/docs/content/docs/node/guides/integrations/otel.mdx index 81d97c97..506f5d38 100644 --- a/docs/content/docs/node/guides/integrations/otel.mdx +++ b/docs/content/docs/node/guides/integrations/otel.mdx @@ -1,5 +1,5 @@ --- -title: OpenTelemetry +title: OpenTelemetry Integration description: "Distributed tracing for Node.js task execution — one span per attempt." --- diff --git a/docs/content/docs/node/guides/integrations/prometheus.mdx b/docs/content/docs/node/guides/integrations/prometheus.mdx index cc8f01f5..cf321c3b 100644 --- a/docs/content/docs/node/guides/integrations/prometheus.mdx +++ b/docs/content/docs/node/guides/integrations/prometheus.mdx @@ -1,5 +1,5 @@ --- -title: Prometheus +title: Prometheus Metrics description: "Execution metrics and polled queue/DLQ depth gauges for Node.js workers." --- diff --git a/docs/content/docs/node/guides/integrations/sentry.mdx b/docs/content/docs/node/guides/integrations/sentry.mdx index 8c68c9d9..4f6eb75e 100644 --- a/docs/content/docs/node/guides/integrations/sentry.mdx +++ b/docs/content/docs/node/guides/integrations/sentry.mdx @@ -1,5 +1,5 @@ --- -title: Sentry +title: Sentry Integration description: "Capture the original exception when a Node.js job dead-letters." --- diff --git a/docs/content/docs/node/guides/observability/logging.mdx b/docs/content/docs/node/guides/observability/logging.mdx index 6b28356c..c5f9e760 100644 --- a/docs/content/docs/node/guides/observability/logging.mdx +++ b/docs/content/docs/node/guides/observability/logging.mdx @@ -1,5 +1,5 @@ --- -title: Logging +title: Structured Task Logging description: "The built-in leveled logger — levels, namespaces, and a pluggable sink." --- diff --git a/docs/content/docs/node/guides/observability/monitoring.mdx b/docs/content/docs/node/guides/observability/monitoring.mdx index 044fcf44..c36ed74b 100644 --- a/docs/content/docs/node/guides/observability/monitoring.mdx +++ b/docs/content/docs/node/guides/observability/monitoring.mdx @@ -1,5 +1,5 @@ --- -title: Monitoring +title: Monitoring & Hooks description: "Queue stats, per-task metrics, job progress, and worker heartbeats." --- diff --git a/docs/content/docs/node/guides/operations/inspection.mdx b/docs/content/docs/node/guides/operations/inspection.mdx index 6547abaf..f2b2b198 100644 --- a/docs/content/docs/node/guides/operations/inspection.mdx +++ b/docs/content/docs/node/guides/operations/inspection.mdx @@ -1,5 +1,5 @@ --- -title: Job management +title: Job Management description: "List and inspect jobs, manage the dead-letter queue, and pause queues." --- diff --git a/docs/content/docs/node/guides/operations/keda.mdx b/docs/content/docs/node/guides/operations/keda.mdx index 1b5de8f0..fdaf2a9f 100644 --- a/docs/content/docs/node/guides/operations/keda.mdx +++ b/docs/content/docs/node/guides/operations/keda.mdx @@ -1,5 +1,5 @@ --- -title: KEDA autoscaling +title: KEDA Autoscaling description: "Scale Node workers on Kubernetes by queue depth via the bundled scaler server." --- diff --git a/docs/content/docs/node/guides/operations/mesh.mdx b/docs/content/docs/node/guides/operations/mesh.mdx index 857d6db8..9851ce78 100644 --- a/docs/content/docs/node/guides/operations/mesh.mdx +++ b/docs/content/docs/node/guides/operations/mesh.mdx @@ -1,5 +1,5 @@ --- -title: Mesh +title: Mesh Scheduling description: "Form a work-stealing overlay so idle workers pull from busy peers." --- diff --git a/docs/content/docs/node/guides/reliability/circuit-breakers.mdx b/docs/content/docs/node/guides/reliability/circuit-breakers.mdx index 84ab45a9..3af22f6a 100644 --- a/docs/content/docs/node/guides/reliability/circuit-breakers.mdx +++ b/docs/content/docs/node/guides/reliability/circuit-breakers.mdx @@ -1,5 +1,5 @@ --- -title: Circuit breakers +title: Circuit Breakers description: "Trip a task after repeated failures to shed load on a failing dependency." --- diff --git a/docs/content/docs/node/guides/reliability/error-handling.mdx b/docs/content/docs/node/guides/reliability/error-handling.mdx index acd86635..f0e35b7b 100644 --- a/docs/content/docs/node/guides/reliability/error-handling.mdx +++ b/docs/content/docs/node/guides/reliability/error-handling.mdx @@ -1,5 +1,5 @@ --- -title: Error handling +title: Error Handling description: "What happens when a task throws — retries, timeouts, and the dead-letter queue." --- diff --git a/docs/content/docs/node/guides/reliability/guarantees.mdx b/docs/content/docs/node/guides/reliability/guarantees.mdx index 69c78081..af3eec43 100644 --- a/docs/content/docs/node/guides/reliability/guarantees.mdx +++ b/docs/content/docs/node/guides/reliability/guarantees.mdx @@ -1,5 +1,5 @@ --- -title: Delivery guarantees +title: Delivery Guarantees description: "At-least-once execution, job claiming, and staying correct under retries." --- diff --git a/docs/content/docs/node/guides/reliability/locks.mdx b/docs/content/docs/node/guides/reliability/locks.mdx index 696c22ac..f76bae65 100644 --- a/docs/content/docs/node/guides/reliability/locks.mdx +++ b/docs/content/docs/node/guides/reliability/locks.mdx @@ -1,5 +1,5 @@ --- -title: Distributed locks +title: Distributed Locking description: "TTL-bounded, owner-scoped locks backed by the queue's storage." --- diff --git a/docs/content/docs/node/guides/reliability/rate-limiting.mdx b/docs/content/docs/node/guides/reliability/rate-limiting.mdx index 7323608a..06f22f15 100644 --- a/docs/content/docs/node/guides/reliability/rate-limiting.mdx +++ b/docs/content/docs/node/guides/reliability/rate-limiting.mdx @@ -1,5 +1,5 @@ --- -title: Rate limiting +title: Rate Limiting description: "Token-bucket limits per task or per queue." --- diff --git a/docs/content/docs/node/guides/resources/dependency-injection.mdx b/docs/content/docs/node/guides/resources/dependency-injection.mdx index a8f45eed..2e88cba4 100644 --- a/docs/content/docs/node/guides/resources/dependency-injection.mdx +++ b/docs/content/docs/node/guides/resources/dependency-injection.mdx @@ -1,5 +1,5 @@ --- -title: Dependency injection +title: Dependency Injection description: "Register external dependencies once and inject them into tasks by scope." --- diff --git a/docs/content/docs/node/guides/resources/index.mdx b/docs/content/docs/node/guides/resources/index.mdx index e9ef28e5..e20e17d9 100644 --- a/docs/content/docs/node/guides/resources/index.mdx +++ b/docs/content/docs/node/guides/resources/index.mdx @@ -1,5 +1,5 @@ --- -title: Resources +title: Resource System description: "Inject external dependencies into tasks and intercept jobs before they enqueue." --- diff --git a/docs/content/docs/node/guides/resources/interception.mdx b/docs/content/docs/node/guides/resources/interception.mdx index 8ed7e884..2d8781ca 100644 --- a/docs/content/docs/node/guides/resources/interception.mdx +++ b/docs/content/docs/node/guides/resources/interception.mdx @@ -1,5 +1,5 @@ --- -title: Enqueue interception +title: Argument Interception description: "Validate, redact, or rewrite jobs before they are serialized." --- diff --git a/docs/content/docs/node/guides/workflows/analysis.mdx b/docs/content/docs/node/guides/workflows/analysis.mdx index efd55253..64a370a7 100644 --- a/docs/content/docs/node/guides/workflows/analysis.mdx +++ b/docs/content/docs/node/guides/workflows/analysis.mdx @@ -1,5 +1,5 @@ --- -title: Analysis +title: Analysis & Visualization description: "Introspect a workflow run's DAG — dependencies, levels, critical path, and stats." --- diff --git a/docs/content/docs/node/guides/workflows/caching.mdx b/docs/content/docs/node/guides/workflows/caching.mdx index 7a9879bf..d47b575e 100644 --- a/docs/content/docs/node/guides/workflows/caching.mdx +++ b/docs/content/docs/node/guides/workflows/caching.mdx @@ -1,5 +1,5 @@ --- -title: Caching +title: Incremental Runs description: "Reuse a workflow step's result across runs — incremental runs with a dirty set." --- diff --git a/docs/content/docs/node/guides/workflows/canvas.mdx b/docs/content/docs/node/guides/workflows/canvas.mdx index 59a53606..edefa42e 100644 --- a/docs/content/docs/node/guides/workflows/canvas.mdx +++ b/docs/content/docs/node/guides/workflows/canvas.mdx @@ -1,5 +1,5 @@ --- -title: Canvas +title: Canvas Primitives description: "Chain, group, and chord shorthands for common workflow shapes." --- diff --git a/docs/content/docs/node/guides/workflows/conditions.mdx b/docs/content/docs/node/guides/workflows/conditions.mdx index fa1b6a75..18b4b74e 100644 --- a/docs/content/docs/node/guides/workflows/conditions.mdx +++ b/docs/content/docs/node/guides/workflows/conditions.mdx @@ -1,5 +1,5 @@ --- -title: Conditions +title: Conditions & Error Handling description: "Run a step only when its predecessors succeeded, failed, or either." --- diff --git a/docs/content/docs/node/guides/workflows/saga.mdx b/docs/content/docs/node/guides/workflows/saga.mdx index 6e09ad05..5bb7eb34 100644 --- a/docs/content/docs/node/guides/workflows/saga.mdx +++ b/docs/content/docs/node/guides/workflows/saga.mdx @@ -1,5 +1,5 @@ --- -title: Saga Compensation +title: Sagas description: "Automatically roll back completed steps in reverse order when a workflow run fails." --- diff --git a/docs/content/docs/node/guides/workflows/sub-workflows.mdx b/docs/content/docs/node/guides/workflows/sub-workflows.mdx index 76953cc8..3af43774 100644 --- a/docs/content/docs/node/guides/workflows/sub-workflows.mdx +++ b/docs/content/docs/node/guides/workflows/sub-workflows.mdx @@ -1,5 +1,5 @@ --- -title: Sub-Workflows +title: Sub-Workflows & Scheduling description: "Compose workflow runs hierarchically — a parent step delegates to a child workflow." --- diff --git a/docs/content/docs/node/more/examples/bulk-emails.mdx b/docs/content/docs/node/more/examples/bulk-emails.mdx index 586ea5f3..7c3434f9 100644 --- a/docs/content/docs/node/more/examples/bulk-emails.mdx +++ b/docs/content/docs/node/more/examples/bulk-emails.mdx @@ -1,5 +1,5 @@ --- -title: Bulk emails +title: Bulk Emails description: "Fan a large recipient list out with enqueueMany, then bound the send rate and concurrency with per-task limits." --- diff --git a/docs/content/docs/node/more/examples/data-pipeline.mdx b/docs/content/docs/node/more/examples/data-pipeline.mdx index fbaad270..b5fbd87e 100644 --- a/docs/content/docs/node/more/examples/data-pipeline.mdx +++ b/docs/content/docs/node/more/examples/data-pipeline.mdx @@ -1,5 +1,5 @@ --- -title: ETL data pipeline +title: ETL Data Pipeline description: "A diamond-shaped extract → transform → load DAG with progress reporting, error inspection, and skip-on-failure cascading." --- diff --git a/docs/content/docs/node/more/examples/express-service.mdx b/docs/content/docs/node/more/examples/express-service.mdx index 13fde123..9f2bd5ee 100644 --- a/docs/content/docs/node/more/examples/express-service.mdx +++ b/docs/content/docs/node/more/examples/express-service.mdx @@ -1,5 +1,5 @@ --- -title: Express image service +title: Express Image Service description: "A REST API that enqueues image jobs, streams progress to the browser over SSE, and cancels work in flight." --- diff --git a/docs/content/docs/node/more/examples/notifications.mdx b/docs/content/docs/node/more/examples/notifications.mdx index 85c40b65..91b05dbd 100644 --- a/docs/content/docs/node/more/examples/notifications.mdx +++ b/docs/content/docs/node/more/examples/notifications.mdx @@ -1,5 +1,5 @@ --- -title: Notification service +title: Notification Service description: "Delayed sends, idempotent enqueues, priority lanes, periodic digests, and batch fan-out for a notification system." --- diff --git a/docs/content/docs/node/more/examples/predicate-gated-jobs.mdx b/docs/content/docs/node/more/examples/predicate-gated-jobs.mdx index 48c84948..869f1b3c 100644 --- a/docs/content/docs/node/more/examples/predicate-gated-jobs.mdx +++ b/docs/content/docs/node/more/examples/predicate-gated-jobs.mdx @@ -1,5 +1,5 @@ --- -title: Predicate-gated jobs +title: Predicate-Gated Jobs description: "Reject enqueues that don't meet a policy at submit time, composing business-hours, feature-flag, and quota predicates." --- diff --git a/docs/content/docs/node/more/examples/web-scraper.mdx b/docs/content/docs/node/more/examples/web-scraper.mdx index 87df09a3..f6922356 100644 --- a/docs/content/docs/node/more/examples/web-scraper.mdx +++ b/docs/content/docs/node/more/examples/web-scraper.mdx @@ -1,5 +1,5 @@ --- -title: Web scraper pipeline +title: Web Scraper Pipeline description: "A polite, rate-limited scraper: retries, named queues, middleware logging, and a fan-in workflow that aggregates results." --- diff --git a/docs/content/docs/node/more/examples/workflows.mdx b/docs/content/docs/node/more/examples/workflows.mdx index dd479c5c..0eda762c 100644 --- a/docs/content/docs/node/more/examples/workflows.mdx +++ b/docs/content/docs/node/more/examples/workflows.mdx @@ -1,5 +1,5 @@ --- -title: DAG workflow examples +title: DAG Workflow Examples description: "Fan-out/fan-in map-reduce, approval gates, error-handling conditions, sub-workflows, caching, and critical-path analysis." --- diff --git a/docs/content/docs/node/more/meta.json b/docs/content/docs/node/more/meta.json new file mode 100644 index 00000000..135f689a --- /dev/null +++ b/docs/content/docs/node/more/meta.json @@ -0,0 +1,5 @@ +{ + "title": "Examples", + "root": true, + "pages": ["examples"] +} From 13124af750998aee7a44af99bc6aed6b04dbb801 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Sun, 21 Jun 2026 16:41:16 +0530 Subject: [PATCH 2/6] fix(docs): auto-play recovery demo on open --- docs/app/components/demos/recovery-demo.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/app/components/demos/recovery-demo.tsx b/docs/app/components/demos/recovery-demo.tsx index c0fcb816..aba26ccc 100644 --- a/docs/app/components/demos/recovery-demo.tsx +++ b/docs/app/components/demos/recovery-demo.tsx @@ -194,6 +194,12 @@ export default function RecoveryDemo(_props: DemoProps) { setPlaying(true); }, [reduced, DUR]); + // Auto-play on open; startPlay() shows the finished frame under reduced motion. + // biome-ignore lint/correctness/useExhaustiveDependencies: run once on mount. + useEffect(() => { + startPlay(); + }, []); + const setFromX = useCallback( (clientX: number) => { const track = trackRef.current; From 73279b49c41b045cba0b0ad6b637895c59ffaa82 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Sun, 21 Jun 2026 16:41:28 +0530 Subject: [PATCH 3/6] feat(docs): prefetch a language's docs on SDK select --- docs/app/hooks/index.ts | 1 + docs/app/hooks/use-prefetch-docs.ts | 15 ++++++ docs/app/lib/prefetch.ts | 71 +++++++++++++++++++++++++++++ docs/app/root.tsx | 2 + 4 files changed, 89 insertions(+) create mode 100644 docs/app/hooks/use-prefetch-docs.ts create mode 100644 docs/app/lib/prefetch.ts diff --git a/docs/app/hooks/index.ts b/docs/app/hooks/index.ts index 73471711..58337da6 100644 --- a/docs/app/hooks/index.ts +++ b/docs/app/hooks/index.ts @@ -1 +1,2 @@ +export { usePrefetchDocs } from "./use-prefetch-docs"; export { type Sdk, useActiveSdk, useSdk } from "./use-sdk"; diff --git a/docs/app/hooks/use-prefetch-docs.ts b/docs/app/hooks/use-prefetch-docs.ts new file mode 100644 index 00000000..920b4cf6 --- /dev/null +++ b/docs/app/hooks/use-prefetch-docs.ts @@ -0,0 +1,15 @@ +import { useEffect } from "react"; +import { prefetchSdkDocs } from "@/lib/prefetch"; +import { useActiveSdk } from "./use-sdk"; + +/** + * Warm the active SDK's docs in the background. Runs on mount and whenever the + * selected language changes (hero tab, sidebar switcher, or a `/node|/python` + * URL), so the first navigation into that SDK's docs is instant. + */ +export function usePrefetchDocs(): void { + const sdk = useActiveSdk(); + useEffect(() => { + prefetchSdkDocs(sdk); + }, [sdk]); +} diff --git a/docs/app/lib/prefetch.ts b/docs/app/lib/prefetch.ts new file mode 100644 index 00000000..3f70d199 --- /dev/null +++ b/docs/app/lib/prefetch.ts @@ -0,0 +1,71 @@ +import { allDocSlugs, getDocLoader } from "./content"; +import type { Sdk } from "./sdk-store"; + +/** SDKs already warmed this session — a toggle back to one is a no-op. */ +const prefetched = new Set(); + +/** Max chunks fetched at once, so a 80-page SDK doesn't saturate the network. */ +const CONCURRENCY = 3; + +/** Run `cb` when the browser is idle; fall back to a microtask-ish delay. */ +function onIdle(cb: () => void): void { + if (typeof window !== "undefined" && "requestIdleCallback" in window) { + window.requestIdleCallback(cb, { timeout: 2000 }); + } else { + setTimeout(cb, 1); + } +} + +interface NetworkInformation { + saveData?: boolean; + effectiveType?: string; +} + +/** Honor the user's data-saver preference and skip slow (2G) connections. */ +function prefetchAllowed(): boolean { + const conn = (navigator as unknown as { connection?: NetworkInformation }) + .connection; + if (!conn) { + return true; + } + if (conn.saveData) { + return false; + } + return conn.effectiveType !== "slow-2g" && conn.effectiveType !== "2g"; +} + +/** + * Warm every doc chunk for `sdk` in the background. Idempotent per SDK; chunked + * across idle callbacks with a small concurrency cap. A no-op during SSR/prerender + * and under Save-Data / 2G. Failed prefetches are ignored — the page still loads + * on demand when actually visited. + */ +export function prefetchSdkDocs(sdk: Sdk): void { + if (typeof window === "undefined" || prefetched.has(sdk)) { + return; + } + if (!prefetchAllowed()) { + return; // not marked prefetched, so a later call can retry if conditions improve + } + prefetched.add(sdk); + + const prefix = `/${sdk}`; + const loaders = allDocSlugs() + .filter((slug) => slug === prefix || slug.startsWith(`${prefix}/`)) + .map(getDocLoader) + .filter((loader): loader is NonNullable => Boolean(loader)); + + let next = 0; + const pump = (): void => { + if (next >= loaders.length) { + return; + } + const loader = loaders[next++]; + loader() + .catch(() => {}) + .finally(() => onIdle(pump)); + }; + for (let lane = 0; lane < CONCURRENCY; lane++) { + onIdle(pump); + } +} diff --git a/docs/app/root.tsx b/docs/app/root.tsx index 62b3495d..85ecef62 100644 --- a/docs/app/root.tsx +++ b/docs/app/root.tsx @@ -6,6 +6,7 @@ import { Scripts, ScrollRestoration, } from "react-router"; +import { usePrefetchDocs } from "@/hooks"; import type { Route } from "./+types/root"; import "./app.css"; @@ -57,6 +58,7 @@ export function Layout({ children }: { children: React.ReactNode }) { } export default function App() { + usePrefetchDocs(); return ; } From ad46356d88ed7893ae41a8781e993c4e6ceb281b Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Sun, 21 Jun 2026 16:42:30 +0530 Subject: [PATCH 4/6] feat(docs): label Node.js tab, add Beta, hide Go/Java --- docs/app/components/landing/hero.tsx | 85 ++++++++-------------------- docs/app/lib/landing-content.ts | 27 +-------- 2 files changed, 25 insertions(+), 87 deletions(-) diff --git a/docs/app/components/landing/hero.tsx b/docs/app/components/landing/hero.tsx index ba0c1863..2ee9026f 100644 --- a/docs/app/components/landing/hero.tsx +++ b/docs/app/components/landing/hero.tsx @@ -3,9 +3,9 @@ import { Link } from "react-router"; import { RawHtml } from "@/components/ui"; import { useSdk } from "@/hooks"; import { highlightPython, highlightTs } from "@/lib/highlight-lite"; -import { HERO_PANES, SOON_PANES, type SoonLang } from "@/lib/landing-content"; +import { HERO_PANES } from "@/lib/landing-content"; -type Lang = "py" | "ts" | "go" | "java"; +type Lang = "py" | "ts"; function CopyButton({ text }: { text: string }) { const [copied, setCopied] = useState(false); @@ -24,31 +24,14 @@ function CopyButton({ text }: { text: string }) { ); } -function SoonBox({ pane }: { pane: SoonLang }) { - return ( -
-
-

{pane.heading}

-

{pane.body}

- github.com/ByteVeda/taskito -
- ); -} - export function Hero() { const { sdk, setSdk } = useSdk(); - // Roadmap langs (go/java) have no SDK — selected locally; py/ts mirror the - // global SDK so the hero tab and the docs sidebar switch stay in sync. - const [soon, setSoon] = useState(null); - const lang: Lang = soon ?? (sdk === "node" ? "ts" : "py"); + // py/ts mirror the global SDK so the hero tab and the docs sidebar switch stay in sync. const isNode = sdk === "node"; - const pane = HERO_PANES.find((p) => p.id === lang); - const codeHtml = pane - ? lang === "ts" - ? highlightTs(pane.code) - : highlightPython(pane.code) - : ""; - const active = pane ?? HERO_PANES[0]; + const lang: Lang = isNode ? "ts" : "py"; + const active = HERO_PANES.find((p) => p.id === lang) ?? HERO_PANES[0]; + const codeHtml = + lang === "ts" ? highlightTs(active.code) : highlightPython(active.code); return (
@@ -106,53 +89,31 @@ export function Hero() { key={p.id} type="button" className={`langtab ${p.id === lang ? "active" : ""}`.trim()} - onClick={() => { - setSoon(null); - setSdk(p.id === "ts" ? "node" : "python"); - }} + onClick={() => setSdk(p.id === "ts" ? "node" : "python")} > {p.label} + {p.id === "ts" ? Beta : null} ))} - {SOON_PANES.map((p) => ( - - ))} - {pane ? : null} +
- {pane ? ( - - ) : ( - p.id === lang) ?? SOON_PANES[0]} - /> - )} +
- {pane ? ( -
-
- {pane.output.map((line) => ( -
- {line.glyph} - {line.text} - {line.value ? {line.value} : null} - {line.timing ? ( - {line.timing} - ) : null} -
- ))} -
+
+
+ {active.output.map((line) => ( +
+ {line.glyph} + {line.text} + {line.value ? {line.value} : null} + {line.timing ? {line.timing} : null} +
+ ))}
- ) : null} +
- Read the TypeScript quickstart → + Read the Node.js quickstart →
diff --git a/docs/app/lib/landing-content.ts b/docs/app/lib/landing-content.ts index d5a15e99..85db336e 100644 --- a/docs/app/lib/landing-content.ts +++ b/docs/app/lib/landing-content.ts @@ -56,7 +56,7 @@ print(job.result()) # → 5`, }, { id: "ts", - label: "TypeScript", + label: "Node.js", filename: "tasks.ts", install: "pnpm add taskito", code: `import { Queue } from "taskito"; @@ -83,30 +83,7 @@ console.log(await queue.result(id)); // → 5`, }, ], docHref: "/node/getting-started/quickstart", - docLabel: "Read the TypeScript quickstart", - }, -]; - -/** Roadmap languages: disabled tab + "coming soon" panel (no fabricated SDK). */ -export interface SoonLang { - id: "go" | "java"; - label: string; - heading: string; - body: string; -} - -export const SOON_PANES: SoonLang[] = [ - { - id: "go", - label: "Go", - heading: "Go client — coming soon", - body: "A native Go client for enqueuing and inspecting taskito jobs is on the roadmap.", - }, - { - id: "java", - label: "Java", - heading: "Java client — coming soon", - body: "A JVM client for enqueuing taskito jobs from Java & Kotlin is planned.", + docLabel: "Read the Node.js quickstart", }, ]; From 473472748017a3c67553f8a68cbe060ac1061a01 Mon Sep 17 00:00:00 2001 From: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com> Date: Sun, 21 Jun 2026 16:43:06 +0530 Subject: [PATCH 5/6] feat(docs): SDK-aware homepage links + use-case deeplinks --- docs/app/components/landing/footer.tsx | 25 +++++++++++++------ .../components/landing/scenario-finder.tsx | 17 ++++++++++++- docs/app/components/landing/sections.tsx | 10 ++++++-- docs/app/lib/landing-content.ts | 6 +++++ docs/app/styles/landing.css | 2 ++ 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/docs/app/components/landing/footer.tsx b/docs/app/components/landing/footer.tsx index ac0e5e3a..84ae03c6 100644 --- a/docs/app/components/landing/footer.tsx +++ b/docs/app/components/landing/footer.tsx @@ -1,22 +1,32 @@ import { Link } from "react-router"; +import { useActiveSdk } from "@/hooks"; -const COLS = [ +type FootLink = { + label: string; + /** When `sdk` is set, this is an SDK-relative path (prefixed with /python|/node). */ + href: string; + external?: boolean; + sdk?: boolean; +}; + +const COLS: { title: string; links: FootLink[] }[] = [ { title: "Docs", links: [ { label: "Getting Started", - href: "/python/getting-started/installation", + href: "getting-started/installation", + sdk: true, }, - { label: "Guides", href: "/python/guides" }, + { label: "Guides", href: "guides", sdk: true }, { label: "Architecture", href: "/architecture" }, - { label: "API Reference", href: "/python/api-reference" }, + { label: "API Reference", href: "api-reference", sdk: true }, ], }, { title: "More", links: [ - { label: "Examples", href: "/python/more/examples" }, + { label: "Examples", href: "more/examples", sdk: true }, { label: "Celery comparison", href: "/resources/comparison" }, { label: "FAQ", href: "/resources/faq" }, { label: "Changelog", href: "/resources/changelog" }, @@ -50,6 +60,7 @@ const COLS = [ ]; export function Footer() { + const sdk = useActiveSdk(); return (