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

标签:#Web

找到 2738 篇相关文章

AI 资讯

I made my SaaS installable by AI agents. Here's what was broken.

Two weeks ago I watched an agent run a full product launch on Waitlister, my waitlist tool. It created the waitlist, generated and published a landing page, signed up a test address, checked the signup was real by fetching the public page unauthenticated, then unpublished and deleted everything it had made. Nobody touched the dashboard. The interesting part isn't that run. It's what I found while getting there, because almost none of it was visible from a browser. Why I bothered My users are pre-launch founders, which is exactly the group now building landing pages by prompting Claude, Cursor, or v0 instead of opening a site builder. "Add a waitlist to my site" is a normal thing to ask an agent to do, and increasingly nobody types my product name at all. The uncomfortable part is when an agent hits a 404 or installs a package that doesn't exist, it doesn't debug. It picks a different tool in the next sentence and never tells the user it switched. You lose without ever seeing a bounce. What I shipped, in order of how much it turned out to matter Full API coverage for the whole job. Not most of it. More below, because this one was worth the other five combined. A skill.md route. One page written for an agent rather than a person: a decision tree (no API key yet, go this way; account key, go that way), both code paths, and a self-check at the end so the agent can confirm it worked. An OpenAPI spec at a fixed URL. Valid 3.0.3 at /openapi.json , all five endpoints, auth, rate limits, error shapes. Endpoint changes update the spec and the SDK types in the same PR or they don't merge. A real npm SDK , plus four aliases under the names an agent is likely to reach for. An MCP server , 14 tools, so agents that speak MCP get typed calls instead of reading my docs. llms.txt and llms-full.txt , an index of the docs in plain text with a short block at the top saying what this product is and where the golden path starts. What was broken Honest list. The file I wrote for agents was

2026-08-14 原文 →
AI 资讯

Understanding Event-Driven Architecture in Modern Applications

Event-driven architecture is one of the most useful patterns for building applications that need to react to events instead of executing everything in a strict request-response sequence. Instead of thinking: User does something → Server performs everything → Response we can think: User does something → Event is created → Interested services react to it What Is an Event? An event represents something that happened. For example: { type : " USER_REGISTERED " , userId : " 12345 " , timestamp : Date . now () } Other parts of the application can listen for this event and perform their own tasks. For example: Email service sends a welcome email. Analytics service records the registration. Notification service creates a notification. Recommendation service creates initial recommendations. The registration service doesn't necessarily need to know how all of these tasks work. Why Use Event-Driven Architecture? The biggest advantage is decoupling. A traditional implementation might look like: await createUser (); await sendEmail (); await updateAnalytics (); await createNotification (); If the email service becomes slow, the entire operation can become slow. With events: await createUser (); publishEvent ({ type : " USER_REGISTERED " , userId : user . id }); Other services can process the event independently. Where Is It Useful? Event-driven systems are particularly useful for: Payment processing E-commerce Notifications Analytics Microservices IoT systems Background processing Real-time applications The Trade-Off Event-driven architecture isn't automatically better. It introduces additional complexity: Event delivery failures Duplicate events Ordering problems Debugging difficulties Event schema management For a small CRUD application, a simple architecture may be much easier. Final Thoughts Event-driven architecture is less about using a specific technology and more about changing how application components communicate. Once your application grows beyond a simple monolith, u

2026-08-14 原文 →
AI 资讯

200 OK Is Not Enough: Why Bot-Protected Sites Still Return Bad Data

