Skip to content

Conversation

@oliverlaz
Copy link
Member

@oliverlaz oliverlaz commented Jan 18, 2024

Overview

Improves the type narrowing on call events. Event listeners used to be quite general and thus, required them to do type narrowing inside their body. With this change that is no longer necessary as now TS can narrow the type for us.

// Call events (before):
call.on('call.created', (e) => {
  if (e.type !== 'call.created') return;
  // rest of the body
});
// Call events (after):
call.on('call.created', (e) => {
  // rest of the body, the type of 'e' is correctly narrowed
});

// SFU events (before):
call.on('trackPublished', (e) => {
  if (e.eventPayload.oneofKind !== 'trackPublished') return;
  const data = e.eventPayload.trackPublished;
  const trackType = data.type;
  // rest of the body
});
// SFU events (after):
call.on('trackPublished', (e) => {
  const trackType = e.type;
  // rest of the body
});

Breaking Changes

  • Some type definitions are removed (EventHandler, CallEventHandler)
  • SFU events are now dispatching unwrapped data - these are considered internal, and customers should be using call.state

Other important notes

  • Reduced the number of functions that are invoked when dispatching an event on the coordinator client
  • Coordinator web socket events parsing isn't duplicated anymore - we should have some perf gains here.

zwaardje and others added 30 commits December 1, 2023 13:34
- add video device selection button
- add mic device selection button
- style documentation buttons smaller
Assign `data-testid` attributes to the Call Control Buttons.
- allow for a primary and secondary active state on the button
- remove redundant code and file
when speaker left or right is active on mobile switch to speaker bottom
Adds a new feature flag that enables General Location randomization.
Once enabled, Pronto will send a randomly selected location to our
backend.

### Notes
On larger calls, we want to ensure that participants are assigned to
random SFUs around the globe. Hopefully, this will help us detect some
edge cases with Cascading.
Adds an experimental waiting room functionality in Pronto built on top of `custom` events.

For more information, check:
https://getstream.slack.com/archives/C022N8JNQGZ/p1706886559355909thread_ts=1706212004.817829&cid=C022N8JNQGZ
# Conflicts:
#	packages/react-sdk/CHANGELOG.md
#	yarn.lock
@oliverlaz oliverlaz marked this pull request as ready for review February 26, 2024 13:05
Base automatically changed from feature/WD-1079 to main February 26, 2024 14:10
# Conflicts:
#	sample-apps/react/react-dogfood/components/MeetingUI.tsx
#	sample-apps/react/react-dogfood/hooks/useGleap.ts
@oliverlaz oliverlaz merged commit b5bdab1 into main Feb 26, 2024
@oliverlaz oliverlaz deleted the type-inference branch February 26, 2024 14:23
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.

6 participants