Repository navigation
js: embed the whole library source in Sources - #131
Merged
Merged
Conversation
Sources held only the three modules that import nothing, so a Go module that vendors Modlock kept the HUD tokens, the hero table and the text helpers but not the library itself. Embedding all of src gives a vendoring module the TypeScript library at the version it pins: its type checker can resolve modlock to the vendored src/index.ts, with no npm package or project setup step. The protobuf messages the source imports are already vendored with their own packages. A test checks that Sources holds the entry module and every module its source imports from inside src. The vendored tree grows by 2,576,353 bytes in 34 files, most of it entities.ts. Nothing in Modlock reads Sources, so no binary grows. Signed-off-by: Christian Stewart <christian@aperture.us>
paralin
added a commit
that referenced
this pull request
Nov 15, 2026
Signed-off-by: Christian Stewart <christian@aperture.us>
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.
Sources held only the three modules that import nothing, so a Go module that vendors Modlock kept the HUD tokens, the hero table and the text helpers but not the library itself. Embedding all of js/src gives a vendoring module the TypeScript library at the version it pins: its type checker can resolve modlock to the vendored src/index.ts, with no npm package or project setup step. The protobuf messages the source imports are already vendored with their own packages.
A new test checks that Sources holds the entry module and every module its source imports from inside src.
Measured size: the vendored tree grows by 2,576,353 bytes in 34 files (from 3 files and 17,279 bytes to 37 files and 2,593,632 bytes), most of it entities.ts at 1,796,099 bytes. Nothing in Modlock reads Sources, so no binary grows.