Your crawl job finished successfully. That doesn't mean it got the data. Every scraping pipeline has a monitoring dashboard, and every monitoring dashboard has the same blind spot: it tracks whether requests succeeded, not whether the content that came back was real. A job that completes with a wall of green 200 status codes looks healthy. It can also be quietly wrong, page after page, for weeks, because a 200 response only tells you the server accepted the request. It says nothing about whether you're looking at the actual page or a version built specifically for visitors the site doesn't fully trust. That gap between "the request succeeded" and "the data is correct" is where most silent pipeline failures live, and it's getting wider as anti-bot systems get more sophisticated about what they serve instead of an outright block. What a "successful" response can actually contain A block used to be simple to detect: a 403, a 429, a connection reset. Modern anti-bot systems increasingly prefer a different approach, because an obvious block tells the requester exactly what happened and invites a fix. A soft block, served with a 200, doesn't. In practice, that 200 can be a challenge page, an interstitial that looks like real content in the raw response but is actually a JavaScript-driven verification step (a "just a moment" style page, a hidden CAPTCHA iframe, a redirect loop disguised as a normal page load). It can be a cached fragment, an old snapshot of the page served to anything that looks automated, so the price, availability, or listing you scraped is stale even though the request itself worked fine. It can be an empty state, a search results page or listing that legitimately returns "no results" to a request pattern the site doesn't recognize, even though a real visitor would see dozens of items. And increasingly, it can be a partial HTML shell: the server response contains the page skeleton, but the actual content only renders after JavaScript executes in a real

2026-08-14 原文 →
AI 资讯

npm 12 Released: Install Scripts Off by Default as Registry Moves to Explicit Trust

npm 12 introduces significant security-related changes, making certain installation behaviors opt-in. Notably, script allowances are now off by default, which requires explicit approval for running scripts, including implicit builds. The update also restricts non-registry sources and addresses community concerns about security risks from automatic script execution. By Daniel Curtis

2026-08-14 原文 →
AI 资讯

Website Load Testing Guide: Test Performance at Scale

If you’ve managed web servers or applications for any length of time, you’ve probably seen this happen: a new feature or campaign goes live, traffic suddenly spikes, and Website Load Testing becomes critical when your website starts returning 503 errors at exactly the moment you need it to perform. What happens next is usually a scramble, SSH into a server you haven’t checked in months, inspect running processes, restart services, and make infrastructure changes based on guesswork. Eventually, the traffic settles, the site recovers, and the immediate crisis is over. But that kind of incident is often preventable. Load testing helps you find your website’s limits before your users do. In this guide, we will cover what load testing is, why it matters at every scale, how to run your first test using loader.io (the most accessible free tool available), what your results actually mean, how to find and fix bottlenecks, and how to make load testing a normal part of how you ship software. TL;DR Load testing answers one critical question: how many concurrent users can your server handle before it falls over? Without it, you’re guessing about capacity, and guessing wrong right when it matters most loader.io is the simplest free tool to get started: no install, browser-based, generous free tier Your three essential numbers: concurrent user target, response time threshold, and peak traffic window Run load tests before every major deployment, not after your site goes down What Load Testing Actually Is Let me clear up some confusion first, because “load testing” gets thrown around interchangeably with a few related terms that mean different things. Load testing is specifically about simulating concurrent users hitting your site and measuring how your server behaves under a expected load. You’re asking: “When 500 people are on this site at the same time, what happens?” Stress testing pushes beyond that, you keep adding users until something breaks, then you figure out exactly wher

2026-08-14 原文 →
AI 资讯

How Much Should We Trust AI-Generated Tests?

While exploring X360 AI Tech, I started thinking about something beyond just generating test cases-how much should we actually trust them? Creating a basic happy-path test with AI seems pretty easy, but things like business logic, edge cases, and whether the test is actually checking the right thing still need a human eye. I’m also wondering about what happens a few months down the line. The app changes, requirements change, and some tests that made sense earlier may not make sense anymore. So maybe the bigger challenge isn’t just generating tests, but keeping them useful over time. For me, AI feels more useful as a second pair of hands rather than something that makes all the testing decisions. Curious how others are using it in real projects-are you reviewing every AI-generated test, or trusting it for certain types of scenarios?

2026-08-14 原文 →
AI 资讯

Notes from getting QuickBooks to accept a generated .qbo file

