今日已更新 298 条资讯 | 累计 42709 条内容
关于我们

标签:#ev

找到 5810 篇相关文章

AI 资讯

Presentation: Clean Architecture for Serverless: Business Logic You Can Take Anywhere

Elena van Engelen discusses how to eliminate serverless vendor lock-in without sacrificing native cloud capabilities. She explains how to structure FaaS applications using Clean Architecture, Spring Cloud Function, and Gradle modules to isolate business logic. Finally, she shares a live demo deploying portable Kotlin services across AWS and Azure using Terraform CDK for multi-cloud IaC. By Elena van Engelen

2026-07-27 原文 →
AI 资讯

Article: An Evolutionary Architecture Pattern for Managing AI’s Pace of Change

Traditional API gateways assume deterministic services and simple schemas - assumptions agentic AI breaks. Discover why enterprise engineering leaders are adopting AI Gateways as an evolutionary architecture seam. Centralize guardrails, model routing, agent identity, action policy, and semantic audit within a single control plane to prevent costly incidents while keeping core platforms stable. By Joe Price, Branimir Đurek, Pavlos Migkiros, Trevor Dearham

2026-07-27 原文 →
AI 资讯

I built an interactive site about my journey — not a portfolio

Honestly I almost didn't build this because everyone said "just make a normal portfolio, resume + project cards, keep it simple." But that felt fake to me. Like I'd be hiding the actual messy part of learning to code and just showing the highlight reel. So instead I built whoisrehan.vercel.app — it's less of a portfolio and more of me walking you through everything, starting from the first time I opened a code editor with literally no idea what I was doing, all the way to now. Including the stuff that usually gets left out — the projects that didn't work, the times I wanted to quit, the small wins that felt huge at the time. It's not polished. It's just honest. If you've ever started something with zero plan and just pure curiosity, I think you'll get it. whoisrehan.vercel.app Curious which part actually hits you if you check it out : BuildInPublic #WebDevelopment #DeveloperJourney

2026-07-27 原文 →
AI 资讯

Day 2 at TOSSConf 2026 — தமிழ் கட்டற்ற மென்பொருள் மாநாடு

