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.
Log in or sign up for Devpost to join the conversation.