I'm building a small tool that converts bank CSV files into .qbo files for QuickBooks ( qbofile.com ). When a generated file is wrong, QuickBooks rejects it with vague errors and the OFX spec doesn't tell you what QuickBooks actually checks. So I ran some experiments. Notes below, in case someone else hits the same wall. The file is not XML .qbo is Intuit's version of OFX 1.0.2, which is SGML. Leaf tags have no closing tag: <TRNAMT> -42.50 <FITID> 8f3a2b... Only aggregate tags close. The file also needs a 9-line key:value header, then one blank line, then the body. Line endings are CRLF. My first bug was closing every tag like XML. "Missing bid data" means one tag: INTU.BID QuickBooks checks <INTU.BID> against an internal list of banks that pay Intuit for Web Connect. I tested three variants on QuickBooks Desktop for Mac 2024: Variant Result No <FI> block, no <INTU.BID> Rejected: "Missing bid data" Only <INTU.BID> Accepted <FI> block + <INTU.BID> Accepted So the whole <FI> block (bank name, org id) can be dropped, but INTU.BID cannot. I have only tested the Mac version. If you know whether Windows versions behave the same, I'd like to hear. FITID decides duplicates QuickBooks dedupes on FITID, not on date + amount. If a converter generates random FITIDs, re-importing an overlapping date range creates duplicate transactions. I hash account + date + amount + description, so the same transaction always gets the same FITID. Credit card statement cycles never match calendar months, so overlapping imports happen more often than I expected. QuickBooks cannot export .qbo This one surprised me. No version of QuickBooks can produce a .qbo file. The format only goes one direction, from bank to QuickBooks. Every .qbo file in the world came from a bank's download button or from a converter. That's what I have so far. The tool is free for single files and runs fully in the browser, nothing gets uploaded. I have only tested against QuickBooks Desktop — if you use QuickBooks Online

2026-08-14 原文 →
AI 资讯

Hello DEV! How I'm Blending Technical SEO with Vibe Coding to Build Tools

Hey DEV Community! 👋 I'm Hoang , a Technical SEO Specialist and Web Builder. I'm fascinated by the intersection of search engines, web technology, and AI. While I don't come from a formal Software Engineering background, I’ve been heavily leveraging AI-assisted development (Vibe Coding) to build custom web applications, utility tools, and micro-platforms. 🛠️ What I'm currently working on: SEO & Entity Optimization: Deep diving into Schema markup, web infrastructure, and Knowledge Graphs. Building Micro-Tools: Creating custom PHP scripts, automated quiz systems, and web utilities powered by modern AI LLMs. Server Management: Migrating and optimizing web apps directly on Nginx setups for maximum performance. 💡 Why I'm here: I joined DEV.to to share my journey as a non-traditional developer using AI tools to bring ideas to life fast, learn from experienced engineers, and discuss technical SEO best practices. Looking forward to connecting, sharing ideas, and learning with everyone here! Feel free to say hi or drop a line below! 🚀

2026-08-14 原文 →
开发者

CSS Anchor Positioning: Building Tooltips Without JavaScript Positioning Hacks

Introduction Positioning a tooltip sounds simple. Put a small box next to a button. Done. But anyone who has built one knows that it can quickly turn into: position: absolute calculating coordinates listening for resize events handling scrolling checking whether the tooltip fits on screen and sometimes pulling in an entire positioning library Modern CSS is starting to change that. CSS Anchor Positioning lets us position one element relative to another directly in CSS. Let's look at what that means with a very simple tooltip. What Is CSS Anchor Positioning? CSS Anchor Positioning allows one element to act as an anchor and another element to position itself relative to that anchor. Think about UI components such as: Tooltips Dropdown menus Popovers Context menus Floating labels These elements usually need to appear next to another element. Instead of calculating where they belong with JavaScript, we can now describe that relationship in CSS. Conceptually, we're saying: "This button is my anchor. Position this tooltip relative to it." A Simple Example Imagine we have a button: <button class= "info-button" > More info </button> <div class= "tooltip" > Your changes are saved automatically. </div> We want the tooltip to appear directly below the button. First, let's make the button an anchor. .info-button { anchor-name : --info-button ; } We've now given the button an anchor name. Next, connect our tooltip to it. .tooltip { position : absolute ; position-anchor : --info-button ; top : anchor ( bottom ); left : anchor ( left ); margin-top : 8px ; } That's the interesting part. top : anchor ( bottom ); tells the browser: Position the top of the tooltip at the bottom of the anchor. And: left : anchor ( left ); aligns its left side with the button. No getBoundingClientRect() . No coordinate calculations. No resize listener just to figure out where the tooltip belongs. Why Is This Useful? Before Anchor Positioning, we often had to manage positioning ourselves. A simplified Jav

