RUM-12185: Support aliased import paths for local SVG discovery - #1352
Open
jonathanmos wants to merge 1 commit into
Open
RUM-12185: Support aliased import paths for local SVG discovery#1352jonathanmos wants to merge 1 commit into
jonathanmos wants to merge 1 commit into
Conversation
🎉 All green!🧪 All tests passed 🔄 Datadog auto-retried 5 jobs - 4 passed on retry 🔗 Commit SHA: ffa6d6f | Docs | Datadog PR Page | Give us feedback! |
jonathanmos
force-pushed
the
jmoskovich/rum-12185/support-alias-paths
branch
from
July 28, 2026 12:21
1a97eab to
ffa6d6f
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for resolving aliased local .svg imports during Session Replay asset discovery, so ReactNativeSVG.buildSvgMap() can map SVG components even when imports use TS/JS path mappings or babel-plugin-module-resolver.
Changes:
- Introduces
PathAliasResolverto resolve non-relative SVG import specifiers viababel-plugin-module-resolverandtsconfig.json/jsconfig.jsonpaths. - Updates
ReactNativeSVG.buildSvgMap()to use the resolver (and reset cached alias config between runs). - Adds regression tests and a benchmark scenario exercising aliased SVG imports.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds lock entries for tsconfig-paths and babel-plugin-module-resolver (and transitive deps). |
| packages/react-native-babel-plugin/test/react-native-svg.test.ts | Adds coverage for alias resolution via tsconfig/jsconfig + babel-module-resolver, and precedence/fallback behavior. |
| packages/react-native-babel-plugin/src/libraries/react-native-svg/pathAliasResolver.ts | New resolver implementing alias lookup via Babel partial config + tsconfig-paths. |
| packages/react-native-babel-plugin/src/libraries/react-native-svg/index.ts | Wires alias resolution into buildSvgMap() via resolveImportSource(). |
| packages/react-native-babel-plugin/package.json | Adds tsconfig-paths dependency and babel-plugin-module-resolver devDependency. |
| benchmarks/src/scenario/SessionReplay/component/Svg.tsx | Adds an aliased SVG import case (Group H) to the benchmark test screen. |
| benchmarks/package.json | Adds babel-plugin-module-resolver for the benchmark app. |
| benchmarks/babel.config.js | Configures module-resolver alias used by the benchmark aliased SVG case. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What does this PR do?
Adds support for resolving aliased local SVG imports during Session Replay asset discovery.
Supports TypeScript/JavaScript path mappings and babel-plugin-module-resolver, including .babelrc, function-form plugin configurations, and Windows paths. Includes regression coverage for the supported configurations.
Before

After

Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)