<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dhavalkurkutiya</title>
    <description>The latest articles on DEV Community by Dhavalkurkutiya (@dhavalkurkutiya).</description>
    <link>https://dev.to/dhavalkurkutiya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F477376%2Ff53090e1-4dd7-4e2a-850d-cce74d9c2771.jpg</url>
      <title>DEV Community: Dhavalkurkutiya</title>
      <link>https://dev.to/dhavalkurkutiya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhavalkurkutiya"/>
    <language>en</language>
    <item>
      <title>Material Nova VS Code Theme</title>
      <dc:creator>Dhavalkurkutiya</dc:creator>
      <pubDate>Wed, 20 May 2026 08:16:25 +0000</pubDate>
      <link>https://dev.to/dhavalkurkutiya/material-nova-vs-code-theme-27h3</link>
      <guid>https://dev.to/dhavalkurkutiya/material-nova-vs-code-theme-27h3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6u3wl8a3qxbkzf6vcynb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6u3wl8a3qxbkzf6vcynb.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;meta_title: "Material Nova VS Code Theme: 12-Variant, WCAG AAA Color System for Serious Developers"&lt;br&gt;
meta_description: "Material Nova is a premium VS Code theme with 12 WCAG AAA-compliant variants — OLED Dark, Palenight, Ocean, Deepforest &amp;amp; more. Built to eliminate eye strain and boost code readability. Try it free."&lt;/p&gt;
&lt;h2&gt;
  
  
  reading_time: "~11 min read"
&lt;/h2&gt;
&lt;h1&gt;
  
  
  Why I Stopped Tolerating Bad Themes and Built Material Nova for VS Code
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;After 8+ hours staring at a screen, 73% of developers report chronic eye strain — and your color theme is likely making it worse.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most VS Code themes were designed to &lt;em&gt;look&lt;/em&gt; good in screenshots. Material Nova was engineered to &lt;em&gt;feel&lt;/em&gt; good at 2 AM during a production incident. There's a meaningful difference, and once you experience it, you can't go back.&lt;/p&gt;

&lt;p&gt;This post breaks down exactly what makes Material Nova a technically superior choice — from its WCAG AAA contrast architecture to its semantic token system — and why switching themes isn't a cosmetic decision. It's a performance decision.&lt;/p&gt;


&lt;h2&gt;
  
  
  What Is the Material Nova VS Code Theme?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Material Nova&lt;/strong&gt; is a premium Visual Studio Code color theme package built on Google's Material Design color system. It ships with &lt;strong&gt;12 carefully engineered variants&lt;/strong&gt;, each targeting a distinct lighting condition, display type, or developer preference.&lt;/p&gt;

&lt;p&gt;The package is not a port or a reskin of an existing theme. Every color value, contrast ratio, and semantic token assignment was hand-tuned from scratch — in JSON, no tooling abstractions — with one constraint above all others: &lt;em&gt;zero cognitive fatigue&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It's available on the &lt;a href="https://marketplace.visualstudio.com/items?itemName=dhavalkurkutiya.vsc-material-nova" rel="noopener noreferrer"&gt;VS Code Marketplace&lt;/a&gt; and the source lives at &lt;a href="https://github.com/Dhavalkurkutiya/material-nova" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;[INTERNAL LINK: VS Code productivity setup guide]&lt;/p&gt;


&lt;h2&gt;
  
  
  The Problem With Most Developer Themes
&lt;/h2&gt;

&lt;p&gt;Before understanding what Material Nova does differently, it helps to understand what the alternatives get wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One Dark Pro&lt;/strong&gt; is the most downloaded theme in the Marketplace. It has beautiful aesthetics. But its string-to-keyword contrast delta is narrow — on lower-gamma displays, variables and function names blur together. Your brain compensates. Over hours, that compensation becomes fatigue.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Community Material Theme&lt;/strong&gt; has been the go-to Google Material port for years. But it ships a single-dark-mode mindset into a world where developers work in sunny offices, tinted monitors, and ultra-bright MacBook displays. One background doesn't scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tokyo Night&lt;/strong&gt; leans heavily purple. Gorgeous at first. But purple-dominant palettes suppress melatonin inconsistently across monitor color profiles. On wide-gamut panels (P3), it oversaturates.&lt;/p&gt;

&lt;p&gt;The pattern: themes optimized for aesthetics, not ergonomics. Material Nova inverts that priority.&lt;/p&gt;


&lt;h2&gt;
  
  
  12 Variants, One Architectural Decision
&lt;/h2&gt;

&lt;p&gt;Here's the full variant matrix with the technical reasoning behind each:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variant&lt;/th&gt;
&lt;th&gt;Background&lt;/th&gt;
&lt;th&gt;Primary Use Case&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Default&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#263238&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Classic Material baseline — balanced gray-green, ideal for 6500K monitors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Darker&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#212121&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Matte near-black for distraction-free deep work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Palenight&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#292D3E&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Violet-shifted cosmic palette, AMOLED-friendly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ocean&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#0F111A&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deep navy, maximizes perceived contrast on IPS panels&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deepforest&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#141F1D&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Organic green-black, clinically the most eye-relaxing hue range&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lighter&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FAFAFA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;True light mode, calibrated for high-ambient environments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Default HC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#000000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;High Contrast companion — pure black for accessibility compliance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Darker HC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#000000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Maximum contrast ratio baseline for visually impaired users&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Palenight HC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#000000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;HC variant with violet accent system intact&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Ocean HC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#000000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;HC variant with full blue-range semantic tokens&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deepforest HC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#000000&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;HC variant retaining full green token assignments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lighter HC&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FFFFFF&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;High Contrast light — meets WCAG AAA on every token&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every dark variant ships with a &lt;strong&gt;High Contrast (HC)&lt;/strong&gt; twin. This isn't a marketing checkbox. The HC variants are built for developers with color vision deficiency, users on low-quality TN panels, and anyone running VS Code through a remote desktop connection where gamma shifts unpredictably.&lt;/p&gt;

