Skip to content

Conversation

@sethfowler-datadog
Copy link

@sethfowler-datadog sethfowler-datadog commented Nov 14, 2025

What and why?

It looks like cleanly supporting newer versions of rspack will 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 to transform handlers for both webpack and rspack plugins.

(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.)

@datadog-official
Copy link

datadog-official bot commented Nov 14, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ff44c24 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

Copy link
Member

@yoannmoinet yoannmoinet left a 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?

@sethfowler-datadog
Copy link
Author

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.

@yoannmoinet
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants