fix: dev-loop hygiene and the electron named exports - #19
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacks on #18. Phase 2a of the dev-loop plan — the cheap, high-payoff half. Does not yet add a renderer build step (that is 2b, and it is what finally kills the React-restart problem).
What was wrong
Seven root causes were traced for the two reported symptoms. This PR closes four of them.
touchor a formatter rewriting identical bytes no longer fires. First sight of a path still passes (no baseline to compare against) — the filter earns its keep from the second save onward.distignored, build output watcheddistremoved from the ignore list, so a rebuilt renderer bundle finally reaches the window.build/out/coverageand any*.app/*.AppDirsegment ignored instead, becausebunmaska builddefaults its output to the project root.BrowserWindowconstructor, soreload()re-injects the old source forever. Apreload.*change now restarts, which is the honest action. Verified end to end: editing the preload used to printPRELOAD-V1after the reload; it now printsPRELOAD-V2.kill()only delivers a signal, so respawning immediately left two live apps racing for the window and the single-instance lock. The restart now awaits the old child's exit. The supervisor also tracks liveness: after the user quits, a renderer edit saysapp is not runninginstead of printingreloadedat a corpse.Also: the watcher classifies before hashing, so
node_moduleschurn never costs a file read.Engine pin
bunmaska devandbunmaska runnever readconfig.engine.webkit— onlybuildanddoctordid — so a dev launch silently resolved to the system WebKit, which on Windows means no engine at all. Both now passBUNMASKA_WEBKIT_IDto the child.The electron shim
import { app, BrowserWindow } from "bunmaska/electron"— the exact line inmigrating-from-electron.md:23, for the flagship drop-in feature — threwSyntaxError: Export named 'app' not found. The module had only a default export. Addingexport * from './index'fixes the documented path; the default export's Proxy still turns a property access on an unimplemented module into the actionable message, which I checked both ways.Tests
Every new behaviour was mutation-checked — I reverted each fix in turn and confirmed a test goes red, rather than assuming coverage:
awaiton child exit → the restart-race test failsbun run validateEXIT=0 (1515 pass / 74 skip / 0 fail).Still open, deliberately
RC1 (
.tsxclassified as a main source) and RC4 (no renderer build step anywhere) are 2b. They need bunmaska to own the renderer build, and the binding constraint is thatfile://blocks ES modules whilebun build ./index.htmlemitstype="module"— so the IIFE recipe in.admin/RENDERER-BUILD.mdis the target, not Bun's HTML entry. RC6 (window state across restart) is blocked on macOSgetBounds()returning a cached rect that lies once the window moves.