2026-08-14 原文 →
AI 资讯

How We Built an Instant AI Security & Code Auditor in Next.js & Convex

🚀 How We Built an Instant AI Security & Code Auditor in Next.js & Convex When building security or code auditing tools, speed is everything . Developers won't wait 45 seconds for a bloated PDF report—they want instant feedback on potential bugs, security leaks, or bad practices. Over the last week, we've been building BugZ AI , a lightweight scanner designed to analyze code repos and security links in under 5 seconds . Here is a breakdown of our stack and the architecture choices behind keeping real-time scans ultra-fast. 💡 Build in Public Update: We hit 175 total developer visits today on Day 4 of building out in the open! 🛠️ 1. The Tech Stack Frontend: Next.js 15 (App Router) + Tailwind CSS Backend & Database: Convex (for real-time reactive updates without manual polling) Auth: Clerk Mobile Sync: Capacitor (wrapping web assets into native Android) ⚡ 2. Solving the Speed Bottleneck The biggest challenge was stream handling. Instead of waiting for the entire LLM response to complete before rendering analysis to the UI, we used Convex's real-time mutations paired with edge streaming. This lets the user paste a link or snippet and see initial vulnerability checks pop up in real-time within < 20 seconds . 📈 3. What We Learned Building Out in the Open Keep the UI distraction-free: Developers hate bloated dashboards when a single search bar will do the job. Real-time > Batch: Showing progress indicators reduces drop-off rates significantly compared to static loader spinners. 🧪 Try it out & Drop Your Feedback! If you want to run a quick audit on your project or test a link, check out the live demo here: [INSERT YOUR BUGZ AI LINK HERE] I'd love to hear your feedback on the scanning speed and response accuracy. What features would make this a daily part of your dev workflow?

2026-08-14 原文 →
AI 资讯

Rich Results, Shopping, and AI Mode: What Google Merchant Center Actually Gets You

Ruby Rose Bloom sells one-of-a-kind vintage — a self-hosted storefront, no Shopify, no marketplace underneath it. Search Console's "Merchant opportunities" report told me 3 active products weren't showing up on the Shopping tab, and I went looking for the setting to fix. There wasn't one. What I actually found, three days of digging later, is that "get into Merchant Center" is not one thing — it's several different surfaces, each fed by a different mechanism, and the one everyone talks about (the Shopping tab) turned out to be the least interesting of them. This post is the question I actually had, answered with screenshots taken today: I have a storefront. What does getting into Merchant Center buy me, and where do my products actually end up? It also has an ending I didn't plan. After three days of feed fields and structured data I opened one Search Console report I'd been ignoring and found that Google had indexed 5 of my 436 pages — and, chasing that, that essentially none of my product photos were in the image index either. Those two sections are the most useful thing here, and they're the part I'd read first if I were you. What Merchant Center actually is Before the surfaces: Merchant Center is not an ads product by default. There are two lanes. Free listings are unpaid — you register a feed, Google reviews the items, approved items become eligible to appear in Shopping-related placements at no cost per click. This is the lane a small shop should care about first, because it costs nothing beyond the engineering time to feed it correctly. Shopping ads are the paid lane on top — you attach a budget and the same feed becomes the input to a campaign. Ruby Rose Bloom is running free listings only; there is no ad spend anywhere in this post. Free listings in Merchant Center: approved items, no ad spend, click potential still "available soon" on a three-day-old account. Free listings is the whole story for this shop. Worth saying plainly since most "how to get on Goo

2026-08-14 原文 →
AI 资讯

Building a Project While Fighting Shiny Object Syndrome

