惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
博客园_首页
G
Google Developers Blog
博客园 - 【当耐特】
美团技术团队
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
小众软件
小众软件
博客园 - 司徒正美
雷峰网
雷峰网
T
Tailwind CSS Blog
V
V2EX
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
罗磊的独立博客
量子位
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Already using LaunchDarkly or Flagsmith? Here's how to tr...
Scott Tippett · 2026-06-22 · via DEV Community

Scott Tippett

Thinking about trying FtrIO? The new CLI makes it easy to start with just one feature flag

If you've been curious about FtrIO (the .NET feature toggle library that replaces if (featureFlags.IsEnabled(...)) with a [Toggle] attribute woven directly into your compiled IL) but weren't sure where to start, the experimental release of FtrIO.onetwo just made that first step a lot smaller.

You don't need to commit to a full migration. You don't need to rip out your existing flag library. You just need one method and 20 minutes.


What FtrIO.onetwo does

FtrIO.onetwo is a .NET CLI audit tool. Its default mode scans your source tree, finds every FtrIO toggle reference, and tells you exactly what's live right now:

dotnet tool install --global FtrIO.onetwo --version 1.1.1-experimental
ftrio.onetwo --source C:\Projects\MyApp

But in this experimental release it does two new things:

ftrio.onetwo import: pulls your current flag state from LaunchDarkly, Flagsmith, flagd, environment variables, or an HTTP endpoint directly into appsettings.json. Your existing flag library keeps working unchanged.

ftrio.onetwo migrate: scans your .cs files for LaunchDarkly or Flagsmith SDK call patterns using Roslyn, cross-references them against your live flag state, and generates a report showing exactly what each flag would look like in FtrIO and how to migrate it.


The "try it on one flag" workflow

The migrate report categorises every flag it finds:

  • Ready to migrate: boolean flag, no targeting rules, straightforward [Toggle] replacement
  • ⚠️ Needs review: targeting rules, number flags, needs a decision
  • Cannot migrate: JSON flags, recommend moving to IConfiguration

For every ready flag it shows the suggested refactor. Something like:

new-checkout-flow  NewCheckoutFlow
File: Services\OrderService.cs:42

Current code:
  if (client.BoolVariation("new-checkout-flow", user, false))
  {
      ValidateCart();
      ApplyDiscounts();
      ProcessPayment();
  }

Suggested action:
  Extract the if block into a parent method named NewCheckoutFlow,
  then decorate it with [Toggle]. The inner methods remain unchanged.

  [Toggle]
  public void NewCheckoutFlow()
  {
      ValidateCart();
      ApplyDiscounts();
      ProcessPayment();
  }

  Add to appsettings.json:
  "NewCheckoutFlow": false

Pick one of those ready flags. Do the refactor. Run the app. That's it: you've got FtrIO running in your codebase alongside your existing flag library, on exactly one feature, with everything else completely unchanged.

If you like how it feels, pick another. If you don't, remove the [Toggle] attribute and you're back to where you started.


Why the parent method suggestion matters

The report nudges toward a pattern that's worth calling out explicitly: one named parent method per toggled feature.

Instead of this:

if (client.BoolVariation("send-welcome-email", user, false))
{
    ValidateEmailAddress(user.Email);
    BuildEmailTemplate(user);
    SendViaSmtp(user.Email);
    LogEmailSent(user.Id);
}

FtrIO works best like this:

[Toggle]
public void SendWelcomeEmail()
{
    ValidateEmailAddress(_user.Email);
    BuildEmailTemplate(_user);
    SendViaSmtp(_user.Email);
    LogEmailSent(_user.Id);
}

The feature has a single, named, discoverable entry point. The toggle is a gate on the feature, not scattered through its implementation. The inner methods have no idea a toggle exists. This is better code regardless of FtrIO; the migration report teaches the pattern rather than just doing a mechanical find-and-replace.


Running the migration report

# With live flag state from LaunchDarkly
ftrio.onetwo migrate \
  --from launchdarkly \
  --api-key sdk-xxx \
  --project my-project \
  --env production \
  --source C:\Projects\MyApp \
  --markdown plan.md

# Code scan only, no API key needed
ftrio.onetwo migrate \
  --from launchdarkly \
  --source C:\Projects\MyApp

The --api-key is optional; without it the report still finds all your call sites and shows the suggested refactors, just with placeholder values in the appsettings.json snippets instead of live flag states.


This is experimental

Both import and migrate are in an experimental branch. To try it you need to explicitly request the experimental version — the default install will give you the stable release which doesn't include these commands yet:

dotnet tool install --global FtrIO.onetwo --version 1.1.1-experimental

Functional but not yet on a stable release. Feedback is genuinely welcome, especially on the migration report format and the flag mapping logic.

The full FtrIO ecosystem:

  • FtrIO: the core library: dotnet add package FtrIO
  • FtrIO.Toaster: self-hosted Docker UI for managing toggles live
  • FtrIO.onetwo: this CLI: dotnet tool install -g FtrIO.onetwo
  • Docs: ftronoff.github.io/FtrIO
  • GitHub: github.com/FtrOnOff

If you try it on a flag or two I'd love to hear how it goes; drop a comment or open an issue.