DataDog / dd-sdk-reactnative

Datadog SDK for ReactNative
Apache License 2.0
120 stars 42 forks source link

Add support for react-native-web #276

Open onlyanegg opened 2 years ago

onlyanegg commented 2 years ago

Is your feature request related to a problem? Please describe. The react-native-web build does not work

Describe the solution you'd like Support react-native-web

Describe alternatives you've considered Currently I'm mocking DdSdk and other objects in the web build with a webpack alias. I could try writing code to make requests either with the browser SDK or an http client. But it think it would make more sense if it lived in here, even if it were basically a proxy to the browser SDK.

louiszawadzki commented 2 years ago

Hi @onlyanegg, thanks for reaching out on this topic!

It is in our backlog, but it isn't places on the roadmap yet. In the meantime I would suggest that you try writing a proxy to the browser SDK for the web part.

onlyanegg commented 2 years ago

Ok, thank you :)

leggomuhgreggo commented 1 year ago

+1 on this

I've been using a custom cross-platform abstraction -- and I'm very glad to have the functionality I am able (thanks!) But I will say that it's been quite difficult at times, to keep things in aligned

After a couple bugs slipped in, I've started to ensure that any update includes an exhaustive accounting of configuration changes / types def updates to ensure consistency between the platforms.

Even if a fully fledged solution doesn't make it onto the roadmap this time around, it would be tremendously useful to start aligning the APIs.

API Mismatch Summary **Native- vs web-specific config** - only relevant to particular platform <-- perfectly legit, but ideally distinct from possibly similar sounding options - eg `nativeCrashReportEnabled` - seemingly missing feature - eg `version` (recently added!) **Overlapping config** - same key / same value <-- this is the dream 😄 - different key / same value <-- requires some aliasing, but not too bad - eg `service` vs `serviceName` - same or slightly different key / slightly different value 🤕 - eg `firstPartyHosts` vs `allowedTracingOrigins` or `siteParameter` vs `site` - different key / same value, BUT unclear if features actually overlap 🤔 - eg `trackErrors` vs `forwardErrorsToLogs` **Misc Other Issues** - Method mismatch - names but also sync vs async - Companion libraries eg `@datadog/browser-logs` `@datadog/mobile-react-navigation` - CI / SourceMap orchestration
onlyanegg commented 1 year ago

Hey, @leggomuhgreggo! Would you be open to sharing your abstraction? That could be super useful for me (and maybe others?) at least as a reference.

leggomuhgreggo commented 1 year ago

@onlyanegg the abstraction is a library in a private monorepo, but I threw the raw code in a repo here.

onlyanegg commented 1 year ago

Thanks, @leggomuhgreggo!

leggomuhgreggo commented 11 months ago

Updated the example x-platform RUM client repo

onlyanegg commented 6 months ago

Hey, @louiszawadzki! I just wanted to bump this. I'm having to do a bit of a refactor to our implementation because of and Expo update. Has supporting web in this lib gained any traction?