[251124] fix: Log정리-3
🕐 커밋 시간: 2025. 11. 24. 12:13:08 📊 변경 통계: • 총 파일: 10개 • 추가: +29줄 • 삭제: -110줄 📁 추가된 파일: + com.twin.app.shoptime/src/utils/debug.js 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/playActions.js ~ com.twin.app.shoptime/src/actions/productActions.js ~ com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js ~ com.twin.app.shoptime/src/hooks/useFocusHistory/useFocusHistory.js ~ com.twin.app.shoptime/src/lunaSend/common.js ~ com.twin.app.shoptime/src/reducers/panelReducer.js ~ com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx ~ com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/TermsOfService/TermsOfOptional.jsx ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx 🔧 함수 변경 내용: 📄 com.twin.app.shoptime/src/actions/playActions.js (javascript): ❌ Deleted: dwarn(), derror() 📄 com.twin.app.shoptime/src/actions/productActions.js (javascript): ❌ Deleted: dwarn(), derror() 📄 com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js (javascript): ❌ Deleted: dwarn(), derror() 📄 com.twin.app.shoptime/src/hooks/useFocusHistory/useFocusHistory.js (javascript): ❌ Deleted: dwarn(), derror() 📄 com.twin.app.shoptime/src/lunaSend/common.js (javascript): ❌ Deleted: dwarn(), derror() 📄 com.twin.app.shoptime/src/reducers/panelReducer.js (javascript): ❌ Deleted: dwarn(), derror() 📄 com.twin.app.shoptime/src/views/HomePanel/HomePanel.jsx (javascript): ❌ Deleted: dwarn(), derror() 📄 com.twin.app.shoptime/src/views/MyPagePanel/MyPageSub/TermsOfService/TermsOfOptional.jsx (javascript): ❌ Deleted: dwarn(), derror() 📄 com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx (javascript): ❌ Deleted: dwarn(), derror() 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • UI 컴포넌트 아키텍처 개선 • API 서비스 레이어 개선 • 공통 유틸리티 함수 최적화 Performance: 코드 최적화로 성능 개선 기대
This commit is contained in:
@@ -5,20 +5,11 @@ import { TAxios } from '../api/TAxios';
|
|||||||
import { panel_names } from '../utils/Config';
|
import { panel_names } from '../utils/Config';
|
||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { popPanel, pushPanel, updatePanel } from './panelActions';
|
import { popPanel, pushPanel, updatePanel } from './panelActions';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
const DEBUG_MODE = false;
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
const dlog = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.log(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const derror = (...args) => {
|
|
||||||
console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 🔽 [251116] 새로운 비디오 상태 관리 시스템 - 재생 상태
|
// 🔽 [251116] 새로운 비디오 상태 관리 시스템 - 재생 상태
|
||||||
export const PLAYBACK_STATUS = {
|
export const PLAYBACK_STATUS = {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { TAxios } from '../api/TAxios';
|
|||||||
import { types } from './actionTypes';
|
import { types } from './actionTypes';
|
||||||
import { changeAppStatus } from './commonActions';
|
import { changeAppStatus } from './commonActions';
|
||||||
import { reduce, set, get } from '../utils/fp';
|
import { reduce, set, get } from '../utils/fp';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
// CustomerImages용 리뷰 이미지 import
|
// CustomerImages용 리뷰 이미지 import
|
||||||
import reviewSampleImage from '../../assets/images/image-review-sample-1.png';
|
import reviewSampleImage from '../../assets/images/image-review-sample-1.png';
|
||||||
@@ -10,16 +11,8 @@ import reviewSampleImage from '../../assets/images/image-review-sample-1.png';
|
|||||||
// DEBUG_MODE - true인 경우에만 로그 출력
|
// DEBUG_MODE - true인 경우에만 로그 출력
|
||||||
const DEBUG_MODE = false;
|
const DEBUG_MODE = false;
|
||||||
|
|
||||||
// Local debug helpers (matches src/lunaSend/common.js pattern)
|
// 이 파일의 DEBUG_MODE를 사용하여 헬퍼 생성
|
||||||
const dlog = (...args) => {
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
if (DEBUG_MODE) console.log(...args);
|
|
||||||
};
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
const derror = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Best Seller 상품 목록 조회 IF-LGSP-303
|
// Best Seller 상품 목록 조회 IF-LGSP-303
|
||||||
// FP helpers
|
// FP helpers
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import Touchable from '@enact/ui/Touchable';
|
|||||||
|
|
||||||
import { panel_names } from '../../utils/Config';
|
import { panel_names } from '../../utils/Config';
|
||||||
import { $L } from '../../utils/helperMethods';
|
import { $L } from '../../utils/helperMethods';
|
||||||
|
import { createDebugHelpers } from '../../utils/debug';
|
||||||
import { SpotlightIds } from '../../utils/SpotlightIds';
|
import { SpotlightIds } from '../../utils/SpotlightIds';
|
||||||
import ThemeIndicator from '../../views/DetailPanel/components/indicator/ThemeIndicator';
|
import ThemeIndicator from '../../views/DetailPanel/components/indicator/ThemeIndicator';
|
||||||
import ThemeIndicatorArrow from '../../views/DetailPanel/components/indicator/ThemeIndicatorArrow';
|
import ThemeIndicatorArrow from '../../views/DetailPanel/components/indicator/ThemeIndicatorArrow';
|
||||||
@@ -66,20 +67,9 @@ import Video from './Video';
|
|||||||
import css from './VideoPlayer.module.less';
|
import css from './VideoPlayer.module.less';
|
||||||
import { updateVideoPlayState } from '../../actions/playActions';
|
import { updateVideoPlayState } from '../../actions/playActions';
|
||||||
|
|
||||||
// Toggle debug logging for this module
|
// 디버그 헬퍼 설정
|
||||||
const DEBUG_MODE = false;
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
const dlog = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.log(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const derror = (...args) => {
|
|
||||||
console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const isEnter = is('enter');
|
const isEnter = is('enter');
|
||||||
const isLeft = is('left');
|
const isLeft = is('left');
|
||||||
|
|||||||
@@ -2,21 +2,13 @@
|
|||||||
|
|
||||||
import { useRef, useCallback, useState, useMemo } from 'react';
|
import { useRef, useCallback, useState, useMemo } from 'react';
|
||||||
import fp from '../../utils/fp.js';
|
import fp from '../../utils/fp.js';
|
||||||
|
import { createDebugHelpers } from '../../utils/debug';
|
||||||
|
|
||||||
// Toggle debug logging in this file (false by default)
|
// Toggle debug logging in this file (false by default)
|
||||||
const DEBUG_MODE = false;
|
const DEBUG_MODE = false;
|
||||||
|
|
||||||
const dlog = (...args) => {
|
// 이 파일의 DEBUG_MODE를 사용하여 헬퍼 생성
|
||||||
if (DEBUG_MODE) console.log(...args);
|
const { dlog, dwarn, derror, debugIf } = createDebugHelpers(DEBUG_MODE);
|
||||||
};
|
|
||||||
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const derror = (...args) => {
|
|
||||||
console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* useFocusHistory Hook - 경량화된 포커스 히스토리 관리
|
* useFocusHistory Hook - 경량화된 포커스 히스토리 관리
|
||||||
|
|||||||
@@ -2,21 +2,11 @@ import appinfo from '../../webos-meta/appinfo.json';
|
|||||||
import { alertToast } from '../actions/commonActions';
|
import { alertToast } from '../actions/commonActions';
|
||||||
import { store } from '../store/store';
|
import { store } from '../store/store';
|
||||||
import LS2Request from './LS2Request';
|
import LS2Request from './LS2Request';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
// Toggle debug logging for this module (false by default)
|
// 디버그 헬퍼 설정
|
||||||
const DEBUG_MODE = false;
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
const dlog = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.log(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const derror = (...args) => {
|
|
||||||
console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getConnectionStatus = ({ onSuccess, onFailure, onComplete }) => {
|
export const getConnectionStatus = ({ onSuccess, onFailure, onComplete }) => {
|
||||||
if (typeof window === 'object' && !window.PalmSystem) {
|
if (typeof window === 'object' && !window.PalmSystem) {
|
||||||
|
|||||||
@@ -1,20 +1,10 @@
|
|||||||
import { types } from '../actions/actionTypes';
|
import { types } from '../actions/actionTypes';
|
||||||
import { panel_names } from '../utils/Config';
|
import { panel_names } from '../utils/Config';
|
||||||
|
import { createDebugHelpers } from '../utils/debug';
|
||||||
|
|
||||||
// Toggle debug logging for this reducer
|
// 디버그 헬퍼 설정
|
||||||
const DEBUG_MODE = false;
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
const dlog = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.log(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const derror = (...args) => {
|
|
||||||
console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
// 기존 상태 - 완전히 호환됨
|
// 기존 상태 - 완전히 호환됨
|
||||||
|
|||||||
53
com.twin.app.shoptime/src/utils/debug.js
Normal file
53
com.twin.app.shoptime/src/utils/debug.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* Shared Debug Utilities
|
||||||
|
*
|
||||||
|
* 사용 방법:
|
||||||
|
*
|
||||||
|
* 1. 각 파일에서 DEBUG_MODE 정의:
|
||||||
|
* const DEBUG_MODE = false; // 또는 true
|
||||||
|
*
|
||||||
|
* 2. 헬퍼들을 createDebugHelpers로 감싸기:
|
||||||
|
* import { createDebugHelpers } from '../utils/debug';
|
||||||
|
* const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
*
|
||||||
|
* 3. 사용:
|
||||||
|
* dlog('message', data); // DEBUG_MODE가 true일 때만 실행
|
||||||
|
* dwarn('warning');
|
||||||
|
* derror('error');
|
||||||
|
*
|
||||||
|
* 각 파일마다 독립적인 DEBUG_MODE를 유지하면서 헬퍼 코드는 공유됩니다.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 디버그 헬퍼 팩토리 함수
|
||||||
|
* 각 파일에서 자신의 DEBUG_MODE를 전달하여 고유한 헬퍼 인스턴스 생성
|
||||||
|
* @param {boolean} debugMode - 해당 파일의 DEBUG_MODE 값
|
||||||
|
* @returns {object} { dlog, dwarn, derror } 헬퍼 함수들
|
||||||
|
*/
|
||||||
|
export const createDebugHelpers = (debugMode = false) => ({
|
||||||
|
dlog: (...args) => {
|
||||||
|
if (debugMode) console.log(...args);
|
||||||
|
},
|
||||||
|
dwarn: (...args) => {
|
||||||
|
if (debugMode) console.warn(...args);
|
||||||
|
},
|
||||||
|
derror: (...args) => {
|
||||||
|
if (debugMode) console.error(...args);
|
||||||
|
},
|
||||||
|
debugIf: (callback) => {
|
||||||
|
if (debugMode && typeof callback === 'function') callback();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 간단한 버전 (기존 방식과 호환)
|
||||||
|
* 개별 헬퍼들을 직접 export (하지만 일반적으로 createDebugHelpers 권장)
|
||||||
|
*/
|
||||||
|
export const createSimpleHelpers = () => {
|
||||||
|
// 기본값으로는 모두 비활성화 (각 파일에서 명시적으로 활성화해야 함)
|
||||||
|
return {
|
||||||
|
dlog: () => {},
|
||||||
|
dwarn: () => {},
|
||||||
|
derror: () => {},
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -52,21 +52,11 @@ import { useFocusHistory } from '../../hooks/useFocusHistory/useFocusHistory';
|
|||||||
import usePrevious from '../../hooks/usePrevious';
|
import usePrevious from '../../hooks/usePrevious';
|
||||||
import { useVideoPlay } from '../../hooks/useVideoPlay/useVideoPlay';
|
import { useVideoPlay } from '../../hooks/useVideoPlay/useVideoPlay';
|
||||||
import ImagePreloader from '../../utils/ImagePreloader';
|
import ImagePreloader from '../../utils/ImagePreloader';
|
||||||
|
import { createDebugHelpers } from '../../utils/debug';
|
||||||
|
|
||||||
// Toggle debug logging for this module (false by default)
|
// 디버그 헬퍼 설정
|
||||||
const DEBUG_MODE = false;
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
const dlog = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.log(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const derror = (...args) => {
|
|
||||||
console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
// DetailPanelBackground 이미지 imports for preloading
|
// DetailPanelBackground 이미지 imports for preloading
|
||||||
import hsn from '../../../assets/images/bg/hsn_new.png';
|
import hsn from '../../../assets/images/bg/hsn_new.png';
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import Spotlight from '@enact/spotlight';
|
import Spotlight from '@enact/spotlight';
|
||||||
|
import { createDebugHelpers } from '../../../../utils/debug';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
setHidePopup,
|
setHidePopup,
|
||||||
@@ -51,6 +52,10 @@ import TPanel from '../../../../components/TPanel/TPanel';
|
|||||||
import TermsPopup from './TermsPopup';
|
import TermsPopup from './TermsPopup';
|
||||||
import OptionalTermsInfo from './OptionalTermsInfo';
|
import OptionalTermsInfo from './OptionalTermsInfo';
|
||||||
|
|
||||||
|
// 디버그 헬퍼 설정
|
||||||
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
|
|
||||||
// SVG 아이콘 컴포넌트
|
// SVG 아이콘 컴포넌트
|
||||||
const ExpandIcon = ({ className }) => (
|
const ExpandIcon = ({ className }) => (
|
||||||
<svg
|
<svg
|
||||||
@@ -71,18 +76,6 @@ const ExpandIcon = ({ className }) => (
|
|||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|
||||||
// Local debug helpers (matches src/lunaSend/common.js pattern)
|
|
||||||
const DEBUG_MODE = false;
|
|
||||||
const dlog = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.log(...args);
|
|
||||||
};
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
const derror = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 혜택 이미지 컴포넌트
|
// 혜택 이미지 컴포넌트
|
||||||
const BenefitImage = ({ className, onClick }) => {
|
const BenefitImage = ({ className, onClick }) => {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import SpotlightContainerDecorator from '@enact/spotlight/SpotlightContainerDeco
|
|||||||
import { setContainerLastFocusedElement } from '@enact/spotlight/src/container';
|
import { setContainerLastFocusedElement } from '@enact/spotlight/src/container';
|
||||||
|
|
||||||
import dummyVtt from '../../../assets/mock/video.vtt';
|
import dummyVtt from '../../../assets/mock/video.vtt';
|
||||||
|
import { createDebugHelpers } from '../../utils/debug';
|
||||||
import {
|
import {
|
||||||
changeAppStatus,
|
changeAppStatus,
|
||||||
changeLocalSettings,
|
changeLocalSettings,
|
||||||
@@ -66,20 +67,9 @@ import TabContainerV2 from './PlayerTabContents/v2/TabContainer.v2';
|
|||||||
|
|
||||||
const Container = SpotlightContainerDecorator({ enterTo: 'last-focused', preserveId: true }, 'div');
|
const Container = SpotlightContainerDecorator({ enterTo: 'last-focused', preserveId: true }, 'div');
|
||||||
|
|
||||||
// Toggle debug logging for this view
|
// 디버그 헬퍼 설정
|
||||||
const DEBUG_MODE = false;
|
const DEBUG_MODE = false;
|
||||||
|
const { dlog, dwarn, derror } = createDebugHelpers(DEBUG_MODE);
|
||||||
const dlog = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.log(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const dwarn = (...args) => {
|
|
||||||
if (DEBUG_MODE) console.warn(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const derror = (...args) => {
|
|
||||||
console.error(...args);
|
|
||||||
};
|
|
||||||
|
|
||||||
const findSelector = (selector, maxAttempts = 5, currentAttempts = 0) => {
|
const findSelector = (selector, maxAttempts = 5, currentAttempts = 0) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user