-
Notifications
You must be signed in to change notification settings - Fork 153
Description
Description
Adding bridgeless support introduced few regressions in terms of sourceURL (passed to evaluateJavascript from jsi/jsi.h) - this argument is used to tell the JS engine where the evaluated code comes from.
- Native module - iOS:
sourceUrlpassed toevaluateJavascriptinexecuteFromFilesystemfrompackages/repack/ios/ScriptManager.mmis incorrect -> we should useurlfrom theScriptConfig
- Native module - Android:
sourceUrlpassed toevaluateinexecutefrompackages/repack/android/src/main/java/com/callstack/repack/RemoteScriptLoader.ktis incorrect -> we should useurlfrom theScriptConfig
- Possible inconsitentencies on Android:
sourceUrlpassed toevaluateinexecutefrompackages/repack/android/src/main/java/com/callstack/repack/FileSystemScriptLoader.ktis inconsistent withiOS- depending onconfig.absolutewe pass different values -> to align with iOS we should most likely useconfig.urlin both cases
At this point it's hard to tell what should be passed in both cases - passing sourceUrl starting with http:// makes sense in development and the whole symbolication flow is centred around that , but does it make sense in production when evaluating remote bundles?
Thoughts on the matter
- we should consider passing just the name of the bundle (enhanced with
uniqueNameif needed - like in a super app setup) to match the source-map nicely - (this could be altered withconfig.absolute) - we need to ensure that when something is loaded from cache ends up with the same name - TBD whether this is the case
- we need to ensure that local chunks also follow the same convention - the location only matters for the resolver and not the source-maps
- there is a chance that solving this could enable sentry to work with multiple source-maps out of the box, since there is no official support for that but Sentry allows uploading multiple files.
Reproducible Demo
- can be reproduced in TesterApp by printing out the filenames from stack frames in
processmethod frompackages/dev-server/src/plugins/symbolicate/Symbolicator.ts. Note: filesystem loading flow can only be observed inrelease
Additional notes
sourceURL is used when creating an error stack frame in React Native. When you want to symbolicate a stack trace, you lookup the source through sourceURL and then from the source file you can obtain the name of the source map, from the comment at the very bottom (added through SourceMapDevToolPlugin):
...
//# sourceMappingURL=src_asyncChunks_Async_local_tsx.chunk.bundle.map?platform=ios