Baseline Guard Suite – Ship Modern Web Features Without Fear πŸš€

Baseline Guard Suite helps developers confidently use the latest Web Platform features like :has(), import maps, container queries, URLPattern, view transitions, URL.canParse(), Array.prototype.at(), Promise.any(), and more without worrying about browser support.

It automatically scans, classifies, and guards risky features while suggesting progressive-enhancement patterns. It works where you work in your editor, CI pipeline, and automation workflows turning β€œCan we safely adopt this?” into β€œWe already did.”

Inspiration The modern web evolves fast. Teams often face a trade-off:

Play it safe: Avoid new APIs, slowing innovation and UX. Take a gamble: Ship them anyway, risking breakage in unsupported browsers. While documentation lists compatibility, it rarely connects to the browsers you target. We built Baseline Guard Suite to operationalize progressive enhancement, moving it from tribal knowledge to automated, reliable practice.

What It Does Baseline Guard Suite:

πŸ”Ž Scans HTML, CSS, and JS/TS for modern API usage 🟒 Classifies each feature as safe, needs guard, already guarded, or baseline-filtered 🎯 Adapts advice to your declared browser targets (via browserslist or config) ⚑ Suggests & applies guards/fallbacks in one click β€œFix All” or quick fixes πŸ“ Generates diagnostics in VS Code, CLI, GitHub Actions, SARIF, and HTML reports πŸ’ͺ Never fails silently: a resilient regex analyzer backs up AST analysis to guarantee insights πŸ”§ Allows policy tuning: unsupported thresholds, safe-visibility toggles, ignored features πŸ‘₯ Enables team-wide reproducibility for progressive-enhancement policies

Core Features πŸ–₯️ VS Code Extension: Real-time diagnostics + quick-fix code actions πŸ› οΈ CLI / GitHub Action: Enforce thresholds in CI, produce HTML & SARIF reports πŸ”„ Fallback Analyzer: Guarantees meaningful results even in constrained environments 🎯 Target-Aware Advice: Tailored risk assessments based on your browser support matrix πŸ€– Guard Heuristics: Detects conditional usage to minimize redundant warnings πŸ” Debug Tools: Status bar insights, debug dump, structured logs

How We Built It Language: TypeScript (monorepo: core engine, VS Code extension, CLI, helpers) Analyzer: Hybrid AST + curated regex library (AST for precision, regex for resilience) Compatibility Intelligence: Derived from feature lists, browserslist, and evolving Baseline data Packaging: Custom bundler embeds core logic and dependencies cleanly inside VSIX Output Formats: VS Code diagnostics, SARIF for code-scanning, HTML and JSON reports

Challenges We Overcame βš™οΈ Packaged vs Dev Behavior: Hoisted dependencies broke VSIX runtime solved via explicit dependency staging + multi-strategy loader 🚨 Zero-Finding Failures: AST sometimes returned empty paths solved by mandatory fallback layer 🧩 Guard Detection: Differentiating risky usage from already-guarded idioms without full control-flow parsing ⚑ Performance vs Fidelity: Balanced deep parsing with instant editor feedback 🌍 Cross-Environment Parity: Ensured identical advice across editor, CI, and GitHub Actions

Accomplishments βœ… Resilient Fallback System: β€œNever empty unless truly none found” πŸ”„ Robust Analyzer Loader: Handles bundling and path discrepancies gracefully 🌐 Consistent Multi-Surface Experience: Same semantics in editor, CI, and reports πŸ“š Practical Guard Snippet Library: Lowers friction to adopt new APIs πŸ“Š Threshold Mechanism: Turns raw compatibility data into actionable decisions

What We Learned πŸ”‘ Developer trust requires predictable, non-silent failure modes πŸ› οΈ Progressive enhancement thrives when automated, not manual πŸ’‘ Editor-time ergonomics encourage adoption more than late CI failures 🎯 Minimal yet effective heuristics dramatically cut false positives

Impact πŸš€ Speeds adoption of modern Web APIs β†’ better UX and performance πŸ›‘οΈ Reduces regressions in partially supported browsers πŸ“ˆ Standardizes progressive-enhancement discipline across distributed teams πŸ“Š Provides measurable modernization metrics (features guarded vs safe)

Tech Stack TypeScript Monorepo (core engine, VS Code extension, CLI) Node.js runtime VS Code Extension API Browserslist ecosystem SARIF + HTML generation for reports

Developer Flow Install VS Code extension Open a project β†’ see instant diagnostics Run β€œBaseline: Scan Workspace” for full coverage Apply β€œFix All” to add guards/fallbacks automatically CI uses CLI or GitHub Action β†’ blocks risky unguarded features exceeding thresholds

Example Scenario A team wants to use container queries, :has(), and view transitions. Without Baseline Guard Suite: endless reviews debating browser support. With Baseline Guard Suite: flagged once β†’ guards applied β†’ committed β†’ shipped the same day.

Measuring Success ⏱️ Time to adopt a new feature (before vs after) πŸ›‘οΈ Guard coverage ratio πŸ“‰ CI regressions related to unsupported features (goal: near-zero) πŸ’¬ Developer sentiment on β€œcompatibility anxiety”

What’s Next πŸ“¦ Size optimization for bundled VSIX πŸ“Š Richer compatibility scoring & progressive rollout tiers πŸ“‘ Opt-in telemetry for anonymous feature-adoption analytics 🧩 IDE integrations beyond VS Code (JetBrains, etc.) βš™οΈ Auto-patch mode to apply guards under a safe flag πŸ” Deeper AST semantics for chained and optional patterns

Call to Action Adopt modern Web APIs today without betting your production baseline. Baseline Guard Suite makes progressive enhancement automatic, safe, and team-friendly.

πŸ‘‰ Ship modern features faster. Sleep better at release time.

Share this project:

Updates