playwright ํ…Œ์ŠคํŠธ ์ „ ํ•„์š”ํ•œ ๊ฒƒ๋“ค setupํ•˜๊ธฐ (feat. beforeMount ์‚ฌ์šฉ)
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 8. 28. 09:28

์—๋Ÿฌ ๋ฐœ์ƒreact-router-dom๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ฝ”๋“œ์˜ playwright ํ…Œ์ŠคํŠธ ์ค‘ ์•„๋ž˜์™€ ๊ฐ™์ด useNavigate ๊ด€๋ จ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹จ์ˆœ ํ•ด๊ฒฐuseNavigate๋Š” react-router-dom ์˜ ํ›…์œผ๋กœ ์„œ์นญํ•ด๋ณด๋‹ˆ MemoryRouter ๋กœ ๊ฐ์‹ธ์ฃผ๋ฉด ๋œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. const component = await mount( , { hooksConfig } ); ์ด๋ ‡๊ฒŒ mount ์‹œ์— ๋‹จ์ˆœํžˆ ๊ฐ์‹ธ๋Š” ์‹์œผ๋กœ ํ•ด๊ฒฐํ•  ์ˆ˜๋„ ์žˆ๊ฒ ์ง€๋งŒ, ์ด ๋ถ€๋ถ„์„ ๊ณตํ†ตํ™” ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ณตํ†ตํ™” ์‹œ๋„ 1import { MemoryRouter } from 'react-router-dom';import { AuthContext } from '@contexts';export const TE..

vite ํ”„๋กœ์ ํŠธ์—์„œ playwright ์„ค์ • ์‹œ type ๊ด€๋ จ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 8. 6. 00:25

vite ํ”„๋กœ์ ํŠธ์—์„œ playwright ๋ฅผ ์„ค์ •ํ–ˆ์„ ๋•Œ, typecheck ๋ฅผ ๋Œ๋ฆฌ๋ฉด spec.tsx ์—์„œ ํƒ€์ž… ๊ด€๋ จ ์—๋Ÿฌ๊ฐ€ ๋‚œ๋‹ค. ์ด ๋•Œ๋Š” `@playwright/test` ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ด์„œ tsconfig์˜ compilerOptions.types ํ•„๋“œ์— ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.{ "compilerOptions": { "types": ["node", "vite/client", "jest", "@testing-library/jest-dom", "@playwright/test"], }}

[Git] revert commit is ignored when merge branch
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 6. 26. 01:00

๋ฌธ์ œbranchA ์— revert commit ์ด ํฌํ•จ๋˜์–ด ์žˆ๊ณ  main ์—๋Š” ์—†์„ ๋•Œ, branchA ์—์„œ `git merge main` ์„ ์ˆ˜ํ–‰ํ•˜๋ฉด main ๋ธŒ๋žœ์น˜์˜ ์ƒํƒœ์™€ ๋™์ผํ•˜๊ฒŒ revert commit ์ด ์—†๋Š” ๊ฒƒ์ฒ˜๋Ÿผ ๋ฌด์‹œํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. merge recursive ์ „๋žตgit ์—์„œ๋Š” merge ๋ช…๋ น์–ด ์‚ฌ์šฉ ์‹œ ๊ธฐ๋ณธ ์ „๋žต์œผ๋กœ recursive ๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๋ฐ, ์ด ์ „๋žต์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.1. ๋‘ ์ปค๋ฐ‹์˜ ๊ณตํ†ต ์กฐ์ƒ ์ปค๋ฐ‹์„ ์ฐพ์Šต๋‹ˆ๋‹ค.2. ๊ฐ ๋ธŒ๋žœ์น˜์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์กฐํ•ฉํ•ด ์ƒˆ๋กœ์šด ๋ณ‘ํ•ฉ ์ปค๋ฐ‹์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.3. 2๋ฒˆ์—์„œ ์ถฉ๋Œ์ด ๋‚˜๋ฉด ์‚ฌ์šฉ์ž์—๊ฒŒ ํ•ด๊ฒฐ์„ ์œ„์ž„ํ•ฉ๋‹ˆ๋‹ค. (recursive ์ „๋žต) ์ด์Šˆ ์ƒํ™ฉ ์ž์„ธํžˆ ์ด์Šˆ๊ฐ€ ์ƒ๊ฒผ๋˜ ์ƒํ™ฉ์„ ๊ทธ๋Œ€๋กœ ๊ฐ€์ ธ์™€๋ดค์Šต๋‹ˆ๋‹ค.main branch ์—์„œ 24.12.0 ๋ธŒ๋žœ์น˜๋ฅผ..

require() of ES Module someFile.js from someFile2.js not supported ์ด์Šˆ ํ•ด๊ฒฐ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 6. 23. 17:17

์—๋ŸฌError [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/packageA/node_modules/packageB/dist/index.cjs.js from /app/node_modules/packageA/dist/cjs/hooks.js not supported.index.cjs.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.Instead either rename index..

์•„์ดํฐ ์ฒœ์ง€์ธ ํ‚ค๋ณด๋“œ ์ด์Šˆ (แ„‹แ†ž, แ„‹แ†ข ๋Œ€์‘)
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2024. 4. 11. 11:21

์•„์ดํฐ ์ฒœ์ง€์ธ ํ‚ค๋ณด๋“œ์—์„œ "์œ ์š”" ๋ผ๋Š” ๊ธ€์ž๋ฅผ ์ž…๋ ฅํ•  ๋•Œ, "์œต" -> "์œ แ„‹แ†ž" -> "์œ แ„‹แ†ข" ์ด๋ ‡๊ฒŒ ์ž…๋ ฅ์ด ๋˜๋Š”๋ฐ ํ•œ๊ธ€๋งŒ ๋Œ€์‘ํ•˜๊ธฐ ์œ„ํ•ด ๋„ฃ์–ด๋‘์—ˆ๋˜ regex ๊ฐ€ ๋™์ž‘ํ•˜๋ฉด์„œ ๊ธ€์ž๋ฅผ ์ง€์›Œ๋ฒ„๋ฆฌ๋Š” ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. [๊ธฐ์กด Regex]return target.replace(/[^๊ฐ€-ํžฃใ†แ†žแ†ขใ„ฑ-ใ…Žใ…-ใ…ฃa-zA-Z\s]/g, '');ํ•œ๊ธ€, ์˜์–ด๊ฐ€ ์•„๋‹Œ ๋ฌธ์ž๋Š” ์ œ๊ฑฐํ•˜๊ธฐ ์œ„ํ•œ regex ์ž…๋‹ˆ๋‹ค. [์ด์Šˆ ์›์ธ] ์ข…์„ฑ ์ž์Œ๊ณผ ใ†แ†žแ†ข ๊ฐ™์€ ์ฒจ์ž๊ฐ€ ํ•ฉ์ณ์ง€๋ฉด์„œ ์ƒˆ๋กœ์šด ์œ ๋‹ˆ์ฝ”๋“œ ๋ฌธ์ž๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. [๋ณ€๊ฒฝ๋œ Regex]/*** ์•„์ดํฐ ์ฒœ์ง€์ธ์„ ๋Œ€์‘ํ•ฉ๋‹ˆ๋‹ค.* \u1100-\u1112 ์ž์Œ ใ„ฑ-ใ…Ž* \u318D\u119E\u11A2\u2022\u2025\u00B7\uFE55 - ใ†แ†žแ†ข•โ€ฅ·๏น•*/ret..

[Next JS] Anchoring issue :: SWR / react-query ์‚ฌ์šฉ ์‹œ ์ฃผ์˜ํ•  ์ 
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2022. 2. 20. 15:39

์˜ค๋Š˜์€ Next JS์—์„œ Client Data fetching ์‚ฌ์šฉ ์‹œ ๋งˆ์ฃผํ•  ์ˆ˜ ์žˆ๋Š” Anchoring ์ด์Šˆ์— ๋Œ€ํ•ด ์ •๋ฆฌํ•˜๋ ค ํ•ฉ๋‹ˆ๋‹ค. Next JS docs์—์„œ ๊ถŒ์žฅํ•˜๊ณ  ์žˆ๋Š” ์ฝ”๋“œ ์Šคํƒ€์ผ์„ ์ ์šฉํ–ˆ์„ ๋•Œ ์ƒ๊ธธ ์ˆ˜ ์žˆ๋Š” ์ด์Šˆ์ด๊ธฐ ๋•Œ๋ฌธ์—, ๊ด€๋ จ ์ด์Šˆ๊ฐ€ ์ƒ๊ฒผ์„ ๋•Œ ์ €๋Š” ๋””๋ฒ„๊น…์— ์‹œ๊ฐ„์„ ๊ฝค๋‚˜ ์ผ์Šต๋‹ˆ๋‹ค. ๋จผ์ € Next JS์˜ Data fetching์— ๋Œ€ํ•œ ์ง€์‹์ด ์ „๋ฌดํ•  ๋ถ„๋“ค์„ ์œ„ํ•ด ๊ฐœ๋…๋ถ€ํ„ฐ ์ •๋ฆฌํ•˜๊ณ  ์ด์Šˆ์— ๋Œ€ํ•œ ํ•ด๊ฒฐ ๊ณผ์ •์„ ์ฐจ๋ก€๋กœ ์ ์–ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Data fetching Next JS๋ฅผ ์ด์šฉํ•œ Data fetching์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๊ณต์‹ ๋ฌธ์„œ๋ฅผ ์ฐธ์กฐํ•ด์ฃผ์„ธ์š”! getStaticProps / getServerSideProps : Server Side์—์„œ ๋ฏธ๋ฆฌ page h..

Android์˜ ๋„ค์ด๋ฒ„ ์•ฑ์—์„œ ๋ ˆ์ด์•„์›ƒ ๊นจ์งˆ ๋•Œ (flex-shrink ๋ฏธ์ง€์›)
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2022. 1. 23. 11:54

๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•˜๋ฉด์„œ ์•ˆ๋“œ๋กœ์ด๋“œ OS์—์„œ ๋„ค์ด๋ฒ„ ์•ฑ์„ ์‚ฌ์šฉํ•  ๋•Œ (ํŠน์ • ์•ˆ๋“œ๋กœ์ด๋“œ ๋ฒ„์ „ - ์•„๋งˆ๋„ 11 ์ด์ƒ ์—์„œ๋งŒ) flex ๋ ˆ์ด์•„์›ƒ์ด ๊นจ์ง€๋Š” ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค. css๋ฅผ ๋‹ค๋ฐฉ๋ฉด์œผ๋กœ ๊ณ ์ณ๋ณด๋ฉด์„œ ํ•ด๊ฒฐํ•ด๋ณด์•˜๋Š”๋ฐ, ์›์ธ์€ 'flex-shrink๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š๋Š” ๊ฒƒ'์ด์—ˆ๋‹ค. (caniuse) ๋ฐ˜์‘ํ˜• ์›น์„ ๊ตฌ์ถ•ํ•  ๊ฒฝ์šฐ ํ•ด๋‹น ์‚ฌ๋ก€๋ฅผ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด css ์ฝ”๋“œ์— flex-shrink ์‚ฌ์šฉ์„ ์ง€์–‘ํ•˜๋„๋ก ํ•˜์ž.

Next/link ์‚ฌ์šฉ ์‹œ mouseEnter ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ๊ฐ€ ์ž‘๋™ํ•˜์ง€ ์•Š๋Š” ํ˜„์ƒ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2022. 1. 9. 10:16

๋ฌธ์ œ ์ƒํ™ฉ next/link๋ฅผ ์‚ฌ์šฉํ•œ GNB์˜ mouseEnter event๊ฐ€ ์ž‘๋™ํ•˜์ง€ ์•Š์•„์„œ ๋ฉ”์ธ ๋ฉ”๋‰ด์— ๋งˆ์šฐ์Šค๋ฅผ ์›€์ง์—ฌ๋„ subMenu๊ฐ€ ๋ฐ”๋€Œ์ง€ ์•Š๋Š” ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค. ์›์ธ GNB์—์„œ ์‚ฌ์šฉํ•˜๋Š” LinkContext์˜ SuperLink๋ฅผ next/link๋กœ ์ฒ˜๋ฆฌํ–ˆ๋Š”๋ฐ, next 12 version์—์„œ mouseHover ์ด๋ฒคํŠธ๊ฐ€ ์ œ๋Œ€๋กœ ์ž‘๋™ํ•˜์ง€ ์•Š๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค. fix(Link): Do not ignore onMouseEnter prop with absolute href by ericmatthys · Pull Request #32012 · vercel/next.js Fixes #22733 Regardless of whether it's recommended that Link be used with e..