Skip to content

Conversation

davidliu
Copy link
Contributor

No description provided.

@davidliu davidliu requested a review from lukasIO April 13, 2023 13:52
@changeset-bot
Copy link

changeset-bot bot commented Apr 13, 2023

🦋 Changeset detected

Latest commit: af19cb8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
livekit-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -20,3 +20,8 @@ export type DataPublishOptions = {
/** the topic under which the message gets published */
topic?: string;
};

export type LiveKitReactNativeInfo = {
platform: 'ios' | 'android' | 'windows' | 'macos' | 'web' | 'native';
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity: does RN support all these platforms and what does native stand for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently there is support for all of these platforms, though we only support ios/android.

The typing here is from RN's platform types, though doesn't seem like anything actually uses native; it just happens to be added to the type and left there.

}

return undefined;
}

export function getDevicePixelRatio(): number {
if (!isReactNative()) {
Copy link
Contributor

@lukasIO lukasIO Apr 13, 2023

Choose a reason for hiding this comment

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

we're not calling getDevicePixelRatio in "dangerous" paths right now, but adding a isWeb() check additionally wouldn't hurt either.

Copy link
Contributor

@lukasIO lukasIO left a comment

Choose a reason for hiding this comment

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

nice! this makes also the RN global handling a lot cleaner :)

@davidliu davidliu merged commit 80ec8d7 into main Apr 16, 2023
@davidliu davidliu deleted the dl/rn_device_pixel_ratio branch April 16, 2023 15:34
@github-actions github-actions bot mentioned this pull request Apr 16, 2023
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.

2 participants