Skip to content

feat: shared dual-compiler web gate (dart2js + dart2wasm) - #20

Merged
chaudharydeepanshu merged 2 commits into
mainfrom
feat/web-verify-gate
Jul 6, 2026
Merged

feat: shared dual-compiler web gate (dart2js + dart2wasm)#20
chaudharydeepanshu merged 2 commits into
mainfrom
feat/web-verify-gate

Conversation

@chaudharydeepanshu

@chaudharydeepanshu chaudharydeepanshu commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Two gate changes that re-stamp together.

1. New verify_web_gate.sh — dual-compiler web gate

Compiles a consumer's example under both web compilers (flutter build web + --wasm), registered in stamped-files.txt so it's drift-guarded into consumers. A user hit a dart2wasm compile error on a package whose CI was fully green: dart2js and dart2wasm have different type models, and nothing in the toolchain compiles wasm (the analyzer + dart2js use the JS model, the interop lint misses switch patterns, pana's wasm tag is an import heuristic). This gate is the only honest check.

2. Gates require their inputs — no env-var fallback

development-standards.md bans ${VAR:-default} env-var fallbacks in scripts — they create hidden branching where a laptop and CI silently diverge. analyze_core, platforms_gate, and the new gate now require DART / FLUTTER / EXPECTED_PLATFORMS via :? (crash clear if unset). The single default stays in the Makefile (FLUTTER ?= fvm flutter), which passes the values explicitly. verify_web_gate hardcodes example/ (fixed Flutter layout, §1.3). analyze_core keeps its filesystem auto-detection (deterministic, not a fallback).

Adoption

Consumers bump their pin to the tag this cuts, re-stamp all three gates, and pass the now-required vars from their verify-web / analyze / platforms targets. Verified: make lint-shell clean.

verify_web_gate.sh compiles a consumer's example under both web compilers.
dart2js and dart2wasm have different type models, so js-interop code that
dart2js accepts (a non-exhaustive JSAny switch, an unsound interop cast)
dart2wasm can reject. Nothing in the toolchain caught this: the analyzer and
dart2js use the JS model (switch looks exhaustive), and pana's wasm tag is an
import heuristic, not a compile. A user hit it (pdf_manipulator web WASM build)
while CI stayed green.

The gate is added to stamped-files.txt so it's drift-guarded into consumers
like the other tool/ gates. Consumers wire verify-web to run it (both compilers,
existing web CI rows pick it up).
@chaudharydeepanshu
chaudharydeepanshu requested a review from a team as a code owner July 6, 2026 13:06
@slopfairy

This comment has been minimized.

slopfairy

This comment was marked as outdated.

development-standards.md bans ${VAR:-default} env-var fallbacks in scripts —
they create hidden branching where a laptop and CI silently diverge. The gates
now require DART / FLUTTER / EXPECTED_PLATFORMS via :? (crash clear if the caller
didn't set them). The one default lives in the Makefile (FLUTTER ?= fvm flutter),
which passes the values explicitly.

verify_web_gate hardcodes example/ (the fixed Flutter package layout, not a
config value). analyze_core keeps its filesystem auto-detection of ANALYZE_DIRS /
EXAMPLE_DIR — deterministic detection, not an env fallback.

Consumers pass the now-required vars from their Makefile targets on adoption.
@slopfairy

This comment has been minimized.

@slopfairy slopfairy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Approved — clean addition of the dual-compiler web gate with required-env hardening across all gate scripts

Checked

  • tool/verify_web_gate.sh — new shared gate; set -euo pipefail, FLUTTER enforced via :? (no fallback), intentional SC2086 on the multi-word $FLUTTER with explanatory comment, bash-3.2 portable throughout
  • tool/analyze_core.sh — DART and FLUTTER changed from ${VAR:-fvm dart} defaults to :? required; ANALYZE_DIRS and EXAMPLE_DIR auto-detection kept intact (deterministic, not a fallback); header comment updated accurately
  • tool/platforms_gate.sh — DART and EXPECTED_PLATFORMS changed from defaults to :? required; PANA_VERSION :? guard unchanged; validations moved before the SCRIPT_DIR/cd block so failure is immediate
  • tool/stamped-files.txtverify_web_gate.sh added to the stamp list; correct
  • docs/CAPABILITY_ROADMAP.md — two new DONE entries, accurate and readable
  • No changes to .github/workflows/, actions/, hooks/, or tool/versions.env — no workflow-security, supply-chain, or injection surfaces touched
  • All scripts remain bash-3.2 portable (no case-modification expansions, no mapfile, no associative arrays); shellcheck disables are all intentional and commented

@chaudharydeepanshu
chaudharydeepanshu merged commit 712cb91 into main Jul 6, 2026
5 checks passed
@chaudharydeepanshu
chaudharydeepanshu deleted the feat/web-verify-gate branch July 6, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants