Skip to content

Commit 39e8218

Browse files
Remove reaction conditional-compile lines (#4473)
1 parent 60bb0b2 commit 39e8218

64 files changed

Lines changed: 44 additions & 333 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "none",
3+
"area": "improvement",
4+
"workstream": "",
5+
"comment": "Remove reaction conditional-compile lines",
6+
"packageName": "@azure/communication-react",
7+
"email": "2684369+JamesBurnside@users.noreply.github.com",
8+
"dependentChangeType": "none"
9+
}

common/config/babel/features.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,5 @@ module.exports = {
9292
'end-of-call-survey',
9393
// Feature for PPT Live for teams meeting
9494
'ppt-live',
95-
// Feature for meeting reactions
96-
'reaction',
9795
]
9896
}

packages/calling-component-bindings/src/baseSelectors.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
} from '@internal/calling-stateful-client';
1818
/* @conditional-compile-remove(spotlight) */
1919
import { SpotlightCallFeatureState } from '@internal/calling-stateful-client';
20-
/* @conditional-compile-remove(reaction) */
2120
import { ReactionState } from '@internal/calling-stateful-client';
2221
/* @conditional-compile-remove(close-captions) */
2322
import { CaptionsInfo } from '@internal/calling-stateful-client';
@@ -113,7 +112,6 @@ export const getSpotlightCallFeature = (
113112
return state.calls[props.callId]?.spotlight;
114113
};
115114

116-
/* @conditional-compile-remove(reaction) */
117115
/**
118116
* @private
119117
*/

packages/calling-component-bindings/src/callControlSelectors.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
getIsScreenSharingOn,
1313
getLocalVideoStreams
1414
} from './baseSelectors';
15-
/* @conditional-compile-remove(reaction) */
1615
import { getLocalParticipantReactionState } from './baseSelectors';
1716

1817
import { getCapabilities, getRole } from './baseSelectors';
@@ -140,7 +139,6 @@ export const raiseHandButtonSelector: RaiseHandButtonSelector = reselect.createS
140139
}
141140
);
142141

143-
/* @conditional-compile-remove(reaction) */
144142
/**
145143
* Selector type for {@link ReactionButton} component.
146144
*
@@ -154,7 +152,6 @@ export type ReactionButtonSelector = (
154152
disabled?: boolean;
155153
};
156154

157-
/* @conditional-compile-remove(reaction) */
158155
/**
159156
* Selector for {@link ReactionButton} component.
160157
*

packages/calling-component-bindings/src/handlers/createCommonHandlers.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import { CommunicationIdentifier } from '@azure/communication-common';
3434
import { Features } from '@azure/communication-calling';
3535
/* @conditional-compile-remove(close-captions) */
3636
import { TeamsCaptions } from '@azure/communication-calling';
37-
/* @conditional-compile-remove(reaction) */
3837
import { Reaction } from '@azure/communication-calling';
3938
/* @conditional-compile-remove(spotlight) */
4039
import { _ComponentCallingHandlers } from './createHandlers';
@@ -61,7 +60,6 @@ export interface CommonCallingHandlers {
6160
onRaiseHand: () => Promise<void>;
6261
onLowerHand: () => Promise<void>;
6362
onToggleRaiseHand: () => Promise<void>;
64-
/* @conditional-compile-remove(reaction) */
6563
onReactionClick: (reaction: Reaction) => Promise<void>;
6664
/* @conditional-compile-remove(PSTN-calls) */
6765
onToggleHold: () => Promise<void>;
@@ -321,7 +319,6 @@ export const createDefaultCommonCallingHandlers = memoizeOne(
321319
}
322320
};
323321

324-
/* @conditional-compile-remove(reaction) */
325322
const onReactionClick = async (reaction: Reaction): Promise<void> => {
326323
if (
327324
reaction === 'like' ||
@@ -674,7 +671,6 @@ export const createDefaultCommonCallingHandlers = memoizeOne(
674671
onRaiseHand,
675672
onLowerHand,
676673
onToggleRaiseHand,
677-
/* @conditional-compile-remove(reaction) */
678674
onReactionClick: onReactionClick,
679675
/* @conditional-compile-remove(PSTN-calls) */
680676
onAddParticipant: notImplemented,

packages/calling-component-bindings/src/hooks/usePropsFor.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ import { AreEqual } from '@internal/acs-ui-common';
3838
import { ParticipantsButton } from '@internal/react-components';
3939
import { ErrorBarSelector, errorBarSelector } from '../errorBarSelector';
4040
import { CommonCallingHandlers } from '../handlers/createCommonHandlers';
41-
/* @conditional-compile-remove(reaction) */
4241
import { reactionButtonSelector } from '../callControlSelectors';
43-
/* @conditional-compile-remove(reaction) */
4442
import { ReactionButton } from '@internal/react-components';
4543
/* @conditional-compile-remove(spotlight) */
4644
import { _ComponentCallingHandlers } from '../handlers/createHandlers';

packages/calling-component-bindings/src/participantListSelector.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ import { isHideAttendeeNamesEnabled } from './baseSelectors';
1616
import { CallParticipantListParticipant } from '@internal/react-components';
1717
import { _isRingingPSTNParticipant, _updateUserDisplayNames } from './utils/callUtils';
1818
import { memoizedConvertAllremoteParticipants } from './utils/participantListSelectorUtils';
19-
/* @conditional-compile-remove(reaction) */
2019
import { memoizedConvertToVideoTileReaction } from './utils/participantListSelectorUtils';
2120
/* @conditional-compile-remove(spotlight) */
2221
import { memoizedSpotlight } from './utils/participantListSelectorUtils';
2322
import { getLocalParticipantRaisedHand } from './baseSelectors';
24-
/* @conditional-compile-remove(reaction) */
2523
import { getLocalParticipantReactionState } from './baseSelectors';
2624
/* @conditional-compile-remove(spotlight) */
2725
import { getSpotlightCallFeature } from './baseSelectors';
@@ -77,9 +75,7 @@ const convertRemoteParticipantsToParticipantListParticipants = (
7775
participant.role,
7876
isHideAttendeeNamesEnabled
7977
);
80-
let remoteParticipantReaction = undefined;
81-
/* @conditional-compile-remove(reaction) */
82-
remoteParticipantReaction = memoizedConvertToVideoTileReaction(participant.reactionState);
78+
const remoteParticipantReaction = memoizedConvertToVideoTileReaction(participant.reactionState);
8379
let spotlight = undefined;
8480
/* @conditional-compile-remove(spotlight) */
8581
spotlight = memoizedSpotlight(spotlightedParticipants, toFlatCommunicationIdentifier(participant.identifier));
@@ -144,7 +140,6 @@ export const participantListSelector: ParticipantListSelector = createSelector(
144140
getParticipantCount,
145141
/* @conditional-compile-remove(hide-attendee-name) */
146142
isHideAttendeeNamesEnabled,
147-
/* @conditional-compile-remove(reaction) */
148143
getLocalParticipantReactionState,
149144
/* @conditional-compile-remove(spotlight) */
150145
getSpotlightCallFeature
@@ -160,7 +155,6 @@ export const participantListSelector: ParticipantListSelector = createSelector(
160155
partitipantCount,
161156
/* @conditional-compile-remove(hide-attendee-name) */
162157
isHideAttendeeNamesEnabled,
163-
/* @conditional-compile-remove(reaction) */
164158
localParticipantReactionState,
165159
/* @conditional-compile-remove(spotlight) */
166160
spotlightCallFeature
@@ -180,8 +174,6 @@ export const participantListSelector: ParticipantListSelector = createSelector(
180174
spotlightCallFeature?.spotlightedParticipants
181175
)
182176
: [];
183-
/* @conditional-compile-remove(reaction) */
184-
const localParticipantReaction = memoizedConvertToVideoTileReaction(localParticipantReactionState);
185177
participants.push({
186178
userId: userId,
187179
displayName: displayName,
@@ -191,8 +183,7 @@ export const participantListSelector: ParticipantListSelector = createSelector(
191183
state: 'Connected',
192184
// Local participant can never remove themselves.
193185
isRemovable: false,
194-
/* @conditional-compile-remove(reaction) */
195-
reaction: localParticipantReaction,
186+
reaction: memoizedConvertToVideoTileReaction(localParticipantReactionState),
196187
/* @conditional-compile-remove(spotlight) */
197188
spotlight: memoizedSpotlight(spotlightCallFeature?.spotlightedParticipants, userId)
198189
});

packages/calling-component-bindings/src/utils/participantListSelectorUtils.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ import { CallParticipantListParticipant } from '@internal/react-components';
1212
/* @conditional-compile-remove(spotlight) */
1313
import { Spotlight } from '@internal/react-components';
1414
import { RaisedHandState } from '@internal/calling-stateful-client';
15-
/* @conditional-compile-remove(reaction) */
1615
import { ReactionState } from '@internal/calling-stateful-client';
17-
/* @conditional-compile-remove(reaction) */
1816
import { Reaction } from '@internal/react-components';
19-
/* @conditional-compile-remove(reaction) */ /* @conditional-compile-remove(spotlight) */
2017
import memoizeOne from 'memoize-one';
2118

2219
const convertRemoteParticipantToParticipantListParticipant = (
@@ -28,7 +25,7 @@ const convertRemoteParticipantToParticipantListParticipant = (
2825
isSpeaking: boolean,
2926
raisedHand: RaisedHandState | undefined,
3027
localUserCanRemoveOthers: boolean,
31-
reaction: undefined | /* @conditional-compile-remove(reaction) */ Reaction,
28+
reaction: undefined | Reaction,
3229
spotlight: undefined | /* @conditional-compile-remove(spotlight) */ Spotlight
3330
): CallParticipantListParticipant => {
3431
const identifier = fromFlatCommunicationIdentifier(userId);
@@ -46,7 +43,7 @@ const convertRemoteParticipantToParticipantListParticipant = (
4643
(getIdentifierKind(identifier).kind === 'communicationUser' ||
4744
getIdentifierKind(identifier).kind === 'phoneNumber') &&
4845
localUserCanRemoveOthers,
49-
/* @conditional-compile-remove(reaction) */ reaction,
46+
reaction,
5047
/* @conditional-compile-remove(spotlight) */ spotlight
5148
};
5249
};
@@ -64,7 +61,7 @@ export const memoizedConvertAllremoteParticipants = memoizeFnAll(
6461
isSpeaking: boolean,
6562
raisedHand: RaisedHandState | undefined,
6663
localUserCanRemoveOthers: boolean,
67-
reaction: undefined | /* @conditional-compile-remove(reaction) */ Reaction,
64+
reaction: undefined | Reaction,
6865
spotlight: undefined | /* @conditional-compile-remove(spotlight) */ Spotlight
6966
): CallParticipantListParticipant => {
7067
return convertRemoteParticipantToParticipantListParticipant(
@@ -82,7 +79,6 @@ export const memoizedConvertAllremoteParticipants = memoizeFnAll(
8279
}
8380
);
8481

85-
/* @conditional-compile-remove(reaction) */
8682
/**
8783
* @private
8884
*/

packages/calling-component-bindings/src/utils/videoGalleryUtils.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ import { maskDisplayNameWithRole } from './callUtils';
1919
import { checkIsSpeaking } from './SelectorUtils';
2020
import { isPhoneNumberIdentifier } from '@azure/communication-common';
2121
import { RaisedHandState } from '@internal/calling-stateful-client';
22-
/* @conditional-compile-remove(reaction) */
2322
import { Reaction } from '@internal/react-components';
24-
/* @conditional-compile-remove(reaction) */
2523
import { memoizedConvertToVideoTileReaction } from './participantListSelectorUtils';
2624
/* @conditional-compile-remove(spotlight) */
2725
import { Spotlight } from '@internal/react-components';
@@ -76,10 +74,7 @@ export const _videoGalleryRemoteParticipantsMemo: _VideoGalleryRemoteParticipant
7674
let contentSharingStream = undefined;
7775
/* @conditional-compile-remove(ppt-live) */
7876
contentSharingStream = participant.contentSharingStream;
79-
let remoteParticipantReaction = undefined;
80-
/* @conditional-compile-remove(reaction) */ remoteParticipantReaction = memoizedConvertToVideoTileReaction(
81-
participant.reactionState
82-
);
77+
const remoteParticipantReaction = memoizedConvertToVideoTileReaction(participant.reactionState);
8378
let spotlight = undefined;
8479
/* @conditional-compile-remove(spotlight) */ spotlight = participant.spotlight;
8580
return memoizedFn(
@@ -109,7 +104,7 @@ const memoizedAllConvertRemoteParticipant = memoizeFnAll(
109104
displayName?: string,
110105
raisedHand?: RaisedHandState,
111106
contentSharingStream?: HTMLElement,
112-
reaction?: unknown, // temp unknown type to build stable
107+
reaction?: Reaction,
113108
spotlight?: unknown // temp unknown type to build stable
114109
): VideoGalleryRemoteParticipant => {
115110
return convertRemoteParticipantToVideoGalleryRemoteParticipant(
@@ -137,7 +132,7 @@ export const convertRemoteParticipantToVideoGalleryRemoteParticipant = (
137132
displayName?: string,
138133
raisedHand?: RaisedHandState,
139134
contentSharingStream?: HTMLElement,
140-
reaction?: unknown, // temp unknown type to build stable
135+
reaction?: Reaction,
141136
spotlight?: unknown // temp unknown type to build stable
142137
): VideoGalleryRemoteParticipant => {
143138
const rawVideoStreamsArray = Object.values(videoStreams);
@@ -183,8 +178,7 @@ export const convertRemoteParticipantToVideoGalleryRemoteParticipant = (
183178
/* @conditional-compile-remove(PSTN-calls) */
184179
state,
185180
raisedHand,
186-
/* @conditional-compile-remove(reaction) */
187-
reaction: reaction as Reaction,
181+
reaction,
188182
/* @conditional-compile-remove(spotlight) */
189183
spotlight: spotlight as Spotlight
190184
};
@@ -223,7 +217,7 @@ export const memoizeLocalParticipant = memoizeOne(
223217
localVideoStream,
224218
role,
225219
raisedHand,
226-
/* @conditional-compile-remove(reaction) */ reaction,
220+
reaction,
227221
/* @conditional-compile-remove(spotlight) */ localSpotlight,
228222
/* @conditional-compile-remove(spotlight) */ capabilities
229223
) => ({
@@ -238,8 +232,7 @@ export const memoizeLocalParticipant = memoizeOne(
238232
},
239233
role,
240234
raisedHand: raisedHand,
241-
/* @conditional-compile-remove(reaction) */
242-
reaction: reaction,
235+
reaction,
243236
/* @conditional-compile-remove(spotlight) */
244237
spotlight: localSpotlight,
245238
/* @conditional-compile-remove(spotlight) */

packages/calling-component-bindings/src/videoGallerySelector.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ import {
3030
/* @conditional-compile-remove(spotlight) */
3131
import { memoizeSpotlightedParticipantIds } from './utils/videoGalleryUtils';
3232
import { getLocalParticipantRaisedHand } from './baseSelectors';
33-
/* @conditional-compile-remove(reaction) */
3433
import { getLocalParticipantReactionState } from './baseSelectors';
35-
/* @conditional-compile-remove(reaction) */
3634
import { memoizedConvertToVideoTileReaction } from './utils/participantListSelectorUtils';
3735
import { getRemoteParticipantsExcludingConsumers } from './getRemoteParticipantsExcludingConsumers';
3836
/* @conditional-compile-remove(spotlight) */
@@ -77,7 +75,6 @@ export const videoGallerySelector: VideoGallerySelector = createSelector(
7775
getLocalParticipantRaisedHand,
7876
/* @conditional-compile-remove(hide-attendee-name) */
7977
isHideAttendeeNamesEnabled,
80-
/* @conditional-compile-remove(reaction) */
8178
getLocalParticipantReactionState,
8279
/* @conditional-compile-remove(spotlight) */
8380
getSpotlightCallFeature,
@@ -98,7 +95,6 @@ export const videoGallerySelector: VideoGallerySelector = createSelector(
9895
raisedHand,
9996
/* @conditional-compile-remove(hide-attendee-name) */
10097
isHideAttendeeNamesEnabled,
101-
/* @conditional-compile-remove(reaction) */
10298
localParticipantReaction,
10399
/* @conditional-compile-remove(spotlight) */
104100
spotlightCallFeature,
@@ -115,7 +111,6 @@ export const videoGallerySelector: VideoGallerySelector = createSelector(
115111
const dominantSpeakersMap: Record<string, number> = {};
116112
dominantSpeakerIds?.forEach((speaker, idx) => (dominantSpeakersMap[speaker] = idx));
117113
const noRemoteParticipants: RemoteParticipantState[] = [];
118-
/* @conditional-compile-remove(reaction) */
119114
const localParticipantReactionState = memoizedConvertToVideoTileReaction(localParticipantReaction);
120115
/* @conditional-compile-remove(spotlight) */
121116
const spotlightedParticipantIds = memoizeSpotlightedParticipantIds(spotlightCallFeature?.spotlightedParticipants);
@@ -143,7 +138,6 @@ export const videoGallerySelector: VideoGallerySelector = createSelector(
143138
localVideoStream,
144139
role,
145140
raisedHand,
146-
/* @conditional-compile-remove(reaction) */
147141
localParticipantReactionState,
148142
/* @conditional-compile-remove(spotlight) */
149143
spotlightCallFeature?.localParticipantSpotlight,

0 commit comments

Comments
 (0)