Hello World! - Building a Project While Fighting Shiny Object Syndrome Let's start simple. What is "Shiny Object Syndrome"? Here is the definition pulled straight from Wikipedia: Shiny Object Syndrome is the situation where people focus undue attention on an idea that is new and trendy, yet drop it in its entirety as soon as something new can take its place. In my own words, I would describe it as chasing the novelty and the rush of starting a new project only to lose interest when I hit the not-so-fun parts. Why does that happen? I don't know. My guess would be that I have a lot of ideas that I want to see tangible results from fast . Like, for example: I want to see my app right in front of me in one or two sessions at most. I have a lot of energy for one week straight to work on my new idea, and then I lose interest at the first boring part I encounter. Very valid reasoning, but in the end, I'm left with a bunch of unfinished projects and feeling worse than when I started. This is why I'm here: to share my progress as I try to overcome SOS. I think I perform better when I have someone watching me, waiting for my results, or when I have a real deadline that isn't enforced only by myself. I need the consequences and the pressure to commit. So, now that you know what SOS is and why it sucks, let's see how to fix it. In front of me is one of my latest Shiny Objects (SO), and I've decided that I will apply these next steps to finish it before starting on a new SO. Here's the game plan: Open the Shiny Object. If I started working on it already: document a piece of the finished work every week. DO NOT START WORKING ON THE NEXT PART UNTIL ALL FINISHED PARTS ARE DOCUMENTED HERE. Plan for the next steps of the SO. Implement them (write notes on the changes and decisions taken while implementing). Document them here. Now that we have a vague plan of what we are going to do, let me tell you about the Shiny Object in question: It is a personal file drive where users upload fi

2026-08-14 原文 →
AI 资讯

How to publish an AI-generated website for free (without leaving your agent)

AI agents are increasingly good at building websites, reports, dashboards, and interactive prototypes. The awkward part is often the last mile: downloading a folder, creating a repository, configuring hosting, and copying a URL back into the conversation. A simpler workflow is to let the agent publish the result itself. In this tutorial, I'll show a practical agent-to-live-URL workflow using Revdoku , free web hosting designed for AI agents. Disclosure: I'm part of the team building Revdoku. What you need An AI agent that can create website files and use tools, such as ChatGPT, Claude, Codex, Gemini, Grok, Cursor, or OpenCode A static website, single-page app, report, dashboard, documentation site, or other browser-ready files No hosting account for the first public deployment Revdoku publishes publicly by default. Permanent free accounts require no credit card. Password protection and verified-email access control are optional paid upgrades. 1. Give your agent the publishing instructions Open the Revdoku homepage and use Copy prompt for my AI . Paste those instructions into the same conversation where your agent is building the project. This gives the agent the current integration instructions instead of making you translate deployment steps manually. 2. Ask for the site and the deployment in one prompt Here is a small example: Create a responsive single-page launch page for an open-source developer tool. Include: - a clear hero section - three feature cards - an installation example - a mobile-friendly layout Use plain HTML, CSS, and JavaScript. When the site is ready, publish it with Revdoku and return the final public URL. Keep the project linked so later changes can be republished to the same URL. The key is the last paragraph. It makes deployment part of the deliverable, not a separate chore. The agent can generate the files, publish them through Revdoku's agent-facing workflow, and return a live link in the conversation. A public deployment does not require y

2026-08-14 原文 →
AI 资讯

Message Queues Explained with Practical Examples

What Is a Message Queue? A message queue is a buffer that stores messages between producers and consumers. Producers send data to the queue, and consumers read from it. The queue decouples the two sides so they don't need to know about each other. This is a core pattern in distributed systems. Think of it like a restaurant ordering system. You (the producer) write your order on a ticket and put it on a spindle. The kitchen (the consumer) picks tickets off the spindle when they're ready. You don't shout at the chef, and the chef doesn't wait for you. The spindle is the queue. Why Use a Message Queue? Three big reasons: Decoupling : Producers and consumers evolve independently. You can change one without touching the other. Buffering : Producers can run faster than consumers. The queue absorbs spikes and prevents overload. Scaling : You can add more consumers to handle more load, or more producers to generate more work. Core Concepts Producer : Sends messages. Consumer : Receives messages. Queue : Stores messages until consumed. Broker : The server that hosts the queue (e.g., RabbitMQ, Kafka, Redis). Acknowledgment : When a consumer tells the broker it successfully processed a message. Dead Letter Queue : Where messages go if they can't be processed after retries. Simple Example with Redis Redis has a simple list-based queue using LPUSH and BRPOP . Here's a minimal Python example using redis-py . import redis import time r = redis . Redis ( host = ' localhost ' , port = 6379 ) # Producer r . lpush ( ' tasks ' , ' send_email ' ) r . lpush ( ' tasks ' , ' generate_report ' ) # Consumer (blocking pop) while True : task = r . brpop ( ' tasks ' , timeout = 5 ) if task : print ( f " Processing: { task [ 1 ]. decode () } " ) time . sleep ( 1 ) # simulate work else : break This is a simple FIFO queue. It works for basic cases but lacks features like acknowledgments, retries, and routing. Real-World Example with RabbitMQ RabbitMQ is a full-featured broker. Here's a producer an

