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.
Summary
Behavior-preserving refactor of the IIFE entry module so every top-level file under
js/src/has one clear responsibility andindex.tsreads as a boot sequence rather than a kitchen sink. Closes #54.output-binding.ts— movesShinyreactOutputBindingout ofindex.tsbehind an explicitregisterShinyreactOutputBinding().global.ts— moves theWindow.shinyreactdeclaration +window.shinyreact = Object.assign(...)assignment behind an explicitinstallGlobal().spec.ts→types.ts— the file is exclusively wire-tree TS types; exported type names unchanged, 5 importers repointed.index.tsis now ~9 lines: CSS import +installGlobal()→registerShinyreactOutputBinding()→installInlineSpecSeeding().No import-time side effects for our own modules (only the unavoidable
./shinyreact.css). No change to runtime behavior, exported type names, or thewindow.shinyreactsurface. Vendoredjs/src/shiny-react/untouched (its fate is downstream of #28).Of the issue's five proposals: #3 (test colocation) was already done; #5 (vendored dir) is out of scope; this PR does #1, #2, and #4.
Test Plan
make js-lint(tsc--noEmit) cleannpx vitest run— 183 tests passmake js-buildproduces a byte-similardist/shinyreact.js(diff is bundler-internal mangled-symbol renames only; +40 bytes from one added doc comment)make update-distrefreshed the bundled copies inpkg-py/andpkg-r/Spec and plan:
docs/superpowers/specs/2026-06-10-flatten-js-src-design.md,docs/superpowers/plans/2026-06-10-flatten-js-src.md