GyaanSetu WebDev

Frontend, backend and devops for the modern web.

230 articlesDeep, practical knowledge

రెప్లికాకు పంపినప్పుడు PostgreSQL మైగ్రేషన్లు "Read-Only Transaction" ఎర్రర్‌తో విఫలమవుతున్నాయి

ఈ ఎర్రర్ సాధారణంగా రైట్ ఆపరేషన్ రీడ్ రెప్లికాకు వెళ్లడం వల్ల వస్తుంది—తరచుగా PgBouncer కనెక్షన్‌ను రూట్ చేయడం వల్ల, ఒక రోల్ డిఫాల్ట్‌గా రీడ్-ఓన్లీగా ఉండటం వల్ల, లేదా క్లౌడ్ సెటప్ రీడర్ ఎండ్‌పాయింట్‌ను ఉపయోగించడం వల్ల ఇలా జరుగుతుంది. ప్రస్తుత ట్రాన్సాక్షన్ కోసం ఈ ఫ్లాగ్‌ను ఎలా ఓవర్‌రైడ్ చేయాలి మరియు దీని నుండి ఎలా నివారించాలో ఈ వ్యాసం వివరిస్తుంది.

WebDev · 3 min read

Frontend Team Cuts Bundle Size to Zero by Tree-Shaking Type-Safe API Mocks

The team built a dev-only mock layer using Axios interceptors and Vite’s tree-shaking. By gating the interceptor with import.meta.env.DEV, a custom VITE_ENABLE_MSW flag, and the MODE variable, the entire mock code is stripped from production bundles, keeping the bundle size unchanged.

WebDev · 3 min read

నా స్వంత కోడ్‌ను పరీక్షించడం: కాంట్రాక్ట్ టెస్టింగ్ ఏమిని వెల్లడించింది

నా స్వంత కోడ్‌ను పరీక్షించడం: కాంట్రాక్ట్ టెస్టింగ్ ఏమిని వెల్లడించింది. నా Zerodha క్లోన్ పూర్తయిందని నేను అనుకున్నాను. ఇది Node బ్యాకెండ్, React ఫ్రంటెండ్, MongoDB మరియు Razorpay తో కూడిన ఒక MERN స్టాక్ ప్రాజెక్ట్...

WebDev · 3 min read

Genericsలో Literal Wideningను నిరోధించడానికి TypeScript 'const' టైప్ పారామీటర్లను జోడిస్తుంది

టైప్ పారామీటర్‌పై కొత్త 'const' మోడిఫైయర్, కంపైలర్‌కు అత్యంత ఇరుకైన (narrowest) టైప్‌ను గుర్తించమని చెబుతుంది. దీనివల్ల "GET" వంటి లిటరల్స్ ఫంక్షన్ బౌండరీల అంతటా లిటరల్స్‌గానే ఉంటాయి, తద్వారా పదేపదే 'as const' కాస్ట్‌లు చేయాల్సిన అవసరం ఉండదు.

WebDev · 3 min read

రెండు వారాల్లో REST కి బదులుగా tRPCని ఉపయోగించడం ద్వారా డెవలపర్ API ఓవర్‌హెడ్‌ను తగ్గించారు

ఈ మైగ్రేషన్ వల్ల OpenAPI స్పెసిఫికేషన్, SDK జనరేషన్, Postman కలెక్షన్ మరియు స్వయంగా రాసిన TypeScript ఇంటర్‌ఫేస్‌ల అవసరం లేకుండా పోయింది; దీనివల్ల ఎడిటర్ తప్పులను వెంటనే గుర్తించగలుగుతుంది మరియు రిపోజిటరీ పరిమాణం గణనీయంగా తగ్గింది.

WebDev · 3 min read

Team Automates VPAT Generation in CI, Blocking Inaccessible PRs

By embedding axe-core scans, custom Vitest keyboard helpers, and JSON-stored screen-reader results into the build, the pipeline fails any pull request that introduces an accessibility regression and automatically emits a PDF VPAT with each successful release.

WebDev · 3 min read