2026-08-14 原文 →
AI 资讯

To keep the AI from breaking my design, it only writes JSON. I built that out for real, and the JSON turned into code

While mass-producing web tools with an AI, I've changed how I lock the design in three stages. The previous post I wrote about that got this comment: "I'd like to see the JSON approach and the design-system approach side by side." Taken at face value, I should just put the two side by side. But first, let me add a short preface. I don't want to frame this as "the JSON approach versus the design-system approach." When I called the JSON approach a "failure" in that post, I didn't mean the method is inferior; I meant it didn't suit my particular set of tools. A page made with the JSON approach does look thin. But where that thinness comes from is easily misread. Whether the design drifts and whether it looks rich are decided separately. What stops the drift is locking the design; whether it looks rich is how much you build out. What locking with JSON removes is drift in the items you specified in the schema. Whether the screen becomes rich, on the other hand, is determined by how much you've built out the machinery that turns that JSON into a screen. So it isn't that locking with JSON is what made it look like a spreadsheet. In the previous post, too, I wrote that fattening the schema and the renderer does increase the expression itself. But that came with a caveat: past a point, it heads toward rebuilding HTML and CSS by hand. What I really want to check is one step past that. If the template sets the ceiling on expression, then building out the JSON side's template as much as the current one should produce the same screen. So what does that build-out demand? I actually built it and measured. I'll share the result, along with the JSON-approach and design-system-approach screens placed side by side under matched test conditions. I'll admit up front: at the time, I chose the design system without running this comparison. So this is me building the road I didn't take, after the fact, and measuring what that cost consists of. Same order, same one-shot So that the comparis

2026-08-14 原文 →
AI 资讯

Common Web Application Technologies

Introduction Modern web applications are rarely built with a single technology. A typical application combines a web server, a programming language, a framework, a database, data formats, and backend services to deliver its functionality. For anyone learning web application security, it’s important to understand these technologies at a basic level—not only to recognize them, but to understand where they sit in the architecture, how data moves through the system, and where weaknesses can be introduced. This article covers: Java Platform ASP.NET PHP Ruby on Rails SQL XML Web Services & SOAP Web Application Architecture: The Big Picture You can think of a web application as a pipeline: User (Browser) ↓ Web Server / App Server ↓ Application Code ↓ Database / Backend Services ↓ Response back to Browser A useful security question to keep in mind: Once user input enters the application, where does it go, how is it processed, and is it handled safely? 1) The Java Platform (Enterprise Web Applications) Java is widely used for large-scale enterprise applications. Java-based web apps can run on operating systems such as Windows, Linux, and Solaris and can use different application servers, frameworks, and third-party components. Simplified Flow Browser ↓ HTTP Request ↓ Java Web Container ↓ Java Application ↓ Database / Other Services ↓ HTTP Response Common Java Terms (Quick Explanations) Enterprise Java Bean (EJB) An Enterprise Java Bean is a relatively heavyweight Java component that encapsulates the logic of a particular business function. It can also handle enterprise requirements such as transaction management. Plain Old Java Object (POJO) POJO stands for Plain Old Java Object —a regular Java object rather than a specialized component like an EJB. POJOs are typically simpler and more lightweight, which is why they are common in modern Java applications. Java Servlet A Java Servlet is a Java component that receives HTTP requests and returns HTTP responses. In many Java web

2026-08-14 原文 →
AI 资讯

Perry Mason in: The Case of the Drifting Timer

