fix: track exported symbols that use changed internal symbols #18
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
Implements deterministic reference tracking for internal (non-exported) symbols, matching TypeScript's
findAllReferencesbehavior. This partially addresses #16 by implementing the "exported container" concept.Problem
When an internal function changes, domino would only look for direct cross-file references. Since internal functions aren't exported, it would find 0 references and stop, missing the entire dependency chain.
Example scenario:
Before this fix: Domino stops at
getHelperValue, doesn't detect affected consumersAfter this fix: Domino finds
ExportedComponentuses it, tracks its referencesSolution
Implemented two algorithms from TypeScript's findAllReferences:
1. Exported Container Tracking
When an internal symbol has no cross-file references and isn't exported:
2. Dynamic Import File Processing
When a file is conservatively affected (dynamic imports with
line=0sentinel):Changes
src/semantic/analyzer.rs:
is_symbol_exported()- checks if a symbol is exportedfind_exported_symbols_using()- finds which exported symbols depend on an internal symbolsrc/core.rs:
process_changed_symbol()to handle internal symbolsline=0sentinel (conservatively affected files)tests/integration_test.rs:
test_internal_function_affecting_exported_component()Testing
✅ Unit tests pass
✅ New integration test added
✅ Verified to match traf's behavior in real-world monorepos
Related to Issue #16
This PR partially addresses #16 by implementing:
Remaining items from #16 (for future PRs):
This is a critical correctness fix that ensures domino detects all affected projects when internal implementation details change.