இன்னும் ஜோஷ்! 🔥 முதல் நாள் St. Joseph's Institute of Technology, சென்னையில ஜோர்தான் இருந்தது. இரண்டாம் நாள் வந்ததும் என்னன்னா, க்ரவுட் இன்னும் அமைதியா, ஆனா உள்ள ஆர்வம் இன்னும் ஜாஸ்தியா இருந்துச்சு. எல்லாரும் "இன்னிக்கி ரொம்ப tech-ஆ போகணும்" னு மனசுல வெச்சிட்டு உட்கார்ந்திருந்தாங்க. இண்டு "தமிழன் நினைச்சா முடியாதது இல்ல" ங்கிற வார்த்தை என் மனசுல ஓடிக்கிட்டே இருந்தது — ஒரு சின்ன அறையில கூட, கம்ப்யூட்டர் screen-ல open source code-ஐ பார்த்துக்கிட்டே இருந்தா, அது எவ்ளோ பெரிய புரட்சின்னு தெரியும். FOSS-ன்னு சொல்ற ஒவ்வொரு லைனும், நம்ம மொழியில நம்ம கம்யூனிட்டியால எழுதப்படுற ஒவ்வொரு code-உம் ஒரு சிறிய வெற்றி தான். Session 1: வேகமா App கட்டணுமா? Meet Framework இருக்கே! 🚀 முதல் session-ல Meet Framework அறிமுகமானது — Python + JS ரெண்டையும் சேர்த்து ஒரே கூரையின் கீழ கொண்டு வர்ற ஒரு full-stack framework. இது என்ன பண்ணுது தெரியுமா? "Setup fatigue" ங்கிற பெரிய பிரச்சனையை ஒரே அடியில தீர்க்குது. Backend, frontend, database எல்லாத்தையும் தனித்தனியா தேடி, ஒட்டி, configure பண்ணி — இதெல்லாம் இல்லாம, ஒரே framework-ல எல்லாமே ready-ஆ இருக்கும். Speaker live-ஆ ஒரு app-ஐ கட்டி காமிச்சாங்க — routing, models, ஒரு simple UI எல்லாம் நிமிஷங்களில ready! அது பார்க்கும்போதே ஒரு எனர்ஜி கிடைச்சது. "Idea இருந்தா போதும், tool நம்ம கூட இருக்கு" ங்கிற நம்பிக்கை தான் FOSS-ன்ற அழகே. சின்ன Motivation: ஒரு framework கத்துக்கிறதும், ஒரு புது மொழி கத்துக்கிறதும் ஒண்ணுதான். ஆரம்பத்துல கஷ்டமா தான் தெரியும், ஆனா ஒரு அடி எடுத்து வெச்சா, மொத்த பாதையும் தெளிவா தெரியும். "தொடங்குறது தான் பாதி வெற்றி!" Session 2: NPM vs NixOS — ஒரு "Love-Hate" Relationship 😅 இரண்டாவது session ரொம்ப relatable-ஆ இருந்தது — NixOS-ல npm use பண்றது! அறையில இருந்த பலருக்கும் இது தெரிஞ்ச பிரச்சனை தான், எல்லாரும் தலையாட்டிட்டே இருந்தாங்க. பிரச்சனை என்னன்னா — Nix ரொம்ப strict-ஆ இருக்கும், file system-ஐ read-only-ஆ வெச்சிருக்கும். அதனால npm சாதாரணமா install பண்ற மாதிரி இங்க straight-ஆ வேலை செய்யாது. Speaker மூணு வழிகள் சொன்னாங்க: Local user prefix வெச்சு — npm-ஐ ஒரு writable இடத்துல install பண்ண வைக்கிறது. node2nix use பண்ணி — npm dependencies-ஐ

2026-07-27 原文 →
AI 资讯

🏢 Building Enterprise-Ready AI Agents 🤖 — A Practical Field Guide 📚

How to design, ship, and operate an AI agent that is reliable, efficient, performant, scalable, and secure enough to serve real companies — from a 5-person startup to a 50,000-person enterprise. This guide distills hard-won lessons from production agents (Claude Code, OpenHands, SWE-agent, GoClaw, Hermes, nanobot, PicoClaw, ZeroClaw, Multica, Paperclip) and grounds them in current engineering guidance from Anthropic and OpenAI plus the security and compliance standards you'll actually be audited against (OWASP Top 10 for Agentic Applications, NIST AI RMF, the EU AI Act, and 2025–2026 prompt-injection research). It focuses on the parts most articles skip: the enterprise tax — governance, security, compliance, integration, cost control, and the operating model — that separates a demo from a system a CISO will sign off on. 📖 How to use this guide Read Parts 0–2 to decide whether and what to build. Most failed agent projects die here. Read Parts 3–7 for the architecture and reliability engineering. Read Parts 8–10 for the enterprise gates: security, compliance, multi-tenancy, observability, cost. Read Parts 11–15 for delivery, scale & rollout: deployment topologies (SaaS/self-hosted/hybrid), how to adopt from pilot to org-wide, how to handle thousands of concurrent requests, the operating model, and a 30/60/90 plan. Every part ends with an ✅ Actionable checklist . Skim those for a design review. 📋 Table of Contents 🧮 Part 0 — The Core Equation 🧭 Part 1 — Decide Before You Build: Workflow vs Agent, Build vs Buy 🏛️ Part 2 — The Enterprise Tax: What Actually Changes 🏗️ Part 3 — Reference Architecture: The Layered Stack 🔄 Part 4 — The Reliable Kernel: The Agent Loop 🛠️ Part 5 — Tools & Enterprise Integration 🧠 Part 6 — Context & Memory: The Cost Center 🛟 Part 7 — Reliability Engineering 🔐 Part 8 — Security, Compliance & Governance 🧱 Part 9 — Multi-Tenancy & Isolation 📊 Part 10 — Observability, Evals & Cost Governance 🚀 Part 11 — Deployment & Delivery Models 📈 Part 12 — The