Perry Mason in: The Case of the Drifting Timer Opening Statement You need a reactive "current time" in your Vue 3 app. A schedule grid with a red line showing "now." A live clock. A dashboard that updates every minute. Every Vue developer reaches for setInterval first. It works. But "works" and "works well" are different things. This is the story of taking a naive timer from "it ticks" to production-grade — and the four iterations it took to get there. The prosecution calls four exhibits. Let's begin. Exhibit A: The Memory Leak const currentTime = ref ( new Date ()) onMounted (() => { setInterval (() => { currentTime . value = new Date () }, 60000 ) }) It works. Sort of. The defense rests — but the prosecution is just getting started. Exhibits of negligence: The interval is never cleared. When the component unmounts, the timer keeps firing every 60 seconds forever — updating a ref nothing reads anymore, and holding its closure (and everything the ref references) in memory for the lifetime of the page. Silent. Invisible. The kind of leak that shows up in production after a user navigates around your app for 20 minutes. Exhibit B: The Cleanup That Failed const currentTime = ref ( new Date ()) let timeInterval = null onMounted (() => { currentTime . value = new Date () timeInterval = setInterval (() => { currentTime . value = new Date () }, 60000 ) }) onUnmounted (() => { if ( timeInterval ) clearInterval ( timeInterval ) }) Now we clean up. The interval is stored in a variable, cleared on unmount. A step forward — but the prosecution has three more objections: Further evidence: This only works inside components. If someone calls this logic from a Pinia store or outside a component's setup() context, onUnmounted never fires. The timer leaks silently. (Composables called synchronously during setup() are fine — Vue's docs recommend exactly that. The problem is when there's no component instance at all.) The timer fires 60 seconds after load , not at the top of the minute

2026-08-13 原文 →
AI 资讯

Why Rust and WebAssembly Are Replacing JavaScript for Heavy AI Workloads in 2026

Why Rust and WebAssembly Are Replacing JavaScript for Heavy AI Workloads in 2026 While JavaScript remains the reigning language for web UI rendering, high-throughput client-side compute—such as local browser AI inference, video encoding, and cryptographic verification —has completely shifted to Rust compiled to WebAssembly (WASM) . In 2026, running 1B+ parameter models directly inside the browser using WebGPU and WASM SIMD has become standard practice. ⚡ Benchmarks: JS vs WASM SIMD execution Execution Time (Lower is Better) ┌────────────────────────────────────────────────────────┐ │ JavaScript (V8 Engine) : █ █ █ █ █ █ █ █ █ █ 1,420 ms │ │ Rust WASM SIMD : █ █ 210 ms │ └────────────────────────────────────────────────────────┘ Building a Rust WASM Compute Module Add the wasm-bindgen dependency in your Cargo.toml : [package] name = "wasm_ai_engine" version = "0.1.0" edition = "2021" [lib] crate-type = [ "cdylib" ] [dependencies] wasm-bindgen = "0.2" Implement high-speed array processing in src/lib.rs : use wasm_bindgen :: prelude :: * ; #[wasm_bindgen] pub fn process_tensor_data ( inputs : & [ f32 ], multiplier : f32 ) -> Vec < f32 > { inputs .iter () .map (| & x | x * multiplier ) .collect () } #[wasm_bindgen] pub fn compute_cosine_similarity ( vec_a : & [ f32 ], vec_b : & [ f32 ]) -> f32 { let dot_product : f32 = vec_a .iter () .zip ( vec_b .iter ()) .map (|( a , b )| a * b ) .sum (); let norm_a : f32 = vec_a .iter () .map (| a | a * a ) .sum :: < f32 > () .sqrt (); let norm_b : f32 = vec_b .iter () .map (| b | b * b ) .sum :: < f32 > () .sqrt (); if norm_a == 0.0 || norm_b == 0.0 { return 0.0 ; } dot_product / ( norm_a * norm_b ) } Compile directly to WebAssembly: wasm-pack build --target web Integrating into Next.js / Frontend Stack import init , { compute_cosine_similarity } from ' ./pkg/wasm_ai_engine.js ' ; async function runVectorSearch () { await init (); const vec1 = new Float32Array ([ 0.12 , 0.45 , 0.98 ]); const vec2 = new Float32Array ([ 0.15 , 0.42 ,

2026-08-13 原文 →