Skip to content

Commit

Permalink
Enable react-compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaboleken committed Dec 11, 2024
1 parent 2f62b7f commit 1f0b6ff
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
7 changes: 7 additions & 0 deletions react/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
const ReactCompilerConfig = {
'react-compiler/react-compiler': 'error',
}

module.exports = {
presets: [
'@babel/preset-env',
['@babel/preset-react', {runtime: 'automatic'}],
],
plugins: [
['babel-plugin-react-compiler', ReactCompilerConfig]
]
};
1 change: 1 addition & 0 deletions react/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
],
// Add rule overrides if required
rules: {
'react-compiler/react-compiler': 'error',
'react-compiler/transform': 'warn', // Change to 'error' if stricter enforcement is needed
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { SvgIcon } from '../../SvgIcon';
import { Tooltip } from '@mui/material';
import { styled } from '@mui/material/styles';
import { useTranslation } from 'react-i18next';
import { useSnackbar } from 'notistack-v2-maintained';
import { ConferenceContext} from "../../../pages/AntMedia";

export const roundStyle = {
Expand Down Expand Up @@ -36,7 +35,6 @@ function RequestPublishButton(props) {
const { rounded, footer } = props;
const conference = useContext(ConferenceContext);
const { t } = useTranslation();
const { enqueueSnackbar } = useSnackbar();

return (
<>
Expand Down
8 changes: 4 additions & 4 deletions react/src/pages/AntMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,7 @@ function AntMedia(props) {

React.useEffect(() => {
updateUserStatusMetadata(isMyMicMuted, !isMyCamTurnedOff);
}, [role]);
}, [role]); // eslint-disable-line react-hooks/exhaustive-deps

function handleNotificationEvent(obj) {
var notificationEvent = JSON.parse(obj.data);
Expand Down Expand Up @@ -2638,7 +2638,7 @@ function AntMedia(props) {

React.useEffect(() => {
updateAllParticipantsPagination(globals.participantListPagination.currentPage);
}, [participantCount]);
}, [participantCount]); // eslint-disable-line react-hooks/exhaustive-deps

function updateAllParticipantsPagination(currentPage) {
if (currentPage <= 0) {
Expand Down Expand Up @@ -2862,7 +2862,7 @@ function AntMedia(props) {
reaction: reaction, senderStreamId: publishStreamId, senderStreamName: streamName
});
showReactions(publishStreamId, streamName, reaction, allParticipants);
},[handleSendNotificationEvent, publishStreamId, showReactions, allParticipants]);
},[handleSendNotificationEvent, publishStreamId, showReactions, allParticipants]); // eslint-disable-line react-hooks/exhaustive-deps

function muteLocalMic() {
webRTCAdaptor?.muteLocalMic();
Expand Down Expand Up @@ -2920,7 +2920,7 @@ function AntMedia(props) {
};
sendMessage(JSON.stringify(jsCmd));
}
}, [isWebSocketConnected]);
}, [isWebSocketConnected]); // eslint-disable-line react-hooks/exhaustive-deps

React.useEffect(() => {
if (!latestMessage) {
Expand Down
2 changes: 1 addition & 1 deletion react/src/styles/blueTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getBlueTheme() {
const error = "#D50000";
const primaryColor = themeColor10;
const secondaryColor = themeColor60;
const textColor = "#FFFFFF";
const textColor = "#FFFFFF"; // eslint-disable-line no-unused-vars
let themeObject = {
typography: {
allVariants: {
Expand Down
4 changes: 2 additions & 2 deletions react/src/styles/grayTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export function getGrayTheme() {
const themeColor90 = "#000000";
const themeColor99 = "#FFFFFF";
const chatText = "#FAFAFA";
const darkGray = "#222B2A";
const darkGray = "#222B2A"; // eslint-disable-line no-unused-vars
const iconColor = "#FFFFFF";
const darkIconColor = "#000000";

const error = "#D50000";
const primaryColor = themeColor10;
const secondaryColor = themeColor60;
const textColor = "#FFFFFF";
const textColor = "#FFFFFF"; // eslint-disable-line no-unused-vars
let themeObject = {
typography: {
allVariants: {
Expand Down
2 changes: 1 addition & 1 deletion react/src/styles/greenTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function getGreenTheme() {
const error = "#DF0515";
const primaryColor = themeColor10;
const secondaryColor = themeColor60;
const textColor = "#FFFFFF";
const textColor = "#FFFFFF"; // eslint-disable-line no-unused-vars
let themeObject = {
typography: {
allVariants: {
Expand Down

0 comments on commit 1f0b6ff

Please sign in to comment.