2026-07-27 原文 →
开发者

A PDF toolkit that never uploads your files, now with batch mode

Free Online PDF Converter – Word, HTML, Image & More Tools Free online PDF converter with complete privacy protection. Merge, split, compress, sign, and convert PDFs directly in your browser — plus a free age calculator and scientific calculator. No uploads, no data storage. onepagepdfconverter.com I built One Page PDF Converter (onepagepdfconverter.com) — a set of 20+ PDF tools (merge, split, compress, sign, convert to/from Word/Excel/PowerPoint/images, etc.) plus a couple of everyday calculators, all running entirely client-side in the browser. There's no backend processing your files: no upload, no storage, no server round-trip. Everything happens locally via JS, so your documents never leave your device. That's the whole pitch — it's the same reason I built it, since most PDF tools online quietly funnel your files through a server you have no visibility into. All 20+ tools are free with no sign-up. Today I'm adding a small premium option: batch processing, for ₹9.99 per batch (~$0.10 USD), one-time — no subscription. Run a tool across multiple files in one go instead of one at a time. Everything else on the site stays free and unlimited. Tech-wise it's a single HTML file backed by client-side JS libraries — no framework, no build step. It's a PWA, so it installs and works offline once loaded. Would love feedback — especially on the privacy angle, the batch pricing, or tools you think are missing. Free Online PDF Converter – Word, HTML, Image & More Tools Free online PDF converter with complete privacy protection. Merge, split, compress, sign, and convert PDFs directly in your browser — plus a free age calculator and scientific calculator. No uploads, no data storage. onepagepdfconverter.com

2026-07-27 原文 →
AI 资讯

Full-stack Pokémon TCG simulator with pack opening, grading, PvP and card auctions

An ecosystem whose job is to full-fill our dream of opening and collecting pokemon cards, which we all had in our childhood. Instead of just clicking a button to reveal static images, I wanted to recreate the whole experience of getting , collecting and showing off your pokemon cards , i even added live card auctions and card shows and PSA card grading simulator to give the full-on experience which pokemon has to offer. 🔗 Live Sandbox: https://pokemontcgsim.vercel.app 💻 GitHub Repo: https://github.com/sohamSanat/PokemonTcgSimulator ** Screen shots of different segments of the web app -> ** 1)Main page (pack opening) 2)Binder section where you sort your cards in the personal collections and see your cards’ portfolio 3)Card grading simulation where you can get your cards’ price increased based on the condition of your card 4)Card show where there are different vendors with their own specialty in cards 5)live cards auction of thousands of cards **Tech fluff for people who cares ;D -> Architecture & Major Engineering Achievements : -** 1)Era-Calibrated Pack Engine & Rarity Probability Mathematics: Pack generation creates historically accurate card pools from over 25 years of card sets, from 1999 Base Set to 2025 Mega Evolution. It recreates slot weights, ensures holos, and handles complex probability mechanics for Secret Illustration Rares and many other cards 2)gemini powered NPC Negotiation Engine: During the virtual card convention, users negotiate with 9 different NPC vendors through natural language interactions. The backend NLP pipeline analyzes the user’s language, tokenizes the negotiation and makes offers. 3)Simulated PSA Grading Laboratory & Restoration Studio: The multi-step card authentication system considers card centering, surface, corners, and edges, and provides realistic grade distribution (PSA 1-10) with dynamic slab encasement and grade multipliers. It also has an interactive pre-grading restoration studio where you can clean surfaces and press corne

2026-07-27 原文 →
AI 资讯

Migrating a Rich Text Editor : CKEditor 5 to SynapEditor (with code)

