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

今日精选

HOT

最新资讯

共 27340 篇
第 16/1367 页
AI 资讯 Dev.to

136 raw removals, 17 real ones: what a spec diff over-reports

Originally published at mendapi.com . Between two published snapshots of the Cloudflare OpenAPI schema — 7abe88500e55 (2026-03-31) → c92b9b0fde23 (2026-07-27) — a raw structural diff produced 6,354 change records. 136 of them were endpoint path removals, the scariest kind a diff can report: the route your code calls is simply gone from the spec. Except 119 of those 136 were not gone at all. This is the accounting of how we know, per record, with machine evidence. The trap in a raw diff A path removal in a spec diff means one thing: the string key disappeared from the paths object. It does not mean the runtime URL stopped working. Specs get refactored — concrete routes collapse into templated ones, path parameters get renamed, methods get merged — and every one of those refactors shows up as a "removal" if you only look at one side of the diff. An alerting tool that pages you 136 times for this corridor is training you to ignore it. The whole job of the curation layer is to keep that from happening without silently dropping a real break. The ledger: 17 + 119 = 136 Every one of the 136 raw removals has an adjudicated destination. 17 were kept as genuinely client-breaking: the runtime URL or method really disappeared, with no surviving successor. The other 119 were excluded, each with machine evidence from the two spec snapshots that the surface actually survives: Template consolidation — 107 records. Concrete Workers AI model routes like /ai/run/@cf/baai/bge-m3 collapsed into the pre-existing generic /ai/run/{model_name} route. The runtime URL a client sends never changed; the spec just stopped enumerating each model. The evidence rule requires the templated route to exist in both snapshots and to swallow the removed path with a literal-anchored match, so a template that is merely a shape prefix of a genuinely removed endpoint does not count. Parameter rename, runtime-identical — 11 records. Path parameters renamed ( {postfix_id} to {investigate_id} and friends). Afte

mendapi 2026-08-02 08:18 3 原文
AI 资讯 Dev.to

Why I Fell in Love with Rust’s Memory Model (Even Though It’s Hard)

I’ve worked with languages like JavaScript and Go , and I enjoyed both for different reasons. JavaScript gave me speed and flexibility. Go gave me simplicity and practical concurrency. Then I met Rust and at first, it felt difficult. But once I understood how Rust handles memory without a garbage collector , I fell in love with it. Memory Safety Without a Garbage Collector Most modern languages solve memory management with a garbage collector (GC) . A GC periodically finds memory that is no longer used and frees it automatically. Rust takes a different path: No runtime garbage collector No manual free() like in C Memory safety guaranteed at compile time (in most cases) Rust uses three core ideas: Ownership Borrowing Lifetimes These rules are checked by the compiler before your program runs. 1) Ownership: One Owner at a Time In Rust, every value has a single owner. When the owner goes out of scope, Rust automatically drops the value and frees memory. { let s = String :: from ( "hello" ); // s owns the string memory here } // s goes out of scope, memory is freed automatically This avoids memory leaks and double-frees in normal code paths, without needing a GC pause. 2) Borrowing: Use Data Without Taking Ownership Instead of copying or transferring ownership all the time, Rust lets you borrow references: Immutable borrow: &T Mutable borrow: &mut T But Rust enforces strict aliasing rules: Many immutable references OR One mutable reference Not both at the same time This rule prevents data races at compile time. 3) Lifetimes: References Must Always Be Valid Lifetimes describe how long references are valid. Often, Rust infers lifetimes automatically. When needed, you can annotate them. This helps prevent dangling references references to memory that no longer exists. How Rust “Behaves” in Practice When writing Rust, you feel the compiler acting like a strict mentor: “Who owns this value?” “How long does this reference live?” “Are you mutating while also sharing?” “Could th

Kamal Rhrabla 2026-08-02 08:16 4 原文
AI 资讯 Dev.to

nestjs-docfy: mock servers, contract testing, and a much sharper MCP server

A few weeks ago I shared nestjs-docfy here — a library that moves Swagger decorators out of NestJS controllers into companion *.controller.docs.ts files, docfy-ui as an AI-first reference UI, and docfy-mcp exposing your API catalog to coding agents via list_endpoints / get_endpoint . Since then the CLI grew a full local dev workflow around the spec itself, and docfy-mcp went from "read the docs" to "verify the API is telling the truth." docfy mock : a server without the server \ shell npx nestjs-docfy mock --spec openapi.json --port 4010 \ \ Spins up a throwaway HTTP server straight from your OpenAPI document — every path returns a schema-shaped response. Useful for frontend work against an API that isn't built yet, or for pointing an agent at something real instead of a static spec file. docfy test : contract testing off the spec \ shell npx nestjs-docfy test --spec openapi.json --base-url http://localhost:3000 \ \ Fires a real request at every documented endpoint and validates the live response against its declared schema. Catches the exact failure mode API docs are famous for: the code moved on, the docs didn't. CI-friendly, non-zero exit on drift. docfy init : zero to configured \ shell npx nestjs-docfy init \ \ One command, scaffolds the docfy-export.ts entry file and wires DocfyModule.forRoot() for you. No more copy-pasting from the README. --link-controller : less boilerplate \ shell npx nestjs-docfy generate --link-controller \ \ Auto-inserts @WithDocs() into the controller so newly generated .controller.docs.ts files are actually wired in — one less manual step per endpoint. Breaking changes, surfaced in the PR itself docfy-pr-check-reusable.yml now runs a spec diff and posts breaking vs. informational field changes as a PR comment. You see the blast radius of an API change before merge, not after a consumer files a bug. docfy-mcp: from lookup to verification The MCP server picked up three tools that turn it from a reference into an actual QA loop for agent

Marvin Rocha 2026-08-02 08:15 1 原文
开发者 Dev.to

I built 38 free browser-only tools that never upload your files

Every time I needed to "compress an image online" or "merge a PDF", I ended up on some site that makes you upload your file to their server. For a random meme, fine. For a contract, an ID scan, or anything private? No thanks. So I built QuickKit — a growing kit of 38 free tools that run 100% in your browser. Your files and text never leave your device. No signup, no watermarks, no tracking of what you process. How it works (the fun part) The whole thing is a static site — no backend, no database, no server cost. Everything happens client-side with browser APIs: Image compressor / resizer → the Canvas API ( canvas.toBlob(type, quality) ) Image → PDF / Merge PDF → jsPDF and pdf-lib, entirely in-page Password / UUID generators → the Web Crypto API ( crypto.getRandomValues ) for real cryptographic randomness QR codes → generated locally, no redirect or tracking baked in Hash generator (SHA-256/1/512) → the SubtleCrypto API Countdown timer & "days since" counters → shareable via the URL itself (state encoded in query params), so there's still no backend Because nothing is uploaded, the tools are faster and more private than upload-based services — and they even work offline once loaded (it's an installable PWA). A few of the tools Files & docs: image compressor, image resizer, image→PDF, merge PDF. Dev utilities: JSON formatter, Base64, hash generator, UUID, timestamp converter, case converter. Everyday: QR generator, word counter, unit/percentage/age calculators, world clock, "your life in weeks". The privacy architecture, in one line If the browser can do it, there's no reason to send the user's data to a server. That principle killed all the usual costs (no servers, no storage, no compliance headaches) and made privacy the default instead of a feature. Would love feedback — especially on tools you wish existed. What "online X converter" do you use that you wish ran locally? 👉 quickkit.space

