Author Archives: itpsolver

[링크] React HOC(higher-order component) 관련

By | 7월 29, 2022

사용처 UI패턴은 유사한데(e.g. 목록화면), 데이터소스가 다른 경우(분류/필터링이 달라서 다른 목록이 도출되는 화면들), UI출력 관련 중복코드를 줄이는 데 사용하는 것 같다. 참고 [React] Hook과 함께 HOC 사용해보기

[react/vite] Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]=

By | 7월 22, 2022

vite 환경에서 토스트그리드(toast grid)를 사용하는데, 로컬에서는 잘 돌아가는데, 빌드 후 nginx에 올리니 위 제목과 같은 스크립트 에러가 발생하고 화면이 뜨질 않았다. 얼마간의 검색 후, 해결이라기 보다는 우회책을 찾게 되어 기록한다. Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=object&args[]= 페이지보다 선행되는 ajax call에 에러가 없는지 점검 (e.g. /api/v1/getMsgList) 1에 문제가 없다면 일부 서드파티 라이브러리에서 ESM에 적합하지 않은… Read More »

vite react build시 에러 메시지와 함께 엔터를 한 번 눌러줘야 빌드가 되었던 현상

By | 7월 21, 2022

package.json … "scripts": { … "dev": "cross-env NODE_ENV=development API_ENV=dev vite", "build": "cross-env NODE_ENV=production API_ENV=dev tsc && vite build", "buildProd": "cross-env NODE_ENV=production API_ENV=prod vite tsc && vite build", … }, … 여기서 bulidProd 실행시에 [Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.] 라는 에러메시지와… Read More »

[javascript] 객체(object)를 완전히 상수화(constants) 하기 (deepFreeze)

By | 7월 15, 2022

const 선언으로는 변수 바인딩을 고정할 수 있지만, 해당 변수의 값이 object일 경우, object 내의 값이 변경되는 것을 막을 수는 없다. Object.freeze()로는 1depth까지는 막을 수 있어도 2depth 이상은 막을 수 없다. 그래서 찾아보니 deep freeze를 구현한 구현체가 npm에 존재했다. https://www.npmjs.com/package/deep-freeze

[링크] mybatis 에서 package 단위의 typealias를 정의할 때 wildcard (*) 사용하기

By | 7월 15, 2022

요약 아래의 형태 가능 (since mybatis-spring 2.0.1) mybatis.type-aliases-package=com.example.**.model mybatis.type-handlers-package=com.example.*.typehandler mybatis-config.xml 에서는 지원하지 않음 그냥 mybatis 가 아니라 mybatis-spring에서 지원하는 기능이기 때문 원글 https://github.com/mybatis/spring-boot-starter/issues/314

[node.js] 초간단 api 서버 샘플코드

By | 7월 6, 2022

환경 node 16.15.1 package.json { "name": "test-mock-server", "main": "app.js", "packageManager": "yarn@3.2.1", "dependencies": { "cors": "^2.8.5", "express": "^4.18.1" } } app.js var express = require("express"); var cors = require("cors"); var app = express(); app.listen(4000, () => { console.log("Server running on port 4000"); }); app.use(cors()); app.get("/testList", (req, res, next) => { res.json({ data: { list: [ {… Read More »

[펌글] SpringDoc (swagger 생성기) 을 노출하지 않기 (운영환경에서 필요할 듯)

By | 7월 4, 2022

Hi, This feature will be added on v1.2.12, of springdoc-openapi. This property helps you disable only the ui. springdoc.swagger-ui.enabled=false The following property, will help you disable the api-docs Rest endpoints as well: springdoc.api-docs.enabled=false 출처 https://github.com/springdoc/springdoc-openapi/issues/191