Load introspection ns once per session on the piggieback path - #64
Merged
Conversation
…ssion key Three related changes to the dynamic-completion loading/eval path: - The piggieback/cljs.repl path re-probed the runtime with `goog.getObjectByName` on every completion request. Cache the loaded state once per session for node (whose runtime persists), matching the shadow path. Browser runtimes keep re-checking, since a page reload drops the loaded namespace. - Store that per-session flag under a Var key, not a keyword. nREPL's session middleware pushes every session-map key as a thread binding and casts keys to Var, so a keyword key throws a ClassCastException on the next message. This also fixes the same latent issue in the shadow path's flag. - Bind `cljs.analyzer/*cljs-warnings*` around the completion eval to silence the spurious `undeclared Var ...property-names-and-types` warning (the :warnings eval opt isn't honored by `eval-cljs`).
bbatsov
force-pushed
the
piggieback-loading-improvements
branch
from
July 18, 2026 17:20
ee6be23 to
5873a9d
Compare
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.
Three related changes to the dynamic-completion loading/eval path (items toward 0.8.0):
Once-per-session loading on the piggieback/cljs.repl path. It re-probed the runtime with
goog.getObjectByNameon every completion request; now it caches the loaded state per session for node (whose runtime persists), matching what goog.require emitted for every complete request #6 did for shadow. Browser runtimes keep re-checking on each request, since a page reload drops the loaded namespace.Fix a latent
ClassCastException. The per-session loaded flag was stored under a keyword key. nREPL's session middleware pushes every session-map key as a thread binding and casts keys toVar, so a keyword key throws on the next message. This bit the piggieback path (caught by the real-nREPL node integration test) and was also latent in the shadow path's flag from goog.require emitted for every complete request #6 - both now use a Var key. The shadow integration test never caught it because it drivescomplete-for-nreplwith a plain atom, not a real session.Silence a spurious warning.
eval-cljsdoesn't honor the:warningsopt, so the first dynamic completion loggedundeclared Var ...property-names-and-types. Bindcljs.analyzer/*cljs-warnings*around the eval instead.