Skip to content
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

React Native Expo Support #7 #25

Merged
merged 7 commits into from
Jul 14, 2023
Merged

React Native Expo Support #7 #25

merged 7 commits into from
Jul 14, 2023

Conversation

siyuniu-ms
Copy link
Contributor

No description provided.

@siyuniu-ms siyuniu-ms changed the title create seperate class create seperate class to support expo Jun 23, 2023
uniqueIdPromiseTimeout: 5000
});

export class ReactNativeBasePlugin extends BaseTelemetryPlugin {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was originally thinking that we would have a base class and then 2 implementation classes (the existing and one that didn't set the device info) -- but this works.

The only issue I can think of is that "generally" you would not expect to create and use "Base" classes instances in an application....

We can probably "fix" this by just changing the name of this class to something that doesn't contain Base (or doesn't read like it's a support class that should not be directly used).

Some possible options that come to mind (as we can't change the original without causing bigger breaking changes)

  • ReactNativeDefaultPlugin
  • ReactNativeNoDevicePlugin
  • ReactNativePluginNoDeviceInfo
  • ReactNativeManualDevicePlugin

etc, I'm open to other suggestions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like ReactNativeManualDevicePlugin~


protected getDeviceInfoModule(_deviceInfoModule): IDeviceInfoModule {
if (!_deviceInfoModule) {
console.log("ReactNativePlugin: Please provide device-info");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally don't emit directly to the console, so we should use something like the following

_warnToConsole(_self.diagLog(), "Failed to get DeviceInfo: " + getExceptionName(e) + " - " + dumpObj(e));

And because this will be automatically called as part of the collecting the device, it should also mention that they can disable this by the disableDeviceCollection

@MSNev MSNev added this to the 4.0.0 milestone Jun 23, 2023
@MSNev MSNev changed the title create seperate class to support expo React Native Expo Support #7 Jun 23, 2023
@siyuniu-ms siyuniu-ms requested a review from MSNev July 13, 2023 18:14
README.md Outdated Show resolved Hide resolved
@MSNev MSNev mentioned this pull request Jul 14, 2023
@siyuniu-ms siyuniu-ms merged commit b31f885 into main Jul 14, 2023
7 checks passed
@siyuniu-ms siyuniu-ms deleted the siyu/supportExpo branch July 14, 2023 23:11
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.

None yet

2 participants