-
Notifications
You must be signed in to change notification settings - Fork 8
Patch unplugin to pass input source map to transform handlers #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Patch unplugin to pass input source map to transform handlers #247
Conversation
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: ff44c24 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
yoannmoinet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given our implementation, wouldn't you need to patch both webpack and rspack transforms and loaders?
I do think we want to do that eventually, but since we're trying to solve a problem with rspack, it seemed to me to make sense to limit the blast radius of the change to rspack until we're sure that the fix is correct and it doesn't introduce any new issues. Happy to revise the patch if you'd prefer to start with webpack as well, though. |
That's fair. |
What and why?
It looks like cleanly supporting newer versions of
rspackwill require that we handle source map merging ourselves in the RUM privacy plugin. The underlying instrumentation code already supports this, but we can't take advantage of that, because the Unplugin API doesn't give us access to the input source map. To fix that, this PR patches Unplugin to make the input source map available to transform handlers.How?
This PR includes a patch (generated using
yarn patch) which passes the input source map as a third argument totransformhandlers for bothwebpackandrspackplugins.(When we upstream this, we should probably do it for all bundlers, but in the short term the focus is on resolving compatibility issues with
rspack.)