Disclosure: I work on the team behind SynapEditor. 🧩 TL;DR: Moving from CKEditor 5 to SynapEditor is a one-to-one swap in three steps: installation, toolbar config, and content/event APIs. The main reason to consider it is Office document fidelity (Word, PowerPoint, Excel import/export). Full runnable example at the end. Switching rich text editors sounds like a big job, but most of the work is a straightforward, one-to-one swap. This guide walks through moving an existing CKEditor 5 integration over to SynapEditor: loading the library, wiring up the toolbar and content APIs, and a complete working example you can copy and run. ⚖️ Which is better: CKEditor or SynapEditor? Both CKEditor and SynapEditor are mature, capable editors. If you already have CKEditor running, it clearly does a lot right. So the question isn't really "which is better" in the abstract, it's which one fits where your product is heading. Two things tend to drive the decision: 📜 Licensing and support. CKEditor 4 reached end of life in 2023, and security fixes now sit behind a paid Extended Support agreement. If you're revisiting the integration anyway, it's a natural moment to reconsider the editor itself. 📄 Office documents. This is where SynapEditor differs most. It imports a broad range of office formats: MS Word (.doc, .docx), PowerPoint (.ppt, .pptx), Excel (.xls, .xlsx, ODT, and HTML, and exports back to Word (.docx) with formatting preserved. If your users upload real documents and expect the layout to survive, that's worth weighing. CKEditor 5 SynapEditor Core editing ✅ ✅ CKEditor 4 still supported Paid ESM only n/a Word / PPT / Excel import-export Limited ✅ Native With that out of the way, let's migrate. 📋 What you'll need [ ] An existing CKEditor 5 integration [ ] A SynapEditor license and API key (free at Get Started ) [ ] About 15 minutes for a basic swap ⚙️ 1. Installation CKEditor 5 loads from a single script. SynapEditor loads from a script and a stylesheet: the UI is styled by tha

2026-07-27 原文 →
AI 资讯

I Built 47 Free Dev Tools That Run Entirely in Your Browser

Every developer has done it — copy-pasted a JWT, a private key, or a JSON blob with sensitive data into some random website and held their breath. Wondering if it was being logged, tracked, or worse. Every developer has done it — copy-pasted a JWT, a private key, or a JSON blob with sensitive data into some random website and held their breath. Wondering if it was being logged, tracked, or worse. I built KRUMB.DEV because I wanted tools that didn't make me feel dirty after using them. What Is It? 46 developer tools, all in one place. No signup. No uploads. No tracking. Open source. The terminal-inspired interface isn't just aesthetic — it's a constraint. Every tool fits in a single column, zero sidebar, zero popups. Just you and the tool. What's Inside Formatters — JSON, SQL (17 dialects), HTML, JavaScript, CSS Encoders — Base64, URL, JWT decoder, YAML↔JSON, JSON↔CSV Generators — Passwords, UUIDs (v1/v3/v4/v5), hashes (MD5/SHA/HMAC), QR codes, Lorem Ipsum, color palettes, CSS gradients/shadows/grids, meta tags, robots.txt, .gitignore Testing & Debugging — Regex tester, diff checker, webhook tester, cURL→code, HTTP status reference, cron expression builder Converters — Unix timestamps, hex↔RGB, binary, SVG→JSX, JSON→TypeScript, HTML playground, markdown editor Network — DNS lookup, SSL checker, IP lookup, QR code decoder, IBAN validator Why I Built It This Way Most "free" dev tools follow the same pattern: create an account, hit a rate limit, and wonder if your data is being stored somewhere. KRUMB.DEV flips that: Everything runs in your browser — JSON, JWT, source code, passwords never touch a network request Zero accounts — open the page, use the tool, leave. No signup wall between you and the output Clean interface — ⌘K opens a command palette to jump to any tool in seconds Open source — MIT license, deploy your own if you want The Tech Next.js, TypeScript, and Tailwind. Static-first, client-side execution for all core tools. Server routes exist only for DNS/SSL l

2026-07-27 原文 →
AI 资讯

TanStack Table V9 Beta: Tree-Shakable Features, TanStack Store State, and Lower Memory Usage

TanStack Table V9 is a beta release of a headless UI library for creating tables in various JavaScript frameworks. It features improved state management, memory usage, and extensibility. The notable change is an opt-in feature model, allowing developers to load only necessary components. Migration is gradual, with tools provided for legacy support. The library remains free and developer-focused. By Daniel Curtis

2026-07-27 原文 →
AI 资讯

Beyond Prompt Injection: The Non-Human Authorization Gap in Enterprise AI

The Hidden Vulnerability in Multi-Agent Chains The biggest architectural risk in enterprise AI today isn’t prompt injection—it’s Delegation Escalation . When a human user triggers an AI Agent Orchestrator, which then delegates tasks to sub-agents and tool execution gateways via MCP or internal APIs, traditional static service accounts break down. If you pass broad bearer tokens or static user API keys down the execution chain, you create a massive Confused Deputy vulnerability. To deploy autonomous multi-agent chains safely at enterprise scale, platform architects must enforce OAuth 2.1 RFC 8693 Token Exchange with explicit actor claims. The Non-Human Authorization (NHA) Flow Human User Authorization: A user authenticates and grants a specific, bounded scope (e.g., read:finance ) to the primary Agent Orchestrator. Token Exchange: The Orchestrator leverages OAuth 2.1 Token Exchange (RFC 8693) via the enterprise identity gateway rather than passing raw user credentials downstream. Actor-Claim Scoped Call: The sub-agent or tool execution layer receives a short-lived token containing a nested actor claim ( act ) identifying both the human subject and the orchestrator, ensuring execution authority is strictly bounded by the intersection of their permissions. 3 Non-Negotiable Rules for Agentic Identity Governance Delegation Over Impersonation (RFC 8693): Never allow an agent to blindly impersonate a user. Enforce OAuth 2.1 Token Exchange so every issued JWT token contains a nested actor claim: Human Subject -> Agent Orchestrator -> Sub-Agent . Every downstream API must verify both who authorized the action and which agent executed it. Intersection of Privileges (User ∩ Agent): An agent’s runtime authority must be the strict mathematical intersection of the user’s IAM permissions and the agent’s registered tool scope. An agent should never acquire more system access than the human user who invoked it. Ephemeral Tokens & DPoP Binding: Eliminate static configuration API keys

2026-07-27 原文 →
AI 资讯

My Comment Pipeline Marks a Thread "Handled" the Moment I Reply Once. A Follow-Up Question Proved It Wrong.

I run a small script called reply_comments.py that scans my DEV.to articles for comments I haven't replied to yet, and hands me a JSON list so I can draft responses. It's been running twice a day for over a week. This morning, while re-reading it for something unrelated, I noticed the function that decides whether a thread still needs my attention was answering the wrong question — and had been since the day it was written. Here's the function, unchanged until today: def replied_by_me ( comment ): return any ( c [ " user " ][ " username " ] == ME or replied_by_me ( c ) for c in comment [ " children " ]) It walks a comment's entire reply tree and returns True the moment it finds any message from me, anywhere in the subtree. Then pending() uses it as the skip condition: for c in api ( f " /comments?a_id= { a [ ' id ' ] } " ): if c [ " user " ][ " username " ] == ME or replied_by_me ( c ): continue ... out . append ({...}) The logic reads fine in isolation: "did I already reply to this thread? Skip it." The bug is in what "already replied" is being asked to mean. replied_by_me doesn't check whether the latest message in the thread is mine — it checks whether a message from me exists at all, ever, at any depth. Those are the same question exactly once: the first time someone comments and I reply. They stop being the same question the moment the other person replies again. Proving it I wrote a small repro against the real function rather than trusting my read of it: from reply_comments import replied_by_me thread = { " id_code " : " 3c00h " , " user " : { " username " : " alexshev " }, " created_at " : " 2026-07-24T08:00:00Z " , " children " : [ { " user " : { " username " : " enjoy_kumawat " }, " created_at " : " 2026-07-25T10:00:00Z " , " children " : []}, { " user " : { " username " : " alexshev " }, " created_at " : " 2026-07-26T09:00:00Z " , " children " : []}, ], } print ( replied_by_me ( thread )) # True That's True even though the second child — posted a full day

2026-07-27 原文 →
AI 资讯

How I Reduced My OPEX By 99.5% Using Go

Previously, I wrote about How I Processed 666K Pages Of Flattened PDFs into a Full Text Search Engine called the Apario writer . Upon on the conclusion of the last segment, I was able to optimize the compilation time of the original collection of data by rewriting the sidekiq Ruby pipeline script into a dedicated Go Application. Regardless of what compiling the PDF assets would look like, I still needed to serve those assets - and that's where the writer did little to nothing to actually address the OPEX of the project from 2020. Given the size of the data set, the 666K pages ended up compiling into a directory of ~1.13TB in size. This was held in storage that was distributed across several high volume storage dedicated servers on OVH behind MinIO . This provided an S3 compatible API directly. What I Know About OPEX OPEX or Op erational Ex pense is how you describe a spending of money that is used explicitly for the operations of the business versus a capital expense. Hardware was considered a CAPEX or Cap ital Ex pense. So when Bit Fry Game Studios needed their DevOps pipeline upgraded for the 9 hour game builds into a 30 minute private enterprise cloud build, it required a CAPEX investment of $69K plus trust in me in order to achieve a -$15K/month OPEX savings. Annualized over a hardware lifecycle, over $472K can be recovered from OPEX by making a small CAPEX expense up front. One of the first projects that I ever worked on was in PHP and MySQL on Ubuntu 8.04 . It was to balance the budget of a department that had ACME Bucks so to speak. It required me to write a finance module, fully tested, that managed Blue , Green and Black dollars. Blue dollars were for OPEX. Green dollars were for CAPEX. Black dollars were for external vendors where money left the company (versus moving between departments). Black depreciated instantly - meaning 100% of it was paid immediately. Blue dollars were borrowed over a 12 month pay-back period. Green dollars were borrowed over a 36

2026-07-27 原文 →
AI 资讯

Cherry-picking your hotfix twice is the real pipeline smell

We had a gitflow pipeline that looked clean on paper: develop feeds a release branch, the same build artifact promotes through dev, qa, sit, uat, and prod, and once prod is green we tag the commit on main. Textbook. Then a production bug showed up on a Tuesday afternoon, and the diagram stopped mattering. The standard gitflow answer is to branch a hotfix off the tag, PR it back into release, run it through the pipeline, and once it's proven in UAT, merge to main and cherry-pick the same commit back into develop. We built exactly that. It works. Until you ask the question nobody wants to answer out loud: release still has whatever was mid-flight when you cut the last tag. Untested code. Feature work three sprints deep in QA, sitting on the same branch you're now supposed to route your hotfix through. So the real question we ended up arguing about wasn't "how do we release a hotfix." It was "do we trust the release branch enough to put a hotfix through it." Most of the time, the honest answer is no. The gate everyone obsesses over is the wrong one Five environments, five sign-offs, a change ticket for each one: that's the smell people point at first when a pipeline feels slow. It's real. It's just not the dangerous one. A slow gate costs you time. A gate you route around because you didn't trust your own process costs you an incident. Here's what we landed on after the argument: release the hotfix directly from the hotfix branch, not through release. On Azure, that means deploying to the UAT slot, smoke-testing against production data shape, then toggling the slot. Same infrastructure, same config, none of release's baggage riding along. Once it's live, cherry-pick the commit into both develop and main, retag, and let the normal pipeline catch up on its own schedule whenever it gets there. That's a smaller number of gates (one real test in the slot, one human sign-off) that actually mean something, instead of five theatrical ones inherited from a process built for pla

2026-07-27 原文 →
AI 资讯

Six months of running a GBA emulator

I shipped GoGBA (Android + iOS) to both stores in late December 2025. Six months in: MAU peaked at 8.3k, currently steady around 7.4k. No paid advertising, ever. This is a write-up of what the six months actually involved. I'll be specific about the technical work, and equally specific about the mistake that cost me RetroAchievements hardcore certification — because that part is the most useful thing here for anyone building in this space. Why GBA only I grew up on a GBA — Super Robot Wars, Fire Emblem, Pokémon, Castlevania, Zelda. Later NDS/3DS/PSP/Vita/Switch arrived and the GBA did its job and retired. On PC the emulator I remember is VisualBoyAdvance. I've used GBA, NDS and PSP emulators on phones. I kept coming back to GBA, for four reasons that are all practical rather than nostalgic: Pixel art holds up. Personal taste, no defense offered. Battery. A GBA game survives a long-haul flight. Single screen. The remaining screen space is exactly where virtual buttons want to go. NDS dual-screen on a phone is always a compromise. ROM hacks. The GBA hack scene is the richest of any handheld. Point 3 is the one that made me build something: GBA is the only handheld whose form factor natively fits a phone. That's a product observation, not sentiment. What existing emulators get wrong (for me) I used the main ones on both platforms: Delta and Linkboy on iOS; Pizzaboy, Linkboy and Lemuroid on Android. Lemuroid is open source and a lot of shipped emulators are built on it. They're all good. Every one of them had small things that annoyed me. The only genuinely cross-platform one is Linkboy (formerly MyBoy), but its configuration surface is extremely deep — second only to RetroArch in complexity. That's the gap. Everyone was solving "can it run" and "can it be tuned perfectly." Nobody was solving "pick it up and play." The methodology was just dogfooding I'm a Flutter GDE and tech lead for a 40-person cross-platform team; GoGBA was a solo test of that experience. The only r

2026-07-27 原文 →
AI 资讯

React useDeepCompareEffect: Fix useEffect Object Dependencies (2026)

React useDeepCompareEffect: Fix useEffect Object Dependencies (2026) You wire up a fetch. The endpoint takes a query object, so you pass it in the dependency array. The effect fires, sets state, the component re-renders, the query object is rebuilt — a brand-new object with identical contents — and the effect fires again. You have written an infinite loop, and React thinks it did exactly what you asked. function Results ({ term , page }: Props ) { const [ rows , setRows ] = useState ([]); const query = { term , page , sort : ' desc ' }; // new object, every render useEffect (() => { fetchRows ( query ). then ( setRows ); // setRows → re-render → new query → 🔁 }, [ query ]); } useDeepCompareEffect from @reactuses/core is a drop-in replacement for useEffect that compares dependencies by value instead of by reference. Same signature, same cleanup semantics — the effect just stops firing when nothing actually changed. Everything below is the real implementation, TypeScript-first, including the parts that cost you something. Why useEffect Can't See It React compares dependency arrays with Object.is , element by element. For primitives that's exactly what you want: 5 is 5 , 'desc' is 'desc' . For anything with an identity — objects, arrays, Date s, Map s, functions — it compares the reference , and a literal written inside a component body produces a fresh reference on every single render: Object . is ({ term : ' react ' }, { term : ' react ' }); // false — different objects So the dependency "changed" on every render, by React's definition. This isn't a bug in useEffect ; reference equality is the only comparison that's O(1), and React runs it on every render of every component. The cost of value comparison is real, and React declines to pay it on your behalf. Which leaves you paying it — one way or another. The Usual Workarounds, and Where They Fray Memoize the object. Correct, and the right answer when there's one dependency: const query = useMemo (() => ({ term , page

2026-07-27 原文 →
AI 资讯

CSS Box model

In CSS, the term "box model" is used when talking about web design and layout.The CSS box model is essentially a box that wraps around every HTML element. Every box consists of four parts: content, padding, borders and margins. EXPLANATION Content - The content of the box, where text and images appear Padding - Clears an area around the content. The padding is transparent Border- A border that goes around the padding and content Margin - Clears an area outside the border. The margin is transparent div { width : 400px ; border : 12px solid green ; padding : 50px ; margin : 20px ; }

2026-07-27 原文 →