Skip to content

fix(parser): extract side-effect imports from requested_modules#173

Merged
rocketman-code merged 1 commit intomainfrom
fix/side-effect-imports
Feb 22, 2026
Merged

fix(parser): extract side-effect imports from requested_modules#173
rocketman-code merged 1 commit intomainfrom
fix/side-effect-imports

Conversation

@rocketman-code
Copy link
Owner

Summary

  • Side-effect imports (import "./polyfill") were silently dropped because extract_all only read ModuleRecord.import_entries, which requires bindings
  • Added extract_side_effect_imports to scan requested_modules for import statements not covered by import/export entries
  • Real-world impact: 57 missed imports in openclaw, 2 in workers-sdk (including import "cloudflare/shims/web" in CLI entry)

Test plan

  • 3 new unit tests: side_effect_import, side_effect_import_with_named, side_effect_import_not_duplicated
  • Verified against openclaw and workers-sdk
  • Full test suite passes (464 tests)

Closes #171

Side-effect imports (import "./polyfill") were silently dropped because
extract_all only read ModuleRecord.import_entries, which requires
bindings. Scan requested_modules for import statements not covered by
import/export entries, with a fast-path skip when all entries are
already covered (the common case).

Closes #171
@rocketman-code rocketman-code force-pushed the fix/side-effect-imports branch from 2a15223 to 56093fd Compare February 22, 2026 23:30
@rocketman-code rocketman-code merged commit 61935b5 into main Feb 22, 2026
8 checks passed
@rocketman-code rocketman-code deleted the fix/side-effect-imports branch February 22, 2026 23:35
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.

Bug: side-effect imports (import "./foo") silently dropped

1 participant