&lt;p&gt;[EXTERNAL LINK: WCAG 2.1 Contrast Guidelines — W3C]&lt;/p&gt;


&lt;h2&gt;
  
  
  WCAG AAA Compliance: What It Actually Means in a Code Editor
&lt;/h2&gt;

&lt;p&gt;WCAG AAA requires a &lt;strong&gt;contrast ratio of 7:1&lt;/strong&gt; between foreground text and background. Most themes hit WCAG AA (4.5:1) at best. Material Nova hits AAA across all critical token categories.&lt;/p&gt;

&lt;p&gt;Here's what that means in practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keywords&lt;/strong&gt; (&lt;code&gt;if&lt;/code&gt;, &lt;code&gt;for&lt;/code&gt;, &lt;code&gt;return&lt;/code&gt;) must be immediately distinguishable from &lt;strong&gt;identifiers&lt;/strong&gt; (variable names, function names) at a glance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;String literals&lt;/strong&gt; must pop against background without requiring the eye to refocus&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comments&lt;/strong&gt; need to be readable but recessive — low enough not to compete with active code, high enough to scan when needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error and warning markers&lt;/strong&gt; must cut through the syntax color layer without creating visual alarm fatigue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Achieving all four simultaneously is a constraint satisfaction problem. Raise keyword contrast too high, it competes with operators. Push comment saturation too low, it disappears on gamma-shifted displays.&lt;/p&gt;

&lt;p&gt;The Material Nova color assignments were validated against a WCAG AAA checker on every variant before release. Not spot-checked — &lt;em&gt;every token pair&lt;/em&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Semantic Syntax Highlighting: Precision That Standard Themes Skip
&lt;/h2&gt;

&lt;p&gt;VS Code supports two highlighting layers: &lt;strong&gt;TextMate grammar scopes&lt;/strong&gt; (legacy) and &lt;strong&gt;Semantic tokens&lt;/strong&gt; (modern, language-server-powered). Most themes configure TextMate and call it done.&lt;/p&gt;

&lt;p&gt;Material Nova configures both — and its semantic token rules are the technical differentiator.&lt;/p&gt;
&lt;h3&gt;
  
  
  What Semantic Tokens Enable
&lt;/h3&gt;

&lt;p&gt;When your language server (TypeScript, Pylance, rust-analyzer, etc.) emits semantic tokens, VS Code knows the &lt;em&gt;meaning&lt;/em&gt; of a token, not just its syntactic category. This enables distinctions that TextMate can't make:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;string&lt;/code&gt; in a template literal vs. a &lt;code&gt;string&lt;/code&gt; used as a dictionary key&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;variable&lt;/code&gt; that is a &lt;code&gt;readonly&lt;/code&gt; class property vs. a mutable local&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;function&lt;/code&gt; that is &lt;code&gt;async&lt;/code&gt; vs. synchronous&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;parameter&lt;/code&gt; that is destructured vs. passed directly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Standard themes collapse these into single color assignments. Material Nova assigns distinct visual weights so that code structure is readable without running the logic mentally.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;TypeScript/TSX and React&lt;/strong&gt;, this matters enormously. A codebase with hooks, HOCs, generics, and conditional types becomes a visual tangle in most themes. Material Nova's semantic rules surface the structural hierarchy before your eyes process the identifiers.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;Python&lt;/strong&gt;, class decorators, f-string interpolations, and type annotation tokens are individually scoped — so &lt;code&gt;@dataclass&lt;/code&gt; doesn't look like &lt;code&gt;@property&lt;/code&gt; which doesn't look like &lt;code&gt;@pytest.fixture&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;C#&lt;/strong&gt;, the distinction between &lt;code&gt;interface&lt;/code&gt;, &lt;code&gt;class&lt;/code&gt;, &lt;code&gt;struct&lt;/code&gt;, and &lt;code&gt;enum&lt;/code&gt; declarations is visually encoded, not just syntactically named.&lt;/p&gt;


&lt;h2&gt;
  
  
  Performance Architecture: Why Zero-Overhead Matters
&lt;/h2&gt;

&lt;p&gt;Theme performance is rarely discussed because most developers assume themes are inert. They're not.&lt;/p&gt;

&lt;p&gt;Several popular themes use JavaScript-based extensions alongside their color definitions — loading background images, rendering gradient overlays, or injecting CSS into the workbench. These add latency to editor startup, increase memory footprint, and occasionally cause flicker on window focus.&lt;/p&gt;

&lt;p&gt;Material Nova is &lt;strong&gt;pure JSON&lt;/strong&gt;. No extension activation events. No background scripts. No dynamic recalculation.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.json&lt;/code&gt; declaration is loaded once at editor startup into VS Code's internal color registry. After that, it consumes zero CPU cycles. On low-powered machines (older MacBooks, Linux dev boxes, Raspberry Pi 400s running remote VS Code), this difference is measurable.&lt;/p&gt;

&lt;p&gt;Startup benchmark comparison (anecdotal, M1 MacBook Air):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Theme&lt;/th&gt;
&lt;th&gt;Extension Type&lt;/th&gt;
&lt;th&gt;Avg Activation Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One Dark Pro&lt;/td&gt;
&lt;td&gt;Pure JSON&lt;/td&gt;
&lt;td&gt;~0ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dracula Official&lt;/td&gt;
&lt;td&gt;Pure JSON&lt;/td&gt;
&lt;td&gt;~0ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Peacock (theme + extension)&lt;/td&gt;
&lt;td&gt;JS + JSON&lt;/td&gt;
&lt;td&gt;~80-120ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Material Nova&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pure JSON&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~0ms&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Zero overhead isn't a boast — it's a consequence of deliberate architecture choices.&lt;/p&gt;


&lt;h2&gt;
  
  
  Recommended Configuration for Maximum Visual Fidelity
&lt;/h2&gt;

&lt;p&gt;The theme performs well with VS Code defaults. But to unlock its full rendering quality, the following &lt;code&gt;settings.json&lt;/code&gt; block pairs typography with the color system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"editor.fontFamily"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"JetBrains Mono, Fira Code, monospace"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"editor.fontSize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"editor.lineHeight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;1.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"editor.letterSpacing"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"editor.fontLigatures"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"editor.cursorBlinking"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"smooth"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"editor.cursorSmoothCaretAnimation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"on"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why Each Setting Matters
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;JetBrains Mono&lt;/code&gt; as primary font&lt;/strong&gt; — its x-height and stem weight are calibrated for code legibility at 14px. Its ligatures (&lt;code&gt;!=&lt;/code&gt;, &lt;code&gt;=&amp;gt;&lt;/code&gt;, &lt;code&gt;===&lt;/code&gt;) reduce token-level visual noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;lineHeight: 1.6&lt;/code&gt;&lt;/strong&gt; — tighter than default on many setups, but creates enough vertical rhythm that the eye tracks lines without hunting. Below 1.5 collapses lines on dense code blocks. Above 1.7 introduces excessive whitespace that breaks code chunking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;letterSpacing: 0.5&lt;/code&gt;&lt;/strong&gt; — adds half-pixel breathing room between characters. On retina displays this is imperceptible. On 1080p displays it prevents character collision in condensed fonts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;fontLigatures: true&lt;/code&gt;&lt;/strong&gt; — renders multi-character operators as unified glyphs. Reduces operator scan time in dense TypeScript or arrow-heavy functional code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;cursorSmoothCaretAnimation: "on"&lt;/code&gt;&lt;/strong&gt; — prevents the hard-cut cursor jump that creates visual micro-interruptions during fast typing. Smoother animation reduces cognitive interruption when switching focus to the cursor position.&lt;/p&gt;

&lt;p&gt;This configuration was tuned on the Default and Ocean variants, but applies well across the full palette.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Install Material Nova
&lt;/h2&gt;

&lt;p&gt;Installation takes under 30 seconds:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 1 — Marketplace UI:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open VS Code&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl+Shift+X&lt;/code&gt; (or &lt;code&gt;Cmd+Shift+X&lt;/code&gt; on macOS)&lt;/li&gt;
&lt;li&gt;Search &lt;code&gt;Material Nova&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Install&lt;/strong&gt; on the &lt;code&gt;dhavalkurkutiya.vsc-material-nova&lt;/code&gt; package&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl+K Ctrl+T&lt;/code&gt; → Select your preferred variant&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Option 2 — Command Palette:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ext install dhavalkurkutiya.vsc-material-nova
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option 3 — CLI:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nt"&gt;--install-extension&lt;/span&gt; dhavalkurkutiya.vsc-material-nova
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installing, open the theme picker with &lt;code&gt;Ctrl+K Ctrl+T&lt;/code&gt; and filter by "Material Nova" to see all 12 variants. Spend 5 minutes with Ocean or Deepforest before deciding — first impressions of dark themes are heavily influenced by your previous theme's color memory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Variant Selection Guide: Match Your Environment
&lt;/h2&gt;

&lt;p&gt;Choosing the right variant isn't aesthetic preference — it's environmental optimization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Late night, dark room:&lt;/strong&gt; Start with &lt;strong&gt;Ocean&lt;/strong&gt; (&lt;code&gt;#0F111A&lt;/code&gt;). The deep navy absorbs ambient light without the hard contrast shock of pure OLED-black themes. If you're on an OLED display (Samsung, LG WOLED, MacBook Pro XDR), try &lt;strong&gt;Palenight&lt;/strong&gt; — its violet tones work with AMOLED subpixel geometry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Daytime, bright office:&lt;/strong&gt; &lt;strong&gt;Lighter&lt;/strong&gt; is the only sane choice. Dark themes in daylight cause your pupils to dilate trying to process the dark background against a bright room. High ambient light environments need high-key backgrounds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mixed / variable lighting:&lt;/strong&gt; &lt;strong&gt;Default&lt;/strong&gt; (&lt;code&gt;#263238&lt;/code&gt;) is the most neutral choice across lighting conditions. The gray-green background sits at the perceptual midpoint between warm office light and cool monitor backlight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessibility requirement:&lt;/strong&gt; Any &lt;strong&gt;HC&lt;/strong&gt; variant. If you're building for a shared development machine, a remote desktop environment, or working with developers who have color vision deficiency, the HC variants maintain full token semantics at maximum contrast.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does Material Nova support Semantic Highlighting for all major languages?
&lt;/h3&gt;

&lt;p&gt;Material Nova configures semantic token rules for TypeScript, JavaScript, TSX, JSX, Python, C#, HTML, and CSS out of the box. For languages not in this list (Rust, Go, Kotlin), VS Code's fallback to TextMate grammar scopes is fully supported — the base palette provides valid contrast on all token categories. Rust and Go support is on the active roadmap via rust-analyzer and gopls semantic token mapping.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is there a performance difference between the 12 variants?
&lt;/h3&gt;

&lt;p&gt;No. All 12 variants are static JSON declarations of identical structure. VS Code loads the active theme once at startup — there is no per-variant performance delta. The only measurable difference is load time on first theme switch, which triggers a workbench color re-render. This is a VS Code engine operation, not a theme operation, and completes in under 200ms regardless of variant.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A theme is not decoration. For a developer spending 8-12 hours a day in an editor, the color architecture of your environment is a cognitive infrastructure decision.&lt;/p&gt;

&lt;p&gt;Material Nova was built to solve a real problem: themes that look great in screenshots but create visual fatigue, semantic ambiguity, and accessibility gaps in daily use. Its 12-variant system, WCAG AAA compliance, semantic token precision, and zero-overhead architecture are not feature bullet points — they're the result of specific, validated engineering decisions.&lt;/p&gt;

&lt;p&gt;If you're still on a theme you installed three years ago because switching felt like unnecessary friction, that friction has a cost. It accumulates across every hour of every day you spend writing code.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;→ &lt;a href="https://marketplace.visualstudio.com/items?itemName=dhavalkurkutiya.vsc-material-nova" rel="noopener noreferrer"&gt;Install Material Nova on the VS Code Marketplace&lt;/a&gt; and try the Ocean or Deepforest variant for one full workday. If your eyes don't thank you, the uninstall takes one click.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Star the repo on &lt;a href="https://github.com/Dhavalkurkutiya/material-nova" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; to follow updates, new variants, and language server integrations.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>vscode</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Why I Handcrafted "Material Nova" — The Ultimate, Eye-Friendly VS Code Theme</title>
      <dc:creator>Dhavalkurkutiya</dc:creator>
      <pubDate>Wed, 20 May 2026 08:08:39 +0000</pubDate>
      <link>https://dev.to/dhavalkurkutiya/why-i-handcrafted-material-nova-the-ultimate-eye-friendly-vs-code-theme-pd6</link>
      <guid>https://dev.to/dhavalkurkutiya/why-i-handcrafted-material-nova-the-ultimate-eye-friendly-vs-code-theme-pd6</guid>
      <description>&lt;p&gt;Let's be honest. As software engineers, our code editor is where we spend &lt;strong&gt;90% of our waking hours&lt;/strong&gt;. We push pixels, debug tricky production errors, and write thousands of lines of code daily.&lt;/p&gt;

&lt;p&gt;Yet, so many of us struggle with &lt;strong&gt;severe eye strain, visual fatigue, and headaches&lt;/strong&gt; because our theme's contrast is either too aggressive, or completely washed out.&lt;/p&gt;

&lt;p&gt;After jumping between &lt;em&gt;One Dark Pro&lt;/em&gt;, &lt;em&gt;Community Material Theme&lt;/em&gt;, and &lt;em&gt;Tokyo Night&lt;/em&gt; for years, I decided enough was enough. I needed a theme that didn't just look stunning, but was also carefully calibrated for &lt;strong&gt;absolute developer comfort and accessibility&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So, I built &lt;strong&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=dhavalkurkutiya.vsc-material-nova" rel="noopener noreferrer"&gt;Material Nova&lt;/a&gt;&lt;/strong&gt;. 🎉&lt;/p&gt;




&lt;h2&gt;
  
  
  🎨 What is Material Nova?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Material Nova&lt;/strong&gt; is a premium color theme for Visual Studio Code, meticulously engineered around Google's legendary Material Design color palette.&lt;/p&gt;

&lt;p&gt;Unlike other theme packages that only give you a single dark layout, Material Nova comes fully loaded with &lt;strong&gt;12 distinct, premium variations&lt;/strong&gt; designed to adapt to any lighting environment — from pitch-black late-night coding to bright sunny outdoor workspaces.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2Fwhbh8Swz%2Flogo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2Fwhbh8Swz%2Flogo.png" alt="Material Nova Logo" width="225" height="225"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 The 12-Variant Palette Breakdown
&lt;/h2&gt;

&lt;p&gt;Here is a quick look at the carefully engineered environments included in the package:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Theme Variant&lt;/th&gt;
&lt;th&gt;Background&lt;/th&gt;
&lt;th&gt;Ideal For&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🌌 &lt;strong&gt;Default&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#263238&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The timeless, classic Google Material design interface.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🖤 &lt;strong&gt;Darker&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#212121&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Distraction-free, matte-gray elegance.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔮 &lt;strong&gt;Palenight&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#292D3E&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A gorgeous synthwave, violet-blue cosmic space.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🌊 &lt;strong&gt;Ocean&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#0F111A&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A calming, deep-sea marine navy environment.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🌲 &lt;strong&gt;Deepforest&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#141F1D&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;An organic green aesthetic that instantly relaxes the eyes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;☀️ &lt;strong&gt;Lighter&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#FAFAFA&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A crisp, ultra-clean light mode for bright, sunny office rooms.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
  Every dark theme variant includes a companion &lt;strong&gt;"High Contrast" (HC)&lt;/strong&gt; edition — featuring pure pitch-black backgrounds and sharp, high-visibility borders for maximum legibility.&lt;br&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  🔥 Why Make the Switch to Material Nova?
&lt;/h2&gt;

&lt;p&gt;Here is what makes this theme package stand out from the crowd:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Zero Cognitive Fatigue (WCAG AAA Compliant)
&lt;/h3&gt;

&lt;p&gt;We spent weeks tuning color pairings. The contrast ratios are strictly optimized to make variables, strings, brackets, and keywords immediately recognizable — without being overly bright.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Tailored Semantic Highlighting
&lt;/h3&gt;

&lt;p&gt;Whether you are writing &lt;strong&gt;React (TSX/JSX), TypeScript, JavaScript, Python, C#, HTML, or CSS&lt;/strong&gt;, the semantic syntax highlighting is incredibly precise. Different data types and syntax scopes have custom-assigned rules that standard themes simply group together.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Lightweight &amp;amp; Lightning Fast
&lt;/h3&gt;

&lt;p&gt;No background scripts, no dynamic theme loading delays, and zero overhead. Material Nova consists of pure, hand-coded JSON declarations — which means your editor loads and responds instantaneously.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ How to Make it Look Premium
&lt;/h2&gt;

&lt;p&gt;To get the absolute best visual experience out of Material Nova, open your &lt;code&gt;settings.json&lt;/code&gt; in VS Code and paste this recommended configuration:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```json title="settings.json"&lt;br&gt;
{&lt;br&gt;
  "editor.fontFamily": "JetBrains Mono, Fira Code, monospace",&lt;br&gt;
  "editor.fontSize": 14,&lt;br&gt;
  "editor.lineHeight": 1.6,&lt;br&gt;
  "editor.letterSpacing": 0.5,&lt;br&gt;
  "editor.fontLigatures": true,&lt;br&gt;
  "editor.cursorBlinking": "smooth",&lt;br&gt;
  "editor.cursorSmoothCaretAnimation": "on"&lt;br&gt;
}&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


&amp;lt;Callout type="info"&amp;gt;
  For the best font rendering, install [JetBrains Mono](https://www.jetbrains.com/lp/mono/) — it's free, open-source, and designed specifically for developers.
&amp;lt;/Callout&amp;gt;

---

## 📦 Installation

Install Material Nova directly from the VS Code Marketplace in seconds:



```bash
# Via VS Code Quick Open (Ctrl+P / Cmd+P)
ext install dhavalkurkutiya.vsc-material-nova
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or search &lt;strong&gt;"Material Nova"&lt;/strong&gt; in the Extensions panel (&lt;code&gt;Ctrl+Shift+X&lt;/code&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  🔗 Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=dhavalkurkutiya.vsc-material-nova" rel="noopener noreferrer"&gt;VS Code Marketplace&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Dhavalkurkutiya/material-nova" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Dhavalkurkutiya/material-nova/issues" rel="noopener noreferrer"&gt;Report an Issue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vscode</category>
      <category>programming</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Stop manually setting up tRPC in Next.js — use this CLI instead</title>
      <dc:creator>Dhavalkurkutiya</dc:creator>
      <pubDate>Sun, 08 Mar 2026 05:42:14 +0000</pubDate>
      <link>https://dev.to/dhavalkurkutiya/stop-manually-setting-up-trpc-in-nextjs-use-this-cli-instead-203i</link>
      <guid>https://dev.to/dhavalkurkutiya/stop-manually-setting-up-trpc-in-nextjs-use-this-cli-instead-203i</guid>
      <description>&lt;p&gt;Stop manually setting up tRPC in Next.js — use this CLI instead&lt;/p&gt;

&lt;p&gt;Every time I start a new Next.js project with tRPC, I do the same thing.&lt;/p&gt;

&lt;p&gt;Open docs. Copy files. Install packages. Forget to wrap &lt;code&gt;layout.tsx&lt;/code&gt;. Get the QueryClient error. Fix it. Repeat next project.&lt;/p&gt;

&lt;p&gt;I got tired of it. So I built a CLI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-trpc-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Setting up tRPC v11 with Next.js App Router is not hard — but it's &lt;strong&gt;tedious&lt;/strong&gt;. Every project needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install &lt;code&gt;@trpc/server&lt;/code&gt;, &lt;code&gt;@trpc/client&lt;/code&gt;, &lt;code&gt;@trpc/tanstack-react-query&lt;/code&gt;, &lt;code&gt;@tanstack/react-query&lt;/code&gt;, &lt;code&gt;zod&lt;/code&gt;, &lt;code&gt;server-only&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/init.ts&lt;/code&gt; with context and procedures&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/query-client.ts&lt;/code&gt; with SSR-safe QueryClient&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/client.tsx&lt;/code&gt; with TRPCReactProvider&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/server.tsx&lt;/code&gt; with HydrateClient and prefetch&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;app/api/trpc/[trpc]/route.ts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Manually update &lt;code&gt;layout.tsx&lt;/code&gt; to wrap &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; with TRPCReactProvider&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Miss any step → error. Every. Single. Project.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-trpc-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run this inside &lt;strong&gt;any existing&lt;/strong&gt; Next.js project. Everything happens automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What gets auto-detected:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Package manager — npm, pnpm, yarn, or bun&lt;/li&gt;
&lt;li&gt;Path alias — reads &lt;code&gt;tsconfig.json&lt;/code&gt; for &lt;code&gt;@/*&lt;/code&gt;, &lt;code&gt;~/*&lt;/code&gt;, or any custom alias&lt;/li&gt;
&lt;li&gt;Auth provider — detects Clerk or NextAuth, configures context automatically&lt;/li&gt;
&lt;li&gt;Folder structure — &lt;code&gt;src/&lt;/code&gt; or root layout&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Files Generated
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;trpc/
├── init.ts              ← context, baseProcedure, protectedProcedure, Zod error formatter
├── query-client.ts      ← SSR-safe QueryClient
├── client.tsx           ← TRPCReactProvider + useTRPC hook
├── server.tsx           ← prefetch, HydrateClient
└── routers/
    └── _app.ts          ← starter router with health + greet (Zod validation)

app/api/trpc/[trpc]/
└── route.ts             ← API handler with real headers + dev error logging

app/trpc-status/         ← styled test page (delete after confirming ✅)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  layout.tsx — auto-patched
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Toaster&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TRPCReactProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Toaster&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;TRPCReactProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No backup files. No extra clutter. Just the import added + body wrapped.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Not create-t3-app?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;create-t3-app&lt;/code&gt; is great — but it only works for &lt;strong&gt;new projects&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;create-trpc-setup&lt;/code&gt; works with projects you've &lt;strong&gt;already started&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;create-t3-app&lt;/th&gt;
&lt;th&gt;create-trpc-setup&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;New projects&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Existing projects&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Auto-patches layout.tsx&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Clerk / NextAuth detection&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tsconfig path alias detection&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tRPC v11 + RSC ready&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Using tRPC After Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Server Component — prefetch data:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/page.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefetch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;trpc&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/trpc/server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;MyClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./my-client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;prefetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;trpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryOptions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MyClient&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Client Component — use data:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// my-client.tsx&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useSuspenseQuery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@tanstack/react-query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useTRPC&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/trpc/client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;trpc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTRPC&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSuspenseQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;trpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryOptions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  protectedProcedure — Already Included
&lt;/h2&gt;

&lt;p&gt;The generated &lt;code&gt;init.ts&lt;/code&gt; includes a &lt;code&gt;protectedProcedure&lt;/code&gt; that automatically throws &lt;code&gt;UNAUTHORIZED&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;protectedProcedure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;procedure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TRPCError&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;UNAUTHORIZED&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Sign in required&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use it directly in any router:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;getProfile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;protectedProcedure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// guaranteed non-null ✅&lt;/span&gt;
&lt;span class="p"&gt;}),&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Zod Error Formatter — Also Included
&lt;/h2&gt;

&lt;p&gt;Clean field-level errors on the client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;zodError&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;fieldErrors&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="c1"&gt;// ["Title is required"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-trpc-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;📦 npm: &lt;a href="https://www.npmjs.com/package/create-trpc-setup" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/create-trpc-setup&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🐙 GitHub: &lt;a href="https://github.com/Dhavalkurkutiya/create-trpc-setup" rel="noopener noreferrer"&gt;https://github.com/Dhavalkurkutiya/create-trpc-setup&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If this saved you time, drop a ⭐ on GitHub — it helps others find it!&lt;/p&gt;




</description>
    </item>
    <item>
      <title>Stop manually setting up tRPC in Next.js — use this CLI instead</title>
      <dc:creator>Dhavalkurkutiya</dc:creator>
      <pubDate>Sat, 07 Mar 2026 06:28:23 +0000</pubDate>
      <link>https://dev.to/dhavalkurkutiya/stop-manually-setting-up-trpc-in-nextjs-use-this-cli-instead-10pj</link>
      <guid>https://dev.to/dhavalkurkutiya/stop-manually-setting-up-trpc-in-nextjs-use-this-cli-instead-10pj</guid>
      <description>&lt;p&gt;Every time I start a new Next.js project with tRPC, I do the same thing.&lt;/p&gt;

&lt;p&gt;Open docs. Copy files. Install packages. Forget to wrap layout.tsx. Get the QueryClient error. Fix it. Repeat next project.&lt;/p&gt;

&lt;p&gt;I got tired of it. So I built a CLI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-trpc-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Setting up tRPC v11 with Next.js App Router is not hard — but it's tedious. You need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;code&gt;@trpc/server&lt;/code&gt;, &lt;code&gt;@trpc/client&lt;/code&gt;, &lt;code&gt;@trpc/tanstack-react-query&lt;/code&gt;, &lt;code&gt;@tanstack/react-query&lt;/code&gt;, &lt;code&gt;zod&lt;/code&gt;, &lt;code&gt;server-only&lt;/code&gt;...&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/init.ts&lt;/code&gt; with context and procedures&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/query-client.ts&lt;/code&gt; with SSR-safe QueryClient&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/client.tsx&lt;/code&gt; with TRPCReactProvider&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/server.tsx&lt;/code&gt; with HydrateClient and prefetch&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;app/api/trpc/[trpc]/route.ts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Update &lt;code&gt;layout.tsx&lt;/code&gt; to wrap children with TRPCReactProvider&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Miss any step → error. Every new project.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-trpc-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run this inside any existing Next.js project. Everything happens automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  What gets detected automatically:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Package manager&lt;/strong&gt; — npm, pnpm, yarn, or bun&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Path alias&lt;/strong&gt; — reads &lt;code&gt;tsconfig.json&lt;/code&gt; for &lt;code&gt;@/*&lt;/code&gt;, &lt;code&gt;~/*&lt;/code&gt;, or any custom alias&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auth provider&lt;/strong&gt; — detects Clerk or NextAuth and configures context&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Folder structure&lt;/strong&gt; — &lt;code&gt;src/&lt;/code&gt; or root layout&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What gets generated:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;trpc/
├── init.ts         ← context, baseProcedure, protectedProcedure, Zod error formatter
├── query-client.ts ← SSR-safe QueryClient
├── client.tsx      ← TRPCReactProvider + useTRPC hook
├── server.tsx      ← prefetch, HydrateClient, caller
└── routers/
    └── _app.ts     ← health + greet procedures with Zod

app/api/trpc/[trpc]/route.ts   ← API handler with real headers
app/trpc-status/               ← test page (delete after confirming)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  layout.tsx — auto-patched:
&lt;/h3&gt;

&lt;p&gt;Before:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Toaster&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TRPCReactProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Toaster&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;TRPCReactProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using tRPC After Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Server Component — prefetch data:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app/page.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefetch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;trpc&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/trpc/server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;MyClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./my-client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;prefetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;trpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryOptions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MyClient&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Client Component — use data:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// my-client.tsx&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useSuspenseQuery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@tanstack/react-query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useTRPC&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/trpc/client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;trpc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTRPC&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSuspenseQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;trpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryOptions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why Not create-t3-app?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;create-t3-app&lt;/code&gt; is great — but it only works for &lt;strong&gt;new projects&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;create-trpc-setup&lt;/code&gt; works with &lt;strong&gt;existing projects&lt;/strong&gt;. Already have a Next.js app with Clerk, Shadcn, and custom providers? No problem. Run the command, everything gets added without touching your existing code.&lt;/p&gt;

&lt;h2&gt;
  
  
  protectedProcedure — Already Included
&lt;/h2&gt;

&lt;p&gt;The generated &lt;code&gt;init.ts&lt;/code&gt; includes a &lt;code&gt;protectedProcedure&lt;/code&gt; that automatically throws &lt;code&gt;UNAUTHORIZED&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;protectedProcedure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;procedure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TRPCError&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;UNAUTHORIZED&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use it in any router:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;getProfile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;protectedProcedure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// guaranteed non-null&lt;/span&gt;
&lt;span class="p"&gt;}),&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-trpc-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;📦 npm: &lt;a href="https://npmjs.com/package/create-trpc-setup" rel="noopener noreferrer"&gt;npmjs.com/package/create-trpc-setup&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🐙 GitHub: &lt;a href="https://github.com/Dhavalkurkutiya/create-trpc-setup" rel="noopener noreferrer"&gt;github.com/Dhavalkurkutiya/create-trpc-setup&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it saved you time, drop a ⭐ on GitHub and share it with your team.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>trpc</category>
      <category>typescript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Setting up tRPC v11 in Next.js Now Takes Just One Command</title>
      <dc:creator>Dhavalkurkutiya</dc:creator>
      <pubDate>Wed, 04 Mar 2026 08:54:45 +0000</pubDate>
      <link>https://dev.to/dhavalkurkutiya/i-built-a-cli-that-sets-up-trpc-v11-in-nextjs-with-one-command-n62</link>
      <guid>https://dev.to/dhavalkurkutiya/i-built-a-cli-that-sets-up-trpc-v11-in-nextjs-with-one-command-n62</guid>
      <description>&lt;p&gt;I Built a CLI That Sets Up tRPC v11 in Next.js With One Command&lt;/p&gt;

&lt;p&gt;Every time I started a new Next.js project with tRPC, I found myself doing the same thing — copying the same 6 files, installing the same packages, wrapping layout.tsx with the same provider.&lt;/p&gt;

&lt;p&gt;So I automated it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Setting up tRPC v11 with Next.js App Router is not hard — but it's tedious. You need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install &lt;code&gt;@trpc/server&lt;/code&gt;, &lt;code&gt;@trpc/client&lt;/code&gt;, &lt;code&gt;@trpc/tanstack-react-query&lt;/code&gt;, &lt;code&gt;@tanstack/react-query&lt;/code&gt;, &lt;code&gt;zod&lt;/code&gt;, &lt;code&gt;superjson&lt;/code&gt;, &lt;code&gt;server-only&lt;/code&gt;...&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/init.ts&lt;/code&gt; with the right context&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/query-client.ts&lt;/code&gt; with SSR-safe QueryClient&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/client.tsx&lt;/code&gt; with &lt;code&gt;TRPCReactProvider&lt;/code&gt; and &lt;code&gt;useTRPC&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;trpc/server.tsx&lt;/code&gt; with &lt;code&gt;HydrateClient&lt;/code&gt;, &lt;code&gt;prefetch&lt;/code&gt;, &lt;code&gt;caller&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create &lt;code&gt;app/api/trpc/[trpc]/route.ts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Manually update &lt;code&gt;layout.tsx&lt;/code&gt; to wrap children with &lt;code&gt;TRPCReactProvider&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's a lot of boilerplate before you write a single procedure.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-trpc-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One command. That's it.&lt;/p&gt;

&lt;p&gt;Here's what happens automatically:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Dependency install&lt;/strong&gt; — detects your package manager (npm, pnpm, yarn, bun) and installs everything needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. File generation&lt;/strong&gt; — creates all 6 required tRPC files with the correct structure for Next.js App Router and React Server Components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Layout auto-patch&lt;/strong&gt; — reads your existing &lt;code&gt;layout.tsx&lt;/code&gt;, adds the import, and wraps your &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; contents with &lt;code&gt;&amp;lt;TRPCReactProvider&amp;gt;&lt;/code&gt;. Your existing providers (Clerk, Toaster, etc.) stay untouched.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Test page&lt;/strong&gt; — creates a &lt;code&gt;/trpc-test&lt;/code&gt; page so you can immediately verify your setup is working. Delete it after confirming.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Gets Generated
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;trpc/
├── init.ts              ← context, baseProcedure, createTRPCRouter
├── query-client.ts      ← SSR-safe QueryClient factory
├── client.tsx           ← TRPCReactProvider + useTRPC hook
├── server.tsx           ← prefetch, HydrateClient, caller
└── routers/
    └── _app.ts          ← your app router

app/api/trpc/[trpc]/
└── route.ts             ← API route handler
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  How to Use tRPC After Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Server Component — prefetch data:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prefetch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;trpc&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/trpc/server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;MyClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./my-client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;prefetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;trpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;health&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryOptions&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;MyClient&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;HydrateClient&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Client Component — consume data:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useSuspenseQuery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@tanstack/react-query&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useTRPC&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/trpc/client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MyClient&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;trpc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTRPC&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useSuspenseQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;trpc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;health&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;queryOptions&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Layout Auto-Patch
&lt;/h2&gt;

&lt;p&gt;This was the trickiest part to build. The CLI reads your existing &lt;code&gt;layout.tsx&lt;/code&gt;, finds the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag, detects the indentation style, and wraps the inner content — keeping your existing providers and components exactly where they are.&lt;/p&gt;

&lt;p&gt;Before:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ClerkProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Toaster&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ClerkProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ClerkProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt; &lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TRPCReactProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;children&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Toaster&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;TRPCReactProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;body&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;html&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ClerkProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;.backup&lt;/code&gt; file is saved before any changes so you can always restore.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-trpc-setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;📦 npm: &lt;a href="https://npmjs.com/package/create-trpc-setup" rel="noopener noreferrer"&gt;npmjs.com/package/create-trpc-setup&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🐙 GitHub: &lt;a href="https://github.com/Dhavalkurkutiya/create-trpc-setup" rel="noopener noreferrer"&gt;github.com/Dhavalkurkutiya/create-trpc-setup&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If it saved you time, star the repo ⭐ and share it with someone who uses Next.js + tRPC.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>nextjs</category>
      <category>showdev</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Understanding JavaScript Global Context Execution</title>
      <dc:creator>Dhavalkurkutiya</dc:creator>
      <pubDate>Fri, 21 Jun 2024 04:14:42 +0000</pubDate>
      <link>https://dev.to/dhavalkurkutiya/understanding-javascript-global-context-execution-155a</link>
      <guid>https://dev.to/dhavalkurkutiya/understanding-javascript-global-context-execution-155a</guid>
      <description>&lt;p&gt;When diving into JavaScript, one of the fundamental concepts to grasp is the "global context" of code execution. This term might sound complex, but it's essential for understanding how JavaScript operates, especially in web development. Let's break it down.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Global Context?
&lt;/h2&gt;

&lt;p&gt;In JavaScript, the global context refers to the default environment where your code runs. When the JavaScript engine starts executing code, it begins in this global context. This is true whether you're running your script in a browser or on a server with Node.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Global Object
&lt;/h2&gt;

&lt;p&gt;In JavaScript, the global context refers to the default environment where your code runs. When the JavaScript engine starts executing code, it begins in this global context. This is true whether you're running your script in a browser or on a server with Node.js.&lt;/p&gt;

&lt;p&gt;Every global context has a global object. In browsers, this global object is window. In Node.js, it's global. This global object provides access to all global variables and functions. For example, when you declare a variable without using var, let, or const, it automatically becomes a property of the global object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var foo = "bar"; // This is global
console.log(window.foo); // "bar" in browsers
console.log(global.foo); // "bar" in Node.js 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Execution Contexts and the Call Stack
&lt;/h2&gt;

&lt;p&gt;Understanding execution contexts and the call stack is crucial for grasping the global context. When your JavaScript code runs, the engine creates an execution context. The first execution context created is the global execution context. Here's what happens in detail:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Creation Phase&lt;/strong&gt;: Before any code is executed, the global execution context is created. During this phase, the JavaScript engine sets up the global object, the this keyword, and initializes the scope chain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Execution Phase&lt;/strong&gt;: In this phase, the JavaScript engine executes the code line by line. Functions are called, and variables are assigned values.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The this Keyword
&lt;/h2&gt;

&lt;p&gt;In the global context, this refers to the global object. This behavior can be a source of confusion, especially for developers coming from other programming languages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(this); // In the browser, this will log the window object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, within a function (non-strict mode), this can behave differently. It's important to note that how this is set depends on how the function is called.&lt;/p&gt;

&lt;h2&gt;
  
  
  Strict Mode
&lt;/h2&gt;

&lt;p&gt;JavaScript's strict mode changes the behavior of the global context. When strict mode is enabled (by adding "use strict"; at the top of your script or function), the global context behaves more predictably. For instance, this in the global context will be undefined instead of referring to the global object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"use strict";
console.log(this); // undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Global Variables and Scope
&lt;/h2&gt;

&lt;p&gt;Variables declared outside of any function or block are considered global variables. They are accessible from anywhere in your code, which can be both a blessing and a curse. Overusing global variables can lead to code that is difficult to maintain and debug due to potential name collisions and unintended modifications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid Global Variables&lt;/strong&gt;: Encapsulate your code within functions or modules to minimize the use of global variables. This reduces the risk of name collisions and unintended side effects.Use &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strict Mode: Enabling&lt;/strong&gt; strict mode helps catch common coding errors and prevents the use of certain problematic language features.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;3.&lt;strong&gt;Understand Hoisting&lt;/strong&gt;: JavaScript hoists variable and function declarations to the top of their containing scope. Understanding this behavior is crucial to avoid unexpected results.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use ES6 Modules&lt;/strong&gt;: 
With ES6, you can use import and export statements to create modular code. This helps in keeping your global scope clean.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The global context in JavaScript is the foundation upon which all code execution begins. Understanding how it works, along with the role of the global object and the this keyword, is essential for writing efficient and bug-free JavaScript code. By adhering to best practices, you can manage the global context effectively and avoid common pitfalls.Grasping the global context might seem daunting at first, but with practice and careful coding, you'll find it to be a powerful aspect of JavaScript. Happy coding!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Java programming structure</title>
      <dc:creator>Dhavalkurkutiya</dc:creator>
      <pubDate>Sun, 25 Sep 2022 05:17:51 +0000</pubDate>
      <link>https://dev.to/dhavalkurkutiya/java-programming-structure-2a2l</link>
      <guid>https://dev.to/dhavalkurkutiya/java-programming-structure-2a2l</guid>
      <description>&lt;h2&gt;
  
  
  Java Programming Structure
&lt;/h2&gt;

&lt;p&gt;A java programming structure consists 6 major section:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Document Section&lt;/li&gt;
&lt;li&gt;Package Statement&lt;/li&gt;
&lt;li&gt;Important Statement&lt;/li&gt;
&lt;li&gt;Interface Statement&lt;/li&gt;
&lt;li&gt;Class Defination and ,&lt;/li&gt;
&lt;li&gt;Main Method Definition inside main class [ESSENTIAL]&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Document Section 📑
&lt;/h2&gt;

&lt;p&gt;This section includes to comments to tell tha program's purpose, it improves readability of tha program. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. Package Statement 😍
&lt;/h2&gt;

&lt;p&gt;A Package Statement allowed to includes statement that provides a package declaration.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Important Statement 🧑‍💻
&lt;/h2&gt;

&lt;p&gt;In C or C++ if we require to include some external libraries in our program then we use "include" statement, similar java using "import" statement we can use external libraries in our program, it includes statements used for referring classes and interfaces that are declared in other packages.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Interface Statement 💫
&lt;/h2&gt;

&lt;p&gt;In Java language, an interface can be defined as a contract between objects on how to communicate with eachother, this is similar to class but only includes constants, method declaration, allowed to declare interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  5 . Class Defination 🧑‍💼
&lt;/h2&gt;

&lt;p&gt;It describes information about user defines classes present in the program, this Section allowed to user able to declared other user defined class above ther main method class.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Main Method Definition inside class 🤗
&lt;/h2&gt;

&lt;p&gt;Java Program Execution starts form main method, it Consists main method definition inside class.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧑‍💻 Basic java program 🧑‍💻
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Main{
  public static void main (String[] args) {
    System.out.println("Hello World");
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  👇 Check out 👇
&lt;/h2&gt;

&lt;p&gt;❤️ Instagram : &lt;a href="https://www.instagram.com/_mr.dhaval_io" rel="noopener noreferrer"&gt;https://www.instagram.com/_mr.dhaval_io&lt;/a&gt;&lt;br&gt;
👥 Facebook  : &lt;a href="https://m.facebook.com/dhaval.kurkutiya.3" rel="noopener noreferrer"&gt;https://m.facebook.com/dhaval.kurkutiya.3&lt;/a&gt;&lt;br&gt;
🐦 Twitter   : &lt;a href="https://www.twitter.com/dhaval87950061" rel="noopener noreferrer"&gt;https://www.twitter.com/dhaval87950061&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>javastructure</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