PabloFede 2026-08-02 08:05 5 原文
AI 资讯 Dev.to

Fly.io vs Railway: Deployment, Pricing, and Features Compared

Two usage-based cloud platforms with different defaults — a CLI-and-primitives approach versus a repo-first, visual-canvas workflow. Here is how they line up as of 2026-07-29. Fly.io and Railway both let you deploy apps and services and pay for what you use, but they start from different defaults. Railway centers on connecting a Git repository and letting the platform read your code and configure the deploy, all viewed on a visual canvas. Fly.io centers on the flyctl command line and a documented catalog of infrastructure primitives, from machines to managed databases and GPUs. This comparison walks through how each platform handles deployment, pricing, databases, networking, and scaling, using each vendor page as of 2026-07-29. Plan details and prices change often, so treat the figures here as a snapshot and confirm the current terms on each site before you commit. At a glance In short Both are usage-based platforms for shipping apps. Pick Railway to connect a repo and let the platform configure, preview, and roll back deployments from a visual canvas. Pick Fly.io for CLI-driven control plus a documented catalog of Managed Postgres, GPUs, Kubernetes, and HIPAA-ready hosting. Pricing and features noted here are as of 2026-07-29. Head to head Key differences side by side. Feature Fly.io Railway Billing model Usage-based, pay-as-you-go for micro VMs and storage; pricing calculator (as of 2026-07-29) Usage-based, billed per second (as of 2026-07-29) Plan tiers No named consumer tiers; usage plus paid add-ons (as of 2026-07-29) Free $0, Hobby $5/mo min, Pro $20/mo min, Enterprise custom (as of 2026-07-29) Deploy & configuration flyctl CLI and fly launch; config in fly.toml (as of 2026-07-29) Connect repo, auto-config from your code, visual canvas, YAML optional (as of 2026-07-29) Global footprint 18+ regions, sub-second machine boot, 99.9% uptime SLA (as of 2026-07-29) Global deployment, run closer to users; homepage listed no region count (as of 2026-07-29) Managed dat

stack_versus 2026-08-02 08:03 1 原文
AI 资讯 Dev.to

Where to Publish a Web Game in 2026

A finished browser game is a bundle of static files. Whether you built it in Phaser, Three.js, Babylon.js, Godot, or plain canvas code, the output uploads anywhere, which is exactly why the publishing decision trips people up. Every channel accepts the same build, so the choice is never technical. It is about who owns the audience, who owns the money, and who owns the URL. Here is how the three channels actually compare once you have shipped to all of them. The Three Channels Game portals aggregate thousands of titles, monetize with ads, and share revenue. Indie platforms like itch.io act as storefronts you control, with community feedback attached. Self-hosting on your own domain gives you everything except an audience. Most developers who do this well use more than one at the same time. The marginal cost of adding a channel is usually just reading the submission guidelines and wiring up an SDK, so treating them as either/or leaves reach on the table for no reason. What Portals Actually Require CrazyGames reaches over 20 million monthly players and runs a two stage process. Basic Launch takes your game with minimal integration and tests it with a limited audience for around two weeks. Hit their engagement benchmarks and you are invited to Full Launch, which needs the full SDK for ads, auth, cloud saves, and analytics. Their technical bar for Basic Launch is an initial download under 50 MB, fewer than 1,500 files, and PEGI 12 content. Poki is curated and editorially reviewed, leans mobile-responsive, and pulls strong search traffic with a younger audience. GameDistribution syndicates across hundreds of publisher sites through an embed widget, so you get reach but little brand visibility. Newgrounds still rewards experimental work with a community that engages rather than an SDK that monetizes. The trade in all four cases is the same: the portal brings the players, and in return it owns the player relationship and can change terms whenever it wants. Self-Hosting With

Paul Crinigan 2026-08-02 08:03 1 原文
AI 资讯 Dev.to

Optimizing Large-Scale MongoDB Aggregation Pipelines for Performance

Originally published on tamiz.pro . MongoDB aggregation pipelines are powerful tools for processing and transforming data directly within the database. However, when dealing with large datasets, poorly optimized pipelines can become a significant performance bottleneck. This deep-dive explores advanced strategies and best practices to ensure your large-scale MongoDB aggregation pipelines run efficiently and effectively, transforming raw data into actionable insights without grinding your system to a halt. Table of Contents Understanding the Aggregation Pipeline Lifecycle The Critical Role of Indexing Indexes for $match and $sort Stages Compound Indexes and Covered Queries Partial Indexes for Specific Workloads Strategic Stage Ordering Pushing $match and $project Early Leveraging $sort and $limit Together Memory Management and Disk Spills allowDiskUse and its Implications Strategies to Minimize Disk Spills Leveraging the Query Optimizer and Explain Plan db.collection.explain() Interpreting Explain Plan Output Sharding Considerations for Aggregations Shard Key Design for Aggregation Workloads Targeted vs. Broadcast Aggregations Advanced Optimization Techniques Using $lookup for Joins and its Performance Impact Optimizing $group Stages Batching and Incremental Aggregations Production Best Practices Frequently Asked Questions Understanding the Aggregation Pipeline Lifecycle Before diving into optimizations, it's crucial to understand how MongoDB processes aggregation pipelines. An aggregation pipeline is a sequence of stages that process documents from a collection. Each stage performs an operation on the input documents and outputs a stream of documents to the next stage. This stream-based processing is key to its efficiency, but it also means that the output of one stage directly impacts the performance of subsequent stages. The MongoDB query optimizer attempts to reorder certain stages for efficiency, but it's not omniscient. Your strategic design choices profoundly

Tamiz Uddin 2026-08-02 08:01 1 原文
AI 资讯 Dev.to

🐍 Fixing a `google-genai` Version Mismatch and Verifying the Behavior with pytest [1/3]

Introduction Hello from Japan! 🇯🇵 I am tosane932 , a professional truck driver working in logistics while teaching myself Python. In my previous article, I tested a Docker multi-stage build and measured the actual change in image size. At the end of that article, I said that I would write next about pytest and CI/CD. This article was supposed to be the practical follow-up. However, while preparing for that work, I encountered an unexpected side issue. I only intended to introduce Flask-Migrate. Instead, the pip installation logs revealed that the version of a library in my local development environment had been changed without me noticing. The library was: google-genai From there, I went through the following process: Identify the version mismatch Restore the version that had already been tested locally Update requirements.txt Manually verify the Gemini API functionality Run pytest to check for regressions This article records that process without hiding the inconvenient parts. https://github.com/tosane932/sales_data_app Overview While installing Flask-Migrate, I noticed a mismatch between: The version of google-genai installed in my local development environment The version declared in requirements.txt The local environment had been using: google-genai 2.10.0 However, requirements.txt still specified: google-genai==2.4.0 When I ran: pip install -r requirements.txt pip followed the configuration file and replaced the newer local version with the older declared version. This article explains how I discovered the issue, synchronized the environments, and verified the application behavior with automated tests. 1. The Problem and Its Background I was preparing to introduce Flask-Migrate. During that work, I ran: pip install -r requirements.txt The installation log contained the following lines: Attempting uninstall: google-genai Found existing installation: google-genai 2.10.0 Uninstalling google-genai-2.10.0: That message caught my attention. After checking the environ

tosane932 2026-08-02 08:00 1 原文