fix: resolve local helper chains for Worker entry URLs - #9759
fix: resolve local helper chains for Worker entry URLs#9759proggeramlug wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThis change resolves bounded module-local helper chains used as Worker entry URLs. It integrates static helper evaluation into Worker collection, decodes valid ChangesWorker URL resolution
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The Worker helper-resolution change is bounded and covered across compiler and runtime paths, with no concrete issue blocking merge. Sequence Diagram(s)sequenceDiagram
participant WorkerCollector
participant resolve_worker_path
participant WorkerPaths
participant HIRModule
WorkerCollector->>resolve_worker_path: resolve Worker filename
resolve_worker_path->>WorkerPaths: evaluate helper chain
WorkerPaths->>HIRModule: inspect bindings and helper bodies
HIRModule-->>WorkerPaths: return static path candidates
WorkerPaths-->>resolve_worker_path: return Resolution
resolve_worker_path-->>WorkerCollector: provide Worker path
sequenceDiagram
participant collect_modules
participant resolve_worker_path
participant Url
participant WorkerGraph
collect_modules->>resolve_worker_path: resolve non-eval Worker filename
resolve_worker_path-->>collect_modules: return path or file URL
collect_modules->>Url: parse and decode file URL
Url-->>collect_modules: return filesystem path
collect_modules->>WorkerGraph: record import edge and Worker path
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 45.16% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 31 functions across 8 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed on |
Bun standalone bundles commonly put a Worker entry URL behind small local helper functions. Collection ran before inlining, left those calls unresolved, and emitted a constructor that threw instead of starting the worker. Resolve bounded helper chains while collecting Worker entries, then decode static file URLs before normal file lookup and
--bunfs-rootmapping. The original filename expression still executes at construction.The Worker-only resolver supports function declarations, const closures/aliases, concise arrows and single-return bodies with exact simple string/URL arguments. It reuses the existing static path operations and registry convention, distinguishes URL carriers from strings, rejects reassigned bindings/effectful bodies/opaque calls/recursion, and bounds candidates, depth, work and path length. Dynamic imports and eval-mode Worker source resolution keep their existing behavior; each Worker must still resolve to one entry. The supported subset and limits are documented.
Validation:
ready.PERRY_CONCAT_SITE_CACHEregistry test failed. That baseline failure is fixed separately by fix(cache): register concat switch and explain codegen inputs #9748.Fixes #9744. No version bump.
Summary by CodeRabbit
Bug Fixes
file:URLs, including paths containing spaces.Documentation