What I struggled ๐Ÿง—/๐Ÿ“ฃ brag In

Week 45, 2024 - Nuxt generate fail in Node v22

[x]์—์„œ Node v20์—๋Š” build ๋˜๋Š”๋ฐ v22์—์„œ build ์•ˆ๋˜๋Š” ๋ฒ„๊ทธ ์ฆ์ƒ - generate command does not return/close on success ๊ฐ™์€ nuxt ๊ธฐ๋ฐ˜ project์ธ [.co.kr]์€ v22์—์„œ build ๋จ

Nuxt 3.13.2 with Nitro 2.9.7์œผ๋กœ ๊ฐ™๊ณ , vite๋Š” 5.4.7, 5.4.10๋กœ ์ฐจ์ด๋‚œ๋‹ค. (์ „์ž๊ฐ€ [x])

์˜์‹ฌ๊ฐ€๋Š” ๋ถ€๋ถ„

5.4.8 (2024-09-25)

  • fix(css): backport #18113, fix missing source file warning with sass modern api custom importer (#18 (7d47fc1 ), closes #18183

ํŽ˜์ด์ง€ ์ด๋™ ์‹œ ๋‹ค์Œ ํŽ˜์ด์ง€๊ฐ€ ์บ์‹œ๋˜์ง€ ์•Š์„ ๊ฒฝ์šฐ ์ง€์—ฐ์‹œ๊ฐ„์ด ์žˆ๋Š”๋ฐ, ๊ทธ ๋™์•ˆ ํ˜„์žฌ ํŽ˜์ด์ง€ top:0์œผ๋กœ ์ด๋™ ํ›„์— ๋‹ค์Œ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ด์„œ UX ์ƒ ๊ฑฐ์Šฌ๋ฆผ

nuxt page blink during nav

Week 35, 2024 - Safari infinite translateX animation flickers on loop

Adding -webkit-transform: translateZ(0); to img or picture element will do the trick #

scroll element ๋‚ด์˜ <picture> + lazy loading์ด ์ œ๋Œ€๋กœ ์•ˆ๋˜๋Š” ๋ฒ„๊ทธ๋„ ์žˆ์–ด eager๋กœ ๋ฐ”๊ฟˆ

Week 25, 2024 - PDF Generator

์ด์ „ Pdf Generator project๋ฅผ ๋‹ค์‹œ ์จ์•ผ ๋  ์ƒํ™ฉ์ด ์™€์„œ project๋ฅผ ๊ฐ€์ ธ์™€ package upgradeํ•ด์„œ ์„ธํŒ…ํ•ด๋ณด๋‹ˆ Chromium launch error ๋ช‡ ๊ฐ€์ง€ ๋ฐœ์ƒ (Security.setIgnoreCertificateErrors, ๋“ฑ) 2~30๋ถ„ ํ–ˆ๋Š”๋ฐ ๋‹ค๋ฅธ error ๋ฐœ์ƒํ•ด์„œ ์˜ˆ์ „ version์œผ๋กœ ๋Œ๋ฆฌ๋‹ˆ ์ œ๋Œ€๋กœ ๋œ๋‹ค.

Week 24, 2024 - iOS border height style

<section class="!h-4 | flex gap-1 | text-10">
  <div
    class="w-fit font-bold px-[6px] rounded-full | flex items-center"
    :class="
              isNutritionCard
                ? 'text-grey-500 border border-grey-500'
                : 'text-grey-50 bg-[#00000099]'
            "
  >
    <!--! chip์—์„œ ์ง์ ‘ height๋ฅผ ์ง€์ •ํ•˜๋ฉด, border ์œ ๋ฌด์— ๋”ฐ๋ผ iOS safari์™€ ๋‹ค๋ฅธ browser์—์„œ height ๊ณ„์‚ฐ์„ ๋‹ค๋ฅด๊ฒŒ ํ•ด์„œ parent์—์„œ height๋ฅผ ๊ณ ์ • -->
    {{ topic.category }}
  </div>
</section>

๋น„์Šทํ•˜๊ฒŒ chip class style ์ž‘์„ฑํ•  ๋•Œ, padding-top ์žก๋Š” ์œ„์น˜๊ฐ€ 1px ์ฐจ์ด๋‚˜์„œ ์ด๊ฑธ ๊ณ ์น˜๋ฉด ํ•˜๋‚˜์”ฉ ์—‡๋‚˜๊ฐ€๋ณด์—ฌ, height 25px โ†’ 26px ๋กœ ์ˆ˜์ •ํ•œ case๋„ ์žˆ๋‹ค.

Week 21, 2024 - Swiper

์˜ค๋ฅธ์ชฝ ๋๊นŒ์ง€ swipe ํ–ˆ์„ ๋•Œ ๋นˆ ๊ณต๊ฐ„์ด ๋‚จ๋Š”๋‹ค.

|โ—ผ๏ธโ—ผ๏ธโ—ผ๏ธ| โ†’ |โ—ผ๏ธโ—ป๏ธโ—ป๏ธ|

์ด๋ฒˆ์— major version v11๋กœ updateํ•œ Swiper core API๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด slidesOffsetAfter ๊ฐ’์„ ์ˆ˜๋™์œผ๋กœ ๊ณ„์‚ฐํ•ด์„œ ๋„ฃ์œผ๋ฉด ๋˜๊ธด ํ•˜์ง€๋งŒ, ์ด์ „์— Swiper element ์“ด code๋“ค์€ ์ € ๊ณ„์‚ฐ ์—†์ด ์ •์ƒ ๋™์ž‘ํ•œ๋‹ค.

<swiper-container slides-per-view="auto">
  <swiper-slide class="w-16" />
</swiper-container>

core API์—๋„ slidesPerView์™€ width ์„ค์ •ํ•ด๋ดค์ง€๋งŒ ์ค‘๊ฐ„์— layer ํ•˜๋‚˜๊ฐ€ ์ถ”๊ฐ€๋œ ๊ฒƒ ๋•Œ๋ฌธ์ธ์ง€ ์•ˆ๋จ.

Week 16, 2024 - Blurry text on canvas

๋ชจ๋‹ˆํ„ฐ 3๊ฐœ ์‚ฌ์šฉ ์ค‘์ธ๋ฐ, ๋งฅ๋ถ ๋ชจ๋‹ˆํ„ฐ์—์„œ canvas์—์„œ ์ด๋ฏธ์ง€ ์ €์žฅํ•œ ํŒŒ์ผ์˜ text๊ฐ€ ํ๋ฆฌ๊ฒŒ ๋ณด์ž„

const canvas = document.createElement("canvas")
const scale = window.devicePixelRatio || 1 // ํ…์ŠคํŠธ๊ฐ€ ํ๋ฆฌ๊ฒŒ ๋ณด์—ฌ device pixel ratio์— ๋”ฐ๋ผ ๋ฐฐ์œจ ์กฐ์ •ํ•˜์—ฌ ์ €์žฅ
canvas.width = 360 * scale
canvas.height = 576 * scale
canvas.style.width = "360px"
canvas.style.height = "576px"
const ctx = canvas.getContext("2d")
ctx.scale(scale, scale)

Week 14, 2024 - Dynamic route path on Nuxt generate

๋น„ํšŒ์› ๋ฆฌํฌํŠธ ์ƒ์„ธ ํŽ˜์ด์ง€๋ฅผ ๋ชจ๋ฐ”์ผ์—์„œ ์—ด๋žŒํ•˜๋‹ค ์˜๋„์น˜ ์•Š๊ฒŒ ํ™”๋ฉด์„ ๋Œ์–ด๋‚ด๋ ค refresh๋ฅผ ์ผ์œผํ‚ด โ†’ dynamic route path๋Š” nuxt generate ์‹œ์— ์ฒ˜์Œ access point๋กœ ์“ฐ๋ฉด / ๋กœ redirection ๋จ

/login error ํ™”๋ฉด์ด ๋‚˜์˜ด โ†’ Navigate Back์œผ๋กœ ๋น„ํšŒ์› ๋ฆฌํฌํŠธ ์š”์•ฝํŽ˜์ด์ง€์— ์ด๋™ํ•˜๋ฉด, access URI๊ฐ€ ํšŒ์›์šฉ(/login)์ด๊ธฐ ๋•Œ๋ฌธ์— $auth.requestAuth๊ฐ€ setup๋˜์ง€ ์•Š์•„ ํ•ด๋‹น error๊ฐ€ ๋ฐœ์ƒ (s.requestAuth is not a function)

  1. mobile์—์„œ ์˜๋„์น˜ ์•Š๊ฒŒ refresh ๋˜์ง€ ์•Š๊ฒŒ overscroll-behavior: contain ์œผ๋กœ mitigate
  2. $auth.requestAuth ๊ฐ€ setup์•ˆ๋˜๋ฉด page refresh ์‹œ์ผœ์„œ ํ•ด๊ฒฐ

Week 12, 2024 - primevue new theme layer

์‚ฌ์šฉ ์ค‘์ธ primevue theme์ด

  • 3.46.0์—์„  ์ •์ƒ์ž‘๋™
  • 3.47.0์—์„  checkbox style ๋ง๊ฐ€์ง
  • 3.48์—์„œ deprecated

https://github.com/primefaces/primevue/issues/5220 https://github.com/primefaces/primevue/blob/master/CHANGELOG.md#3480-2024-02-05 #5201 theme์— ์“ฐ์ด๋Š” class๋Š” ์™ ๋งŒํ•ด์„œ ์•ˆ๋ฐ”๋€”์ค„ ์•Œ์•˜๋Š”๋ฐ minor์—์„œ break๋˜๋‹ค๋‹ˆ...

/nonmember/report์—์„œ autocomplete ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ๋„์šด ํ›„, ํŽ˜์ด์ง€ ์ด๋™, ๋Œ์•„์˜ค๋ฉด layer ์ˆœ์„œ๊ฐ€ ๋ฐ”๋€Œ์–ด์„œ style์ด ์ฃ„๋‹ค ๊นจ์ง.

์ด์ „์— FOUC ๋•Œ๋ฌธ์— primevue์—์„œ dynamicํ•˜๊ฒŒ import ํ•˜๋Š” style resource๋“ค์„ ์šฐ์„  ์ˆœ์œ„ ๋‚ฎ์ถ”๊ธฐ ์œ„ํ•ด ์•ž์ชฝ์— import ์‹œํ‚ค๋Š” code ๋•Œ๋ฌธ์— ๋ฐœ์ƒ. -> ์ œ๊ฑฐ

Week 12, 2024 - Wix shopify referral

Terminology

  1. ํšŒ์› ๋ฐœ์†ก ๋ฉ”์ผ์—์„œ ์ ‘๊ทผ ref code ์ดํ•˜ rc -> sendgrid ๋Œ€์ƒ์ž์˜ ๊ตฌ๋งค๋Š” ๊ณ ๋ ค์น˜ ์•Š์Œ์œผ๋กœ ์ธํ•ด rc link๊ฐ€ ํ•„์š” ์—†๊ฒŒ ๋จ
  2. ํšŒ์›์ด ๊ณต์œ ํ•œ URL๋กœ ์ ‘๊ทผ forward code ์ดํ•˜ fc ->
  3. ํšŒ์›์ด ์•„๋‹Œ ์‚ฌ๋žŒ์ด ๊ณต์œ ํ•˜๊ฑฐ๋‚˜ ์ง์ ‘ ์ ‘๊ทผ no code ์ดํ•˜ nc

Access URL

  1. rc - https://promo.genoplan.com/cancer-prevention-support-campaign/?rc={{ref-code}}
  2. fc - https://promo.genoplan.com/cancer-prevention-support-campaign/?fc={{ref-code}}
  3. nc - https://promo.genoplan.com/cancer-prevention-support-campaign/

๊ณต์œ  URL

๊ณต์œ ํ•˜๊ธฐ ๋ฒ„ํŠผ์—์„œ clipboard๋กœ copy, SNS ๊ณต์œ 

  1. rc - https://promo.genoplan.com/cancer-prevention-support-campaign/?fc={{ref-code}}
  2. fc - https://promo.genoplan.com/cancer-prevention-support-campaign/ (์˜ ๋‹จ์ถ• ๋ฒ„์ „) - ref code ๊ฐ€์ง€๊ณ  1๋‹จ๊ณ„ ์ด์ƒ ์ถ”์  ๊ฐ€๋Šฅํ•˜๊ธด ํ•œ๋ฐ... ์ผ๋‹จ ์ถ”์ ์€ ์•ˆํ•˜๋Š” ๊ฑธ๋กœ ๊ธฐํš
  3. nc - https://promo.genoplan.com/cancer-prevention-support-campaign/ (์˜ ๋‹จ์ถ• ๋ฒ„์ „)

ref-code๊ฐ€ ์ž˜๋ชป๋ซด์„ ๋•Œ ์–ด์ฐŒ ์ฒ˜๋ฆฌ๋˜๋Š”๊ฐ€? โ†’ shopify์—์„œ code ์—†๋Š” ๊ฑธ๋กœ ์ฒ˜๋ฆฌ๋จ

shopify URL

11,000์—” ๊ตฌ์ž…

  1. rc - ref-code ์จ์„œ ์ถ”์  ์šฉ๋„๋กœ - https://jp.store.genoplan.com/discount/{{ref-code}}?redirect=%2Fproducts%2F%E3%82%AA%E3%83%A0%E3%82%AD%E3%83%AA%E6%A7%98%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88
  2. fc - ref-code ์จ์„œ ์ถ”์  ์šฉ๋„๋กœ - https://jp.store.genoplan.com/discount/{{ref-code}}?redirect=%2Fproducts%2F%E3%82%AA%E3%83%A0%E3%82%AD%E3%83%AA%E6%A7%98%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88
  3. nc - https://jp.store.genoplan.com/products/%E3%82%AA%E3%83%A0%E3%82%AD%E3%83%AA%E6%A7%98%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88

wix์—์„œ code ํฌํ•จ๋œ shopify url ๋ฒ„ํŠผ์œผ๋กœ ์—ฐ๊ฒฐ - https://www.wix.com/wix-lp/new-wixcode/forum/coding-with-velo/solved-how-to-open-in-new-tab-with-wix-location

9,900์—” ๊ตฌ์ž…

  1. rc - ref-code๋ฅผ ๊ฐ€์ง€๊ณ  ๋ฏธ๋ฆฌ ์ƒ์„ฑํ•œ discount code๋ฅผ ๊ฐ€์ ธ์˜ด - https://jp.store.genoplan.com/discount/{{discount-code}}?redirect=%2Fproducts%2F%E3%82%AA%E3%83%A0%E3%82%AD%E3%83%AA%E6%A7%98%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88
  2. fc - ref-code๋ฅผ ๊ฐ€์ง€๊ณ  ๋ฏธ๋ฆฌ ์ƒ์„ฑํ•œ discount code๋ฅผ ๊ฐ€์ ธ์˜ด - https://jp.store.genoplan.com/discount/{{discount-code}}?redirect=%2Fproducts%2F%E3%82%AA%E3%83%A0%E3%82%AD%E3%83%AA%E6%A7%98%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88
  3. nc - https://jp.store.genoplan.com/discount/OMUKIRI?redirect=%2Fproducts%2F%E3%82%AA%E3%83%A0%E3%82%AD%E3%83%AA%E6%A7%98%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88
  • ํ• ์ธ์ฝ”๋“œ ํฌํ•จ๋œ ๋งํฌ๋ฅผ wix email์— ๋„ฃ์„ ์ˆ˜ ์žˆ๋Š”๊ฐ€? form text input์œผ๋กœ ์ฒ˜๋ฆฌํ•จ + hidden

etc

  • discount์šฉ, no-discount์šฉ ๋‘˜ ๋‹ค concatํ•œ URL์„ ๋ฉ”์ผ๋กœ ์˜๋ฉด code ์ฐพ์œผ๋ ค๊ณ  requestํ•  ํ•„์š”๋Š” ์—†์Œ
  • ํ• ์ธ์ด 0์œผ๋กœ ํ‘œ์‹œ๋ ํ…๋ฐ... ์‚ฌ์†Œํ•œ๊ฐ€
  • ๋‚˜์ค‘์— shopify์—์„œ ์ „์ฒด ๋ฆฌ์ŠคํŠธ ๋‹ค์šด ๋ฐ›์•„์„œ code ์‚ฌ์šฉ ์ˆ˜ ์ถ”์ถœ

Week 12, 2024 - dynamic page with Lazy component

bo์—์„œ service ํŽ˜์ด์ง€๋ฅผ ์—ด๊ณ , ๋ฆฌํฌํŠธ์—์„œ ์ƒ์„ธ ํ•ญ๋ชฉ์„ ํด๋ฆญํ•˜๋ฉด

Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: /_nuxt/_code_.EESJVKCf.js

error๋ฅผ ๋ฑ‰์œผ๋ฉด์„œ / ํŽ˜์ด์ง€ refresh ๋œ๋‹ค. ๋’ค๋กœ ๊ฐ€๊ธฐํ•œ ๋’ค์— ๋‹ค์‹œ ์ƒ์„ธ ํ•ญ๋ชฉ ํด๋ฆญํ•˜๋ฉด /_nuxt/_code_._MbpWpiu.js ์ ‘๊ทผํ•˜๋ฉด์„œ ์ •์ƒ ๋™์ž‘.

[code] ๊ฐ™์€ dynamic page๋ฅผ <Lazy> component์—์„œ ์ ‘๊ทผํ•˜๋ฉด lazy์˜ import์™€ ๊ฐ™์ด ์ž‘์šฉํ•˜๋ฉด์„œ ๋ฒ„๊ทธ ๋ฐœ์ƒํ•˜๋Š” ๋“ฏ lazy ์ œ๊ฑฐํ•˜๋‹ˆ ์ •์ƒ ๋™์ž‘

Week 10, 2024 - get Shopify order data on wix

requirements

  • token of shopify Custom app with read order auth
  • Wix backend code calling Shopify API to bypass CORS

shopify order์˜ status open ์ด ํŒ๋งค ์ค‘์ธ ์ƒํ’ˆ์ธ์ค„ ์•Œ์•˜๋Š”๋ฐ ๋ฐœ์†ก ์•ˆํ•œ ์ƒํƒœ(๋ฏธ์ฒ˜๋ฆฌ) any, closed์— ์ทจ์†Œ ๊ฑด ์ˆ˜๋„ ๋“ค์–ด๊ฐ

ํ•œ ํŽ˜์ด์ง€์— 250๊ฐœ ์ œํ•œ์— product_id๋กœ filter๋Š” ๋ฐ์ดํ„ฐ ๋ฐ›์€ ํ›„์— ๊ฐ€๋Šฅ. cursor based pagination์ด๋ผ... open+์†์œผ๋กœ closed ํ•ด์•ผ ๊ฒ ๋Š”๋ฐ?

Week 09, 2024 - Nuxt3 template single wrapper

Nuxt3 project์—์„œ ํŽ˜์ด์ง€ ์ƒˆ๋กœ ๊ณ ์นจ ํ›„์— API data ๋ฐ›์•„์„œ v-if๋กœ DOM ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒฝ์šฐ ๋‹ค์Œ error๊ฐ€ ๋ฐœ์ƒ

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'insertBefore') at insert (chunk-5V36DLOA.js?v=0e87bacb:9614:12)

์ƒˆ๋กœ ๊ณ ์นจ ์‹œ console์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ warning์ด ๋‚˜์˜ด

[Vue warn]: Hydration node mismatch

code๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค

<template>
  <RegistrationVerifySN v-if="step === 'VERIFY_SN'" @nextStep="nextStep" />
  <RegistrationGuide v-else-if="step === 'GUIDE'" @nextStep="nextStep" />
</template>

๊ฐ–์€ ๊ฒ€์ƒ‰ํ•˜๋‹ค๊ฐ€ ์ง€๋‚˜์นœ comment๋ฅผ ์ ์šฉํ•˜์—ฌ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ณ ์น˜๋‹ˆ warning์€ ๊ทธ๋Œ€๋กœ์ง€๋งŒ error๋Š” ํ•ด๊ฒฐ ๋จ. vue2์ฒ˜๋Ÿผ ํ•˜๋‚˜์˜ wrapper๋กœ ํ•ด์•ผ๊ฒ ๋„ค

<template>
  <div>
    <RegistrationVerifySN v-if="step === 'VERIFY_SN'" @nextStep="nextStep" />
    <RegistrationGuide v-else-if="step === 'GUIDE'" @nextStep="nextStep" />
  </div>
</template>

Week 09, 2024 - Google maps API syntax error

์ตœ์‹  ๋ฒ„์ „ ์“ฐ๋Š”๋ฐ ์™œ ๋ฌธ๋ฒ• error๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‚˜ ๋ณด๋‹ˆ ์˜›๋‚ ์— ๋„ฃ์–ด๋’€๋˜ polyfill๊ณผ ์ถฉ๋Œ๋‚˜๋Š” ๋“ฏ.

์‹คํ–‰์—๋Š” ๋ฌธ์ œ์—†์ง€๋งŒ sentry์—์„œ ๊ณ„์† error ๋ณด๊ณ  ๋๋˜ google translator๋‚˜ tag manager error ์›์ธ๋„ ์ด๊ฑฐ?

debug ๊ณผ์ •

host-report-errors.js:5 Unhandled promise rejection TypeError: r is not iterable at Loader.eval (index.mjs:324:44)

error ๋ฉ”์‹œ์ง€๊ฐ€ ๋– ์„œ Week 25, 2023 - @babel/preset-env core-js Polyfill์™€ ๊ฐ™์ด babel build script ์ˆ˜์ •ํ•˜์—ฌ core-js polyfill ์ ์šฉํ•˜๋‹ˆ

Uncaught TypeError: this.Tm is not iterable

p @ https://cdn.polyfill.io/v3/polyfill.min.js:6
_callee$ @ webpack-internal:///./node_modules/.pnpm/@googlemaps+js-api-loader@1.16.6/node_modules/@googlemaps/js-api-loader/dist/index.mjs:547

์˜›๋‚ ์— ๋„ฃ์–ด๋’€๋˜ polyfill์ด initiator๋กœ ์žกํž˜. ์„ค๋งˆ ์‹ถ์–ด์„œ ์ œ๊ฑฐํ•ด๋ณด๋‹ˆ ๋ฌธ์ œ ํ•ด๊ฒฐ

Week 08, 2024 - Nuxt definePageMeta code runs unconditionally

page meta ์ง€์ •์ด ์•ˆ๋จนํžˆ๋Š” ๋ฒ„๊ทธ

  • ํ˜„์ƒ: ์ดˆ๊ธฐ mount ์‹œ์ ์—์„œ ์‹คํ–‰๋˜์ง€ ์•Š๋Š” switch ๋ฌธ์˜ case ์•ˆ์— ์žˆ๋Š” meta reset์šฉ definePageMeta code๋ฅผ comment out์‹œํ‚ค๋‹ˆ ์ œ๋Œ€๋กœ ๋Œ์•„๊ฐ. ํ˜น์‹œ ์‹คํ–‰๋˜๋‚˜ ๋ฐ”๋กœ ์œ„์— log์ฐ์–ด๋ณด๋‹ˆ ์‹คํ–‰ ์•ˆ๋จ. ๋ญ์ง€?
  • ์›์ธ: ๋ฌธ์„œ ์ฐพ์•„๋ณด๋‹ˆ compiler macro๋ผ๋Š”๋ฐ conditional branch์— ์žˆ๊ฑด ์—†๊ฑด ๋ฌด์กฐ๊ฑด ์‹คํ–‰๋˜๋‚˜๋ด„. ์ด๋ฆ„๋ถ€ํ„ฐ define์œผ๋กœ ์‹œ์ž‘๋˜๊ธด ํ•˜๋„ค.

    definePageMeta is a compiler macro

const nextStep = () => {
  switch (step.value) {
    case "VERIFY_SN":
      step.value = "FORM"
      break
    case "FORM":
      step.value = "COMPLETE"
      console.log("๐Ÿš€ ~ step.value:", step.value, "reset") // not run
      definePageMeta({}) // run
      break
  }
}

Week 01, 2024 - imprv delay of switching checkbox in PrimeVue DataTable

  • Motivation: checkbox ๊ฐ€์ง„ 100๊ฐœ row์˜ table์—์„œ ์ผ๊ด„ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์œ„ํ•ด checkbox๋ฅผ ์กฐ์ž‘ํ•˜๋ฉด ๋ฐ˜์‘์ด ๋Š๋ฆผ
  • Cause: DataTable์˜ header์˜์—ญ์—์„œ ๋‹จ์ˆœํžˆ count๋งŒ ์ฆ๊ฐ€์‹œ์ผœ๋„ ์ „์ฒด Table re-rendering ๋ฐœ์ƒ before performance
  • Solution: header ๋ถ„๋ฆฌ after performance

Week 01, 2024 - Nuxt3 nextTick, setTimeout 0

์ƒ์„ธ ํŽ˜์ด์ง€์—์„œ table list ํŽ˜์ด์ง€๋กœ ๋Œ์•„์˜ฌ ๋•Œ, ์ดˆ๋‹จ์œ„๋กœ ๋ฉˆ์ท„๋‹ค๊ฐ€ ํŽ˜์ด์ง€๊ฐ€ ์ด๋™ ๋จ.
fetch cache๊ฐ€ ์•ˆ๋˜์–ด fetch delay๊ฐ€ ์žˆ๊ธด ํ•œ๋ฐ, ๊ทธ๊ฒƒ๋ณด๋‹ค๋Š” table rendering์— ์—„์ฒญ ์‹œ๊ฐ„ ์žก์•„๋จน์Œ.
๋ฌธ์ œ๋Š” nextTick์„ ์จ๋„ rendering ๋งˆ์น˜๊ณ  ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง€๊ฐ€ ๋ณด์ž„.
setTimeout 0๋กœ ํ•˜๋‹ˆ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง€ ๋จผ์ € ๋ณด์ด๊ณ , skeleton ๋„์šฐ๊ณ  rendering ์‹œ์ž‘.
vue2์—์„  nextTick๊ณผ setTimeout 0๊ฐ€ ๋™์ผํ•˜๊ฒŒ ์ž‘๋™ํ–ˆ๋Š”๋ฐ Nuxt3์—์„  ์™œ ๋™์ž‘์ฐจ์ด๊ฐ€ ๋‚ ๊นŒ?

Week 51, 2023 - Tanstack query, Sentry replay error

์˜ค๋Š˜ ๋‹ค๋ฅธ ๋ฐฐํฌ 2๋ฒˆ ํ›„์— ๊ฐ‘์ž๊ธฐ sentry์—์„œ error notification์ด ๋งˆ๊ตฌ ๋“ค์–ด์˜ด.

  • TypeError: this[#y].values is not a function or its return value is not iterable
  • r.values is not a function or its return value is not iterable
  • Spread syntax requires ...iterable[Symbol.iterator] to be a function

์ƒ๊ธฐ 3๊ฐœ์˜ error message๊ฐ€ ๋ช‡ ์‹ญ ๊ฐœ์”ฉ.

์ฒซ ๋ฒˆ์งธ ๋ฐฐํฌ ํ›„ ํ…Œ์ŠคํŠธ์—๋Š” ์ •์ƒ ๋™์ž‘, ๋‘ ๋ฒˆ์งธ ๋ฐฐํฌ ํ›„ ํ…Œ์ŠคํŠธ์—๋„ ์ •์ƒ์ด์—ˆ์Œ. ์ฒซ ๋ฒˆ์งธ ๋‚ด์šฉ์€ ํ…์ŠคํŠธ์™€ ๋‹จ์ˆœ UI style ์ˆ˜์ •์ด์—ˆ๊ณ , ๋‘ ๋ฒˆ์งธ๊ฐ€ cache bust ๊ด€๋ จ bug fix์˜€๋Š”๋ฐ...

์„œ๋น„์Šค ํŽ˜์ด์ง€์—์„œ hard refresh ๋ช‡ ๋ฒˆ ํ•ด๋ณด๋‹ˆ ๊ทธ์ œ์•ผ ๋‚˜๋„ error๊ฐ€ ๋œจ๊ธฐ ์‹œ์ž‘.

๊ณผ์ • ๋ชจ๋‘ ์ ๊ธฐ์—” ๋„ˆ๋ฌด ์ง€์น˜๊ณ , ๊ฒฐ๊ตญ ์ฒซ ๋ฒˆ์งธ error message์˜ ์›์ธ์€ 40์ผ ์ „์— v4 -> v5๋กœ upgradeํ•œ tanstack query์™€ sentry replay์˜ polyfill๋ฌธ์ œ์˜€์Œ. ์ผ๋‹จ babel-loader์— package ๊ฒฝ๋กœ ํฌํ•จ์‹œ์ผœ ํ•ด๊ฒฐ. ๊ทธ ๋™์•ˆ ๋ฐฐํฌ๋ฅผ ๋ช‡ ๋ฒˆ ํ–ˆ๊ณ , ์„œ๋น„์Šค ํŽ˜์ด์ง€ ํ…Œ์ŠคํŠธ๋ฅผ ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋„ ๋‹คํ–ˆ๋Š”๋ฐ ์˜ค๋Š˜ ๊ฐ‘์ž๊ธฐ ์ด error๊ฐ€ ๋œฌ ์ด์œ ๋Š” ๋„๋Œ€์ฒด ๋ญ๋ƒ.

๋ช‡ ์‹œ๊ฐ„ ๋’ค์— ๊ฐ‘์ž๊ธฐ ๋‹ค๋ฅธ project์— sentry replay ์›์ธ์œผ๋กœ ๋™์ผ error notification ๋“ค์–ด์˜ด. ์ด์ชฝ๋„ ๋ฐฐํฌํ•œ์ง€ 40์ผ ๋„˜์—ˆ๋Š”๋ฐ...

Week 51, 2023 - Webpack, tailwindcss ์กฐํ•ฉ์—์„œ app.css cache bust๊ฐ€ ์•ˆ๋จ

tailwind์˜ utility class๋“ค์ด app.css๋กœ ์ถœ๋ ฅ๋˜๋Š”๋ฐ, ์ด ํŒŒ์ผ๋งŒ file name์— hash๊ฐ€ ๋ถ™์ง€ ์•Š์•„ cache bust๊ฐ€ ์•ˆ๋จ.

new MiniCssExtractPlugin({
+  filename: '[name].[contenthash].css',
  chunkFilename: '[id].[contenthash].css',
  ignoreOrder: true,
}),

๋‹ค์Œ์€ app ์ดˆ๊ธฐ loading์— ์“ฐ์ด๋Š” manifest ์„ค์ •

new WebpackAssetsManifest({ // https://webpack.js.org/plugins/mini-css-extract-plugin/#filename
  output: 'manifest.json',
  customize(entry) {
+    if (['app.js', 'app.css'].includes(entry.key)) return entry
    return false
  },
}),

Week 50, 2023 - Ver.17 Safari์—์„œ Avif๊ฐ€ ์•ˆ๋ณด์ž„

avif, webp, tiny-jpg๋กœ ์ด๋ฏธ์ง€ ์šฉ๋Ÿ‰ ์ค„์—ฌ์„œ picture ํƒœ๊ทธ๋กœ ์“ฐ๊ณ  ์žˆ๋Š”๋ฐ, Safari ver.17์—์„œ ์ด๋ฏธ์ง€๊ฐ€ ์•ˆ ๋ณด์ž„. (Version 16.6 (17615.3.12.11.3, 17615) - Monterey Ver.12.6.8์—์„œ ์ •์ƒ๋™์ž‘)

developers cannot rely on the browser to do format selection by using <picture> + <source>.

safari Version 16.6 (17615.3.12.11.3, 17615) ์—์„  ์ •์ƒ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.
์ œ ์‚ฌํŒŒ๋ฆฌ ๋ฒ„์ „ 17.0(19616.1.27.211.1) ์—์„œ๋Š” ์•ˆ๋ณด์—ฌ์š”
์ œ๊ฐ€ ์“ฐ๋Š” ์ธ์ฝ”๋”ฉ ํˆด๋กœ ์ƒ์„ฑํ•œ avif ํŒŒ์ผ์ด ๋ฌธ์ œ ์žˆ๋Š”๊ฑด์ง€ vanessa safari์—์„œ ์ด๋ฏธ์ง€ ๋‚ด์šฉ์ด ์•ˆ๋‚˜์˜ค๋„ค์š”.

  • ๋‹ค์šด๋กœ๋“œ ์šฉ๋Ÿ‰ ํ™•์ธ ํ•จ.
  • safari inspector์—์„œ ๋ฏธ๋ฆฌ๋ณด๊ธฐ์—์„œ๋„ ํˆฌ๋ช…ํ•œ ์‚ฌ๊ฐํ˜•๋งŒ ๋ณด์ž„.
  • ๋‹ค๋ฅธ ์‚ฌ์ดํŠธ์˜ avif ํŒŒ์ผ์€ ๋ณด์ด๋Š” ๊ฑธ ํ™•์ธ (๊ฐœ์ธ์ •๋ณด๋ณดํ˜ธ ํƒญ์—์„œ, https://libre-software.net/image/avif-test/)

๋‹ค๋ฅธ feature ๋ฐฐํฌ ์‹œ์—๋„ ๋™์ผ ์ฆ์ƒ

  • 17.1.2์—์„œ ์•ˆ๋ณด์ž„
  • iPhone XR 17.2์—์„œ ์•ˆ๋ณด์ž„
    • https://tests.caniuse.com/avif - animated avif ๋™์ž‘ ์•ˆํ•จ (๋™์ž‘ํ•˜๋Š” Ver.16.6์—์„  animated ๋™์ž‘ํ•จ)

developers cannot rely on the browser to do format selection by using <picture> + <source>.

๋‹จ์ˆœ img ํƒœ๊ทธ๋งŒ ์ผ์„ ๋• avif ์ž˜ ๋ณด์ž„ โ†’ browser๊ฐ€ safari์ธ์ง€ checkํ•˜์—ฌ picture+srcset์˜ avif๋Š” off ์‹œํ‚ด

Week 50, 2023 - Fix Github -> EC2 Deploy

๊ธฐ์กด์— ๊ตฌ์ถ•ํ•ด๋‘” biz admin project์˜ CI์—์„œ error ๋ฐœ์ƒ.

ํ…Œ์„ญ์—์„  git pull์‹œ์— file conflict๊ฐ€ ๋ฐœ์ƒ, ์šด์˜์„œ๋ฒ„์—์„  github๋กœ์˜ ssh fingerprint, ์ธ์ฆ ์ •๋ณด๊ฐ€ invalid.

Bug - ๐Ÿ”— NuxtLink defaults์˜ trailingSlash๋ฅผ ๋„ฃ๋„๋ก ์„ค์ •ํ•˜๋‹ˆ pdf download link์— /๊ฐ€ ๋ถ™์–ด dashboard๋กœ redirection ๋จ.

  • trailingSlash๊ฐ€ ํ•„์š”ํ•œ ์ด์œ ๋Š” lightsail๋กœ ์„ฑ๋Šฅ ์ธก์ •ํ–ˆ์„ ๋•Œ ๋ / ๊ฐ€ ์—†๋Š” url์— ์ ‘๊ทผํ•˜๋ฉด ๋ / ๊ฐ€ ์žˆ๋Š” url๋กœ redirection์ด ์ผ์–ด๋‚œ๋‹ค๊ณ  ์ ์ˆ˜ ๊นŒ์—ฌ์„œ...

Fix - resource link๋Š” a tag๋กœ ์ฒ˜๋ฆฌ

Week 36, 2023 - Google Forms ์‘๋‹ต ๊ฒฐ๊ณผ API๋กœ ์ž…๋ ฅ

์‘๋‹ต ์ œ์ถœ ์‹œ trigger๋ฅผ ์„ค์ •ํ•˜์—ฌ Google Apps script function์„ ํ˜ธ์ถœ

Submit Event trigger

Pass URL parameters into survey

  1. Open a form in Google Forms
  2. In the top right, click More [...]
  3. Choose Get pre-filled link
  4. Fill in any answer fields you want to pre-populate
  5. Click Submit
  6. To send the pre-populated form to respondents, copy and send the link at the top

Post API

Week 34, 2023 - Arc42 template์— ๋”ฐ๋ผ ๋ฌธ์„œํ™”

Arc42๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ Report PDF generator ํ”„๋กœ์ ํŠธ ๋ฌธ์„œ๋ฅผ ์ž‘์„ฑ

๊ฐœ๋…์ด ์„ค๋ช…๋˜์–ด ์žˆ๋Š”๋ฐ ์ž˜ ์ดํ•ด๊ฐ€ ์•ˆ๊ฐ€์„œ ์˜ˆ์ œ๋ฅผ ์ฐพ์•„๋ณด๋‹ˆ ์˜ˆ์ œ๋งˆ๋‹ค ๋‹ค๋ฅธ ๋ถ€๋ถ„๋„ ๋งŽ๊ณ , ๋ฌธ์„œ๋ฅผ ์œ„ํ•œ ๋ฌธ์„œํ™”์ฒ˜๋Ÿผ ๋Š˜์—ฌ์“ฐ๊ธฐ ์„ค๋ช…์ด ๋Š๊ปด์ ธ์„œ template์˜ ์ผ๋ถ€๋ถ„๋งŒ ์ฐจ์šฉํ•ด์„œ ์”€.

์–‘์‹์ด ์ œ๊ณต๋˜๋‹ค๋ณด๋‹ˆ Quality Goals ๊ฐ™์€ ์ƒ๊ฐ์ง€ ๋ชปํ•œ ๊ด€์ ์˜ ๊ธฐ์ˆ ์„ ํ•˜๊ฒŒ ๋˜์–ด ์ข‹์Œ.

์ž‘์„ฑ ๋‚ด์šฉ์€ Pdf Generator ์ฐธ๊ณ 

Week 32, 2023 - Report PDF generator

CSS to set A4 paper size

Deploy to AWS Lambda

Github action

# nuxt build
- name: Make server zip file
   run: cd .output/server;zip -qq -r ./server.zip ./*;mv ./server.zip ../../server.zip;cd ../..
   shell: bash
- name: Deploy to Lambda
   run: aws lambda update-function-code --function-name $functionName --zip-file fileb://./server.zip

Public image base URL

/public์— ์žˆ๋Š” image ๋“ค์€ ๊ทธ๋Œ€๋กœ ์“ฐ๋ฉด lambda base URL์„ ๊ธฐ์ค€์œผ๋กœ ์žก๊ธฐ ๋•Œ๋ฌธ์— ์ œ๋Œ€๋กœ ์“ธ ์ˆ˜ ์—†๋‹ค. cloudfront์˜ base URL์„ ๊ธฐ์ค€์œผ๋กœ ์žก์•„์•ผ ํ•จ

๋กœ ํ•ด๊ฒฐ

const cdnURL = "https://example.cloudfront.net"
export default defineNuxtConfig({
  app: {
    cdnURL,
    head: {
      base: { href: process.env.CI ? cdnURL : "/" },
    },
  },
})

๋กœ๋„ ๊ฐ€๋Šฅํ•˜๊ธด ํ•  ๋“ฏ

Pdf Generator

Rendering

Forcing Page Breaks

.page-break {
  page-break-before: always;
}

Color

* {
  print-color-adjust: exact;
}

Week 30, 2023 - Webpack & Tailwind CSS Setup

Nuxt project์— ์‚ฌ์šฉํ•˜๋Š” tailwind๊ฐ€ ๋„ˆ๋ฌด ํŽธํ•ด์„œ webpack project์—๋„ ์ ์šฉ

Webpack & Tailwind CSS Setup
Webpack CSS Extraction

Week 29, 2023 - Nuxt v3.6.0 generate dynamic route path

Nuxt v3.6.0๋ถ€ํ„ฐ Generate ์‹œ์— ์™ธ๋ถ€์—์„œ dynamic route path๋กœ ์ ‘์†ํ•˜๋ฉด ์ธ์‹์„ ๋ชปํ•˜๊ณ  ์ƒ์œ„ path๋กœ ์ด๋™์‹œํ‚จ๋‹ค.

  • ex. /n/[code]

์ด์ „์— /n?[code]๊ฐ€ ์•ˆ๋˜์„œ ์ €๊ฑธ๋กœ ํƒ€ํ˜‘๋ดค์—ˆ๋Š”๋ฐ ๋ณ„๋ณ„ ํ…Œ์ŠคํŠธ๋ฅผ ํ•˜๋‹ค๊ฐ€ /n#[code]๋กœ ํƒ€ํ˜‘

Week 28, 2023 - ๊ตญ์ƒ์› KDTC ํ•ญ๋ชฉ ๋“ฑ๋ก

๋“ฑ๋ก ์‚ฌ์ดํŠธ๊ฐ€ ๋ถˆ์•ˆ์ •ํ•˜๊ณ , ๋ฒ„๊ทธ ๋•Œ๋ฌธ์— ๊ณ ์ƒํ•จ

  • ๋•Œ๋•Œ๋กœ ์„œ๋น„์Šค ์ฃฝ์Œ
  • ์ด์ „ ๋ฐ์ดํ„ฐ ๊ฒฐ์† ๋•Œ๋ฌธ์— ์ƒˆ ํ•ญ๋ชฉ ๋“ฑ๋ก์ด ์•ˆ๋จ
  • ํ•ญ๋ชฉ ๊ฐœ์ˆ˜๊ฐ€ ๋Š˜์–ด๋‚จ์— ๋”ฐ๋ผ ์‚ฌ์ดํŠธ ๋ฆฌ์†Œ์Šค ํ• ๋‹น์ด ๋†’์•„์ ธ์„œ ์‚ฌ์ดํŠธ๊ฐ€ ์ฃฝ์Œ
  • ์‚ญ์ œ์š”์ฒญํ•œ ๋ถ„๋ฅ˜ ๋•Œ๋ฌธ์— ์ƒˆ ๋ถ„๋ฅ˜์˜ index numbering์ด ์•ˆ๋˜์„œ ๋‘ ๋ฒˆ์งธ ๋ถ„๋ฅ˜ ๋“ฑ๋ก์ด ์•ˆ๋จ

์ง€๋‚œ ๋ฒˆ์— ๋“ฑ๋ก์‹œํ‚ค๋ ค๋Š” ํ•ญ๋ชฉ์„ ์ ˆ๋ฐ˜๋„ ๋ชป์‹œ์ผœ ๋“ฑ๋ก๋งˆ๊ฐ working day 3์ผ ์ „๋ถ€ํ„ฐ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›๊ณ  ์‹œ์ž‘ํ–ˆ๋Š”๋ฐ ์‚ฌ์ดํŠธ ๋ฒ„๊ทธ ๋•Œ๋ฌธ์— ์ผ์š”์ผ ์ถœ๊ทผ๊นŒ์ง€...

Week 28, 2023 - nuxt config for primevue v3.30.0

nuxt, primevue, tailwind๊ฐ€ ๊ณต์กดํ•˜๋Š” ํ™˜๊ฒฝ์—์„œ primevue์˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ์œผ๋กœ ์ธํ•ด tailwind ์„ค์ •์ด ๋จนํžˆ๋Š” ์ƒํ™ฉ

Bug1

๊ธฐ์กด primevue.min.css๊ฐ€ v3.30.0๋ถ€ํ„ฐ deprecated

nuxt config css์— ๋“ฑ๋กํ•œ css๋“ค์„ import ํ›„์— primevue๊ฐ€ css ๋‚ด์šฉ์„ importํ•˜๊ธฐ ๋•Œ๋ฌธ์— custom components๋‚˜ utilities ๋‚ด์šฉ์„ ๋ฎ์–ด ์“ด๋‹ค.

Fix1

๋ฎ์–ด์จ์ง€๋Š” css๋“ค์€ ๋”ฐ๋กœ ์œ„์น˜์‹œ์ผœ์•ผ ํ•จ. layouts/default.vue์— ์ด๋™
layouts/default.vue ๊ทธ๋ƒฅ importํ•˜๋ฉด local dev์‹œ์—๋Š” ์˜๋„ํ•œ ์ˆœ์„œ๋กœ importํ•˜๋Š”๋ฐ build ๊ฒฐ๊ณผ๋ฌผ์€ ๋˜ primevue ์ƒ์„ฑ style์ด ๊ฐ€์žฅ ๋‚˜์ค‘์— import ๋จ.
layouts/default.vue์— dynamic import๋กœ ์ฒ˜๋ฆฌ

! plugins/primevue.js์— dynamic import ํ•ด๋ดค๋Š”๋ฐ local์—์„  ๋˜์ง€๋งŒ build ํ™˜๊ฒฝ์—์„  ์•ˆ๋จ

// layouts/default.vue
if (process.client) {
  import("~/vue-components/styles/components.scss")
  import("~/vue-components/styles/utilities.scss")
}

Bug2 from Fix1

dynamic์œผ๋กœ importํ•˜๋‹ค๋ณด๋‹ˆ mount ์ดํ›„์— import ๋˜์–ด FOUC(flash of unstyled content)๊ฐ€ ๋ฐœ์ƒ

Fix2

primevue๊ฐ€ ์ƒ์„ฑํ•˜๋Š” style๋“ค์„ ์•ž์œผ๋กœ ๋ณด๋‚ด ์šฐ์„ ์ˆœ์œ„ ๋‚ฎ์ถ”๋Š” ๋ฐฉ์‹์œผ๋กœ ํ•ด๊ฒฐ

// plugins/primevue
export default defineNuxtPlugin({
  hooks: {
    "app:mounted"() {
      const target = document.querySelector('link[rel="icon"]')
      document.querySelectorAll("[data-primevue-style-id]").forEach((el) => {
        target.after(el)
      }) // ์—ฌ๊ธฐ์„œ app:mounted๋กœ ์˜ฎ๊ธฐ๋ฉด common, base, toast service๊นŒ์ง€ ์˜ฎ๊ธฐ๊ณ  layouts/default์—์„œ ์˜ฎ๊ธฐ๋ฉด sidebar, menu ๋“ฑ์˜ component ๊ธฐ๋ณธ style๊นŒ์ง€ ์˜ฎ๊น€
    },
  },
})

tailwind ์“ฐ๋ ค๋ฉด ๊ธฐ์กด primevue์—์„œ ์ œ๊ณตํ•˜๋Š” ๊ฑธ ๋ชจ๋‘ ๋‚ ๋ฆฌ๋Š”๊ฒŒ ๊ณต์‹ ๋ฐฉ๋ฒ• ๊ฐ™์Œ ์ด๋Ÿฐ ๊ฑฐ ๋ณด๋ฉด tailwind utility์™€ ์ถฉ๋Œ๋‚˜๋Š”๊ฑฐ ์ ์  ์—†์–ด์งˆ๊ฑฐ ๊ฐ™๊ธดํ•˜๋‹ค๋งŒโ€ฆ

Week 25, 2023 - @babel/preset-env core-js Polyfill

๊ณ ๊ฐ์ด ๋ฆฌํฌํŠธ ํ™•์ธ์ด ์•ˆ๋œ๋‹ค๊ณ  ํ•จ. logrocket๊ณผ sentry์—์„œ ํ™•์ธํ•œ error message๋Š” Unexpected token '='. Expected an opening '(' before a method's parameter list. ๊ด€๋ จ ๊ฒ€์ƒ‰ ํ•ด๋ณด๋‹ˆ polyfill ๋ฌธ์ œ ๊ฐ™์Œinstance-fields. ๊ณ ๊ฐ์˜ browser๋ฅผ ํ™•์ธํ•ด๋ณด๋‹ˆ iOS 14์ด๊ณ safari-14_1-release-notes log์™€ ๊ด€๋ จ issuechart.js-issue-11151๋ฅผ ํ™•์ธํ•˜๊ณ  ๋‚˜์ค‘์— chrome์—์„œ ์ •์ƒ ํ™•์ธํ•œ ๊ฑธ ๋ณด๋‹ˆ ์ด๊ฒŒ ๋งž๋Š” ๊ฑธ๋กœ ๋ณด์—ฌ ์›์ธ๊ณผ polyfill ์ž‘์—… ์ด์ „์˜ ๊ฐ€์ด๋“œ๋ฅผ ์•ˆ๋‚ด ํ›„ ์ž‘์—… ์‹œ์ž‘

๋ฒ„๊ทธ๊ฐ€ ์ˆ˜์ •๋˜๊ธฐ ์ „์—๋Š” safari์˜ ๊ฒฝ์šฐ version 14.1 ์ด์ƒ์œผ๋กœ upgrade๋ฅผ ํ•˜๊ฑฐ๋‚˜ chrome 72, firefox 69, edge 79 ์ด์ƒ์˜ browser์—์„œ ํ™•์ธํ•˜์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค.

Babel config

  • useBuiltIns: 'usage', 'entry'

entry ์“ฐ๋Š” target browser์— ํ•„์š”ํ•œ polyfill์„ entry point์— ์ „๋ถ€ ๋•Œ๋ ค๋ฐ•์•„์„œ ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋  ์ค„ ์•Œ์•˜์œผ๋‹ˆ ์•ˆ ๋จ. ์•Œ๊ณ ๋ณด๋‹ˆ ์ถ”๊ฐ€๋˜๋Š” polyfill์€ function ๊ฐ™์€๊ฑฐ๊ณ  error๋Š” package code ๋‚ด์— syntax ๋ฌธ์ œ๋ผ code transform์ด ํ•„์š”ํ•ด์„œ ๋‹ค์Œ babel-loader config๋กœ ํ•ด๊ฒฐ

Webpack babel-loader config

  • include: [/.+chart\.js.+/]: error ๋ฐœ์ƒํ•˜๋Š” package์˜ path๋ฅผ regex๋กœ include (pnpm์„ ์“ฐ๊ธฐ ๋•Œ๋ฌธ์— ๋ฒ„์ „๋งˆ๋‹ค path๊ฐ€ ๋‹ฌ๋ผ์ง)
  • sourceType: "unambiguous"

Polyfill target browser

# .browserslistrc
> 0.25%
not dead
last 4 years
ie 11

Refactoring

์˜ˆ์ „์— ์“ฐ๋˜ ํ•˜๊ธฐ์˜ plugin๋“ค core-js@3์—์„œ ๊ธฐ๋ณธ ์ง€์›์— ํฌํ•จ๋˜์–ด์„œ ์‚ญ์ œ

  • transform-vue-jsx
  • @babel/plugin-transform-runtime
  • @babel/plugin-syntax-dynamic-import
  • @babel/plugin-transform-destructuring

์†์œผ๋กœ ์ถ”๊ฐ€์‹œ์ผฐ๋˜ polyfill function๋“ค๋„ ์‚ญ์ œ

Week 24, 2023 - Media Query overwritten with non Media Query

Bug

tailwind - xl:px-8 overwritten with px-6

tailwind ๊ธฐ๋ฐ˜์˜ component package์—์„œ ์“ฐ๋Š” media query style(style.css)์ด project์—์„œ ์“ฐ๋Š” utility class(restyle.scss)์— ๋ฎ์–ด์จ์ง. stack overflow reply

media query๊ฐ€ style์—๋งŒ ์žˆ์„ ์ˆ˜๋„ ์žˆ๊ณ  restyle์—๋งŒ ์žˆ์„ ์ˆ˜ ์žˆ์–ด์„œ ์–ด๋Š ์ˆœ์„œ๋กœ ํ•ด๋„ ๋ฌธ์ œ

Fix

๊ฒฐ๊ตญ package ํ’€๊ณ  sub module๋กœ

Week 24, 2023 - iOS Safari scroll momentum

Tony์—๊ฒŒ ๋ฌธ์˜ ๋ฐ›์€ bug

Feature

dialog ์œ ์ง€ํ•œ์ฑ„ ์•ˆ์—์„œ ๋™์˜์„œ๋ฅผ ๋ณด์—ฌ์ฃผ๊ณ  ํ•œ ํ•ญ๋ชฉ์„ ๋™์˜ ๋ฐ›์œผ๋ฉด Scroll Top์„ 0์œผ๋กœ ์ด๋™์‹œํ‚จ ํ›„ ๋‹ค์Œ ๋™์˜์„œ๋ฅผ ๋ณด์—ฌ์ค˜์•ผ ํ•จ.

Bug

๋•Œ๋•Œ๋กœ iOS safari์—์„œ ๋‹ค์Œ ๋™์˜์„œ๊ฐ€ ๋ณด์ด์ง€ ์•Š์Œ. ์Šคํฌ๋กคํ•˜๋ฉด rendering ๋จ.

Cause

iOS safari์˜ scroll momentum์ด ๊ฑธ๋ฆฐ ์ƒํƒœ๋กœ ๋‹ค์Œ ๋™์˜์„œ๋กœ ์ „ํ™˜๋˜๋ฉด scrollTop์ด ์ด์ƒํ•œ ๊ณณ์„ ๊ฐ€๋ฅดํ‚ด.

Fix

scroll-behavior์„ ๊ฑด๋“œ๋ ธ์ง€๋งŒ ํ•ด๊ฒฐ ์•ˆ๋จ. ์›น์—์„œ scroll momentum ๊ธฐ๋Šฅ ๋„๋Š” ๋ฐฉ๋ฒ•์„ ์ฐพ์•„๋ดค์ง€๋งŒ ๋”ฑํžˆ ์œ ํšจํ•œ ๋ฐฉ๋ฒ•์€ ๋ชป ์ฐพ๊ณ , ๊ฒฐ๊ตญ overflow hidden โ†’ auto๋กœ ํ•ด๊ฒฐ

Week 23, 2023 - Package โ†’ Submodule

Motivation

vue component + nuxt base module package๋ฅผ peer dependency๋กœ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉฐ ์ด project ์ž์ฒด๋„ package๋ผ์„œ ์ˆ˜์ •์‚ฌํ•ญ์ด ์žˆ์„ ๋•Œ ๋งˆ๋‹ค

  1. playground์—์„œ ํ…Œ์ŠคํŠธ
  2. package publish
  3. project์—์„œ install
  4. project์—์„œ ํ…Œ์ŠคํŠธ
  5. project build

๊ณผ์ •์ด ๋„ˆ๋ฌด ๋ฒˆ๊ฑฐ๋กญ๋‹ค. sub module๋กœ ์ „ํ™˜ํ•˜์—ฌ 1~3 ๊ณผ์ •์„ ์—†์• ๊ณ ์ž ์ž‘์—…

vue component๋Š” package๋กœ ๋‘ฌ๋„ ๋ ๊ฑฐ ๊ฐ™๊ณ , nuxt base module์€ ์ถ”ํ›„ sub module๋กœ ๋ฐ”๊พธ์ž

Setup

Week 22, 2023 - Slack notification from Github actions

fromvoxmedia__github-action-slack-notify-build
toslackapi__slack-github-action

github ๋ฌธ์„œ๋ฅผ ๊ณ„์† ์ฐพ์•„๋ด๋„ action์ด ์‹คํ–‰๋˜๋Š” ๋™์•ˆ ์ œ๊ณต๋˜๋Š” context์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ๋ถˆ๋ช…ํ™•ํ•ด์„œ ์ง์ ‘ ์ถœ๋ ฅํ•˜๋Š” script๋ฅผ ์ฐพ์•„์„œ ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•ด๋ด„

Print github action context

Slack์—์„œ ์ง์ ‘ ๋งŒ๋“  app์œผ๋กœ ๊ต์ฒด

multiline commit message ์ถœ๋ ฅ๋˜๋„๋ก

Github action - Slack notification about build

Release info

Github action - Release Info

Week 19, 2023 - nuxt module error: lodash import

nuxt module์˜ component์—์„œ

import _ from "lodash"

code๊ฐ€ module์„ ์“ฐ๋Š” project์˜ local dev ํ™˜๊ฒฝ์—์„œ

The requested module '/_nuxt/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js?v=4a75b04f' does not provide an export named 'default'

error๋ฅผ ๋ฑ‰์œผ๋ฉด์„œ ๋ฉˆ์ถค
build ์‹œ์—๋„ error ๋ฉ”์‹œ์ง€ ๋ฐœ์ƒํ•˜์ง€๋งŒ ๋งˆ๋ฌด๋ฆฌ๋Š” ๋จ.

import { ceil } from "lodash"

๋„ ๊ฐ™์€ ๋ฉ”์‹œ์ง€ ๋‚˜์˜ค๊ธธ๋ž˜ ์ด๊ฒƒ์ €๊ฒƒ ์‹œ๋„ํ•˜๋‹ค๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” project์—์„œ ๋˜‘๊ฐ™์€ ๋ฌธ๊ตฌ ์จ์„œ ์ถœ๋ ฅ๋˜๋Š” ๊ฑธ ํ•œ ๋ฒˆ ๋ณด๋‹ˆ ์ •์ƒ๋™์ž‘. ์ถ”๊ฐ€ํ•œ code์ง€์šฐ๊ณ  ์‹œํ—˜ํ•˜๋‹ˆ๊นŒ ๋‹ค์Œ๋ถ€ํ„ด ์ž˜ ๋จ. ??? ๋ญ์ง€?

๋ฐ”๋กœ destructure code๋กœ ์‚ฌ์šฉํ•˜๋Š” project๋ฅผ buildํ•˜๋‹ˆ

๐Ÿš€ ~ file: error.vue:10 ~ error undefined Named export 'max' not found. The requested module 'file:///home/runner/work/patients.genoplan.co.kr-2023/patients.genoplan.co.kr-2023/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'file:///home/runner/work/patients.genoplan.co.kr-2023/patients.genoplan.co.kr-2023/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js';
const { round, max } = pkg;

error ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜์™€์„œ ์ด์ „์œผ๋กœ ๋Œ๋ฆฌ๊ณ ...

๊ฒฐ๊ตญ์—”

import * as _ from "lodash" // https://askjavascript.com/how-to-solve-does-not-provide-an-export-named-default/

๋กœ ํ•ด๊ฒฐ...

๋˜์ง€ ์•Š์Œ. build๋Š” ์ •์ƒ์ธ๋ฐ local dev์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ error๊ฐ€ ๋œธ

[Vue warn]: Error in render function: "TypeError: _.max is not a function"

vite build ๊ด€๋ จ๋œ error์˜€๋‹ค.

import๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ•˜๊ณ ,

import _round from "lodash/round"

๋‹ค์Œ ์„ค์ • ์ถ”๊ฐ€ํ•˜์—ฌ ํ•ด๊ฒฐ

// nuxt.config.js
export default defineNuxtConfig({
  vite: {
    optimizeDeps: {
      include: ["lodash/ceil", "lodash/round", "lodash/max"], // https://github.com/genoplan/report-module-2023/issues/1#issuecomment-1550532676
    },
  },
})

Week 19, 2023 - nuxt module: include tailwind utility classes

tailwind์˜ ์ฒ˜๋ฆฌ๊ฐ€ nuxt ์‹คํ–‰๋˜๋Š” playground ์ชฝ์—๋งŒ ๋˜์–ด์„œ prepack(module export์ฒ˜๋ฆฌ) ์ด์ „์˜ build ์‹œ์—๋Š” utility classes๊ฐ€ ๊ฒฐ๊ณผ๋กœ ๋‚˜์˜ค๋Š”๋ฐ, prepack ํ•  ๋•Œ๋Š” ํฌํ•จ ์•ˆ๋จ.
unjs/unbuild source code๋„ ๋’ค์ ธ๋ณด๊ณ  ํ–ˆ์ง€๋งŒ ๊ฒฐ๊ตญ ๋ฏธ๋ด‰์ฑ…์œผ๋กœ module ๊ฐ€์ ธ๋‹ค ์“ฐ๋Š” project์˜ tailwind.config์—์„œ ์ฒ˜๋ฆฌํ•˜๋„๋ก ํ•จ.

// tailwind.config.js
module.exports = {
  content: ["./node_modules/module/dist/runtime/components/**/*.{js,vue,ts}"],
}

Week 19, 2023 - Nuxt error: Hydration completed but contains mismatches.

Hydration completed but contains mismatches. chunk-TBEUP4O5.js:5346

tbody๋ฅผ ๋„ฃ์–ด์ฃผ๋‹ˆ ํ•ด๊ฒฐ

Week 19, 2023 - ๊ตญ์ƒ์› DTC ํ•ญ๋ชฉ ๋ณ€๊ฒฝ ์‹ ๊ณ  Retrospective

์˜ˆ์ƒ์น˜ ๋ชปํ•œ 1950๊ฐœ์˜ ํ•ญ๋ชฉ, ์ฒจ๋ถ€ํŒŒ์ผ 12GB over.

google drive์—์„œ local disk๋กœ ๋‹ค์šด ๋ฐ›๋Š”๊ฒŒ bottleneck์ด์—ˆ๋‹ค.

download ์‹œ๋„ํ•˜๋ฉด ๋จผ์ € google drive์—์„œ ๊ธด ์••์ถ•์‹œ๊ฐ„์„ ๋ณด๋‚ด๊ณ  ๋‹ค์šด๋ฐ›๋Š”๋ฐ, ์‹œ๊ฐ„์ด ๊ธธ์–ด์„œ network error๋กœ ์ทจ์†Œ๋˜๊ณ ... 2GB๋กœ ์ž˜๋ฆฐ ํŒŒ์ผ๋„ ์••์ถ• ํ’€๊ธฐ ์œ„ํ•ด local disk ์šฉ๋Ÿ‰ ํ™•๋ณดํ–ˆ์–ด์•ผ ํ–ˆ๊ณ ...

๊ฒฐ๊ตญ์€ ์™ธ์žฅํ•˜๋“œ๋กœ ์ง์ ‘ ์—…๋กœ๋“œ. mac ์ด๋ผ windows machine์—์„œ ํŒŒ์ผ ๊ธฐ๋ก์„ ํ–ˆ์Œ.

์ฒ˜์Œ๋ถ€ํ„ฐ ์™ธ์žฅํ•˜๋“œ ์ด์šฉํ–ˆ์œผ๋ฉด ์‹œ๊ฐ„ ์—„์ฒญ ์ ˆ์•ฝ ๊ฐ€๋Šฅํ–ˆ์Œ. ์• ๋‹น์ดˆ ํ•ญ๋ชฉ ์ˆ˜์™€ ์ฒจ๋ถ€ํŒŒ์ผ ์šฉ๋Ÿ‰ ํ™•์ธ๋ถ€ํ„ฐ ํ–ˆ์—ˆ์–ด์•ผ...

Week 19, 2023 - github actions yarn cache

์˜ˆ์ „์— ํ–ˆ๋˜ pnpm์˜ node cache ์“ฐ๋Š” ๋ฐฉ์‹์œผ๋กœ๋Š” cache ์ƒ์„ฑ์€ ๋˜๋Š”๋ฐ yarn์—์„œ ๊ทธ๊ฑธ ์“ฐ์ง€ ๋ชปํ•จ

- name: Use Node.js ${{ matrix.node-version }}
   uses: actions/setup-node@v3
   with:
      node-version: ${{ matrix.node-version  }}
      cache: "yarn"

๊ฒ€์ƒ‰ ๋ฐ˜๋ณตํ•ด๊ฐ€๋ฉฐ try & error๋กœ ๊ฒฐ๊ตญ ์ฐพ๊ธด ํ–ˆ์ง€๋งŒ ์ด๊ฑด ๋ญ... 19-yarn

# https://dev.to/mattpocockuk/how-to-cache-nodemodules-in-github-actions-with-yarn-24eh
- uses: actions/cache@v3
   with:
      path: '**/node_modules'
      key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
   run: yarn install

Week 18, 2023 - github private package - nuxt module

vue3 ๊ธฐ๋ฐ˜ package๋Š” ์ง€๋‚œ ์ฃผ์— ์„ฑ๊ณตํ–ˆ๋Š”๋ฐ ๋ณธ ๋ชฉ์ ์ธ report ๊ด€๋ จ module์„ ๋งŒ๋“œ๋ ค๋‹ˆ nuxt ๊ธฐ๋ฐ˜์œผ๋กœ๋Š” ๊ฐ™์€ ๋ฐฉ๋ฒ•์œผ๋กœ๋Š” ์•ˆ ๋จ. (cache bust๋ฅผ ์œ„ํ•œ file name์— hash ๋ถ™๋Š” ๊ฒƒ๋ถ€ํ„ฐ...)

report ๊ด€๋ จ code๋“ค์„ vue3๋กœ ๋ณ€ํ™˜ํ•˜๋Š๋ƒ, ์ข€ ๋” ๊ณต๋ถ€ํ•ด์„œ nuxt module๋กœ ๋งŒ๋“œ๋Š๋ƒ... ๊ณ ๋ฏผํ–ˆ์ง€๋งŒ ๋‚˜์ค‘์— ํšŒ์›๊ฐ€์ž…๋„ ๋™์ผํ•˜๊ฒŒ ๋งŒ๋“ค์–ด์•ผ ํ•˜๋ฏ€๋กœ nuxt module๋กœ ๊ฒฐ์ •

์ฐพ์•„๋ณด๋‹ˆ nuxt์— module ๋งŒ๋“œ๋Š” ๋ฐฉ์‹์ด ๋”ฐ๋กœ ์žˆ์–ด์„œ ์ง„ํ–‰.

Explicit Imports

Published modules cannot leverage auto-imports for assets within their runtime directory. Instead, they have to import them explicitly from #imports or alike.

Week 17, 2023 - github private package

Q1๋ถ€ํ„ฐ ์ƒˆ๋กœ ์ƒ์„ฑ๋˜๋Š” ํ”„๋กœ์ ํŠธ๋“ค์ด ๊ธฐ์กด report ์žฌ์‚ฌ์šฉ์ด ๋งŽ์•„์„œ ์ƒˆ๋กœ์šด report ์‚ฌ์ดํŠธ๋ฅผ ๋งŒ๋“ค์–ด ์—ฐ๋™์‹œํ‚จ๋‹ค๋“ ์ง€ ํ•˜๋Š” ๊ฒƒ ๋ณด๋‹ค๋Š” ๊ทธ๋ƒฅ private package ๋งŒ๋“œ๋Š”๊ฒŒ ์ข‹์•„๋ณด์—ฌ์„œprivate-package ์‹œ๋„. ๊ฒฐ๊ตญ ์•ˆ์“ธ ์ง€๋„ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ...

๊ธฐ๋Œ€ํšจ๊ณผ๋Š”

  • commit log ์‘์ง‘ํ™”
  • build time ์ค„์ž„ - package cache ์‚ฌ์šฉ
  • project๋ณ„ ํŒŒํŽธํ™” ์ค„์ž„

Release test package

Quickstart for GitHub Packages

Use test package on local

Authenticating with a personal access token

.npmrc์— token ์ €์žฅํ•˜์ง€ ์•Š๊ธฐ

<org-name>:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGE_READ_TOKEN}
shell rc์— token export.
  ex) z shell์˜ ๊ฒฝ์šฐ ~/.zshrc์— ๋‹ค์Œ์„ ์ถ”๊ฐ€
  ```shell
  export GITHUB_PACKAGE_READ_TOKEN=~~

Make package of vue 3 component

Building a Vue 3 component library
https://vitejs.dev/guide/build.html#library-mode

Setup tailwind

component์— ์“ฐ์ธ tailwind class๊ฐ€ export ๋˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, export target js ํŒŒ์ผ์— tailwind css๋ฅผ import ์ถœ์ฒ˜

Caveats

tailwind

Preflight๋ฅผ ํฌํ•จํ•œ ๊ธฐ๋ณธ ์ •์˜๋˜๋Š” style์ด ์ „๋ถ€ export๋œ๋‹ค. ์ค‘๋ณต ๋‚ด์šฉ์ด๋ฏ€๋กœ ์ œ๊ฑฐ. component์— ์ •์˜๋œ class style๋งŒ export ๋˜๋„๋ก import ๋˜๋Š” css๋Š” ๋‹ค์Œ ๋‚ด์šฉ๋งŒ ๋„ฃ๋„๋ก

@tailwind utilities;

package.json > dependencies

dependencies์— ๋„ฃ์–ด ๋ฐฐํฌํ•˜๋‹ˆ๊นŒ node_modules๋„ ๊ฐ™์ด ๋ฐฐํฌ๋œ๋‹ค. (package.json์— files๋กœ dist directory๋งŒ ์ œํ•œ ๋„ฃ์–ด๋„ ๊ฐ™์ด ๋ฐฐํฌ๋จ)
devDependencies๋กœ ์˜ฎ๊ธฐ๋‹ˆ ํฌํ•จ ์•ˆ๋จ.

dependencies resources ์ œ์™ธ

0.3.0 ์€ primeicons.css๋‚˜ font๋„ ๋‹ค ํฌํ•จํ•˜๋„๋ก ๋งŒ๋“ค์—ˆ๋Š”๋ฐ github package ์šฉ๋Ÿ‰ ์ œํ•œ๋„ ์žˆ๊ณ , prime์˜ ๊ฒฝ์šฐ๋Š” peerDependencies๋กœ ์„ค์น˜๋˜๋‹ˆ ๊ฒฐ๊ตญ ์ค‘๋ณต์ด๋ผ ์ œ๊ฑฐํ•ด์„œ 0.4.0๋กœ...

Week 16, 2023 - Cloudfront uri query

SPA framework - S3 - CloudFront ๋ฐฐํฌ ์‹œ 404 error ์ฒ˜๋ฆฌ (Private)๋กœ ์„ธํŒ…๋œ ๋ฐฐํฌ ํ™˜๊ฒฝ์—์„œ ์ฒซ ์ง„์ž… url์— query๋ฅผ ๋„ฃ์„ ๊ฒฝ์šฐ ์ œ๋Œ€๋กœ ์ „๋‹ฌ์ด ์•ˆ๋œ๋‹ค.

redirect๋˜๋ฉด์„œ query ๊ฐ’์ด ๋‚ ์•„๊ฐ€๋‚˜?

Week 16, 2023 - Xstate init children machine

auth.factor === "requiredAccount" &&
  auth.accountStatus === "retainingAccountInfo"

์œ„ code์—์„œ

  • factor๋Š” ์œ ์ž…๋˜๋Š” url๋กœ ๊ณ„์ • ๋กœ๊ทธ์ธ์ด ํ•„์š”ํ•œ์ง€, ํ•„์š”์—†๋Š”์ง€์— ๋Œ€ํ•œ ๊ฐ’์„ ํ• ๋‹นํ•˜๊ณ  ๊ฐ๊ฐ์˜ child machine์„ invoke.
  • accountStatus๋Š” ๊ณ„์ • ๋กœ๊ทธ์ธ์„ ๋‹ค๋ฃจ๋Š” account machine์— ์“ฐ์ด๋ฉฐ retainingAccountInfo๊ฐ€ ์ดˆ๊ธฐ ๊ฐ’.

local์—์„  ๊ณ„์ • ๋กœ๊ทธ์ธ์ด ํ•„์š” ์—†๋Š” ๊ฒฝ์šฐ accountStatus ๊ฐ’์ด ํ• ๋‹น ์•ˆ๋˜๋Š”๋ฐ, ๋ฐฐํฌํ•˜๋ฉด ์ดˆ๊ธฐ ๊ฐ’์ธ retainingAccountInfo๋กœ ํ• ๋‹น๋จ

์˜์‹ฌ๊ฐ€๋Š” ๊ฑด server ํ™œ์„ฑํ™”๋˜๋Š” local๊ณผ ๋น„ํ™œ์„ฑํ™” (SSG, CSR)๋˜๋Š” ๋ฐฐํฌ ํ™˜๊ฒฝ

Week 11, 2023 - Nuxt dev/prod env ์ฐจ์ด

๊ฐœ๋ฐœ์€ server ๋„์›Œ์„œ ํ•˜๊ณ , prod์€ jam stack์œผ๋กœ ์˜ฌ๋ฆฌ๋‹ˆ ์ฐจ์ด์ ์ด ๋ฐœ์ƒ.

if (process.server) return

plugin์—์„œ ์จ์•ผ ํ•  ๊ณณ์ด ๋งŽ๋‹ค.

Week 10, 2023 - Vue3 flatMap reactive

์ด์ „ vue2 code๋ฅผ vue3 ๊ธฐ๋ฐ˜์˜ nuxt๋กœ ์˜ฎ๊ธฐ๋‹ค๊ฐ€ ๋ฐœ์ƒํ•œ ๋ฒ„๊ทธ

// data ์ƒ์„ฑ code
report?.disease.categories.flatMap((d) => d.items).map(
   (d) => {d.invalid = !d.code || d.codeSkip == 'Y' return d})

์ €๊ธฐ์— ๋งˆ์ง€๋ง‰ map ์•ˆ์ชฝ code๊ฐ€ ๋ฐ์ดํ„ฐ์— ๋ฐ˜์˜๋˜์ง€ ์•Š๊ณ , sorting๋„ ๋˜์ง€ ์•Š์Œ.

๋‚˜์ค‘์— ์•Œ์•„๋‚ธ๊ฑด flatMap ๋‹จ๊ณ„๊นŒ์ง€๋งŒ reactive๋˜๊ณ  ๊ทธ ์ดํ›„๋Š” ์•ˆ๋จ. map์„ ๋‘ ๋ฒˆ ์จ์„œ ๊ทธ๋Ÿฐ์ง€, flatMap๊นŒ์ง€๋งŒ ๋˜๋Š” ๊ฑด์ง€, vue3(hook), vue2 code(option) ์„ž์–ด์„œ ์จ์„œ ๊ทธ๋Ÿฐ์ง€ ์ด์œ ๋Š” ๋ชจ๋ฆ„.

map ๋Œ€์‹ ์— forEach๋กœ ๋จผ์ € ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌํ•˜๊ณ  component์— ๋„˜๊ธธ ๋•Œ flatMap์œผ๋กœ ๋„˜๊ฒจ์ฃผ๋‹ˆ ์ •์ƒ ๋™์ž‘.

Week 10, 2023 - Vue3 defineProps reactive

skeleton ๋•Œ๋ฌธ์— undefined ๋ฐ์ดํ„ฐ๋„ props๋กœ ์ „๋‹ฌํ•˜๋Š”๋ฐ vue3์—์„œ defineProps๊ฐ€ reactive ๋˜์ง€ ์•Š์•„ ์‹ค์ œ ๋ฐ์ดํ„ฐ๊ฐ€ ๋“ค์–ด์™”์„ ๋•Œ ๊ฐฑ์‹ ์„ ์•ˆ ํ•จ.

props ๋ณ€์ˆ˜์— toRef๋กœ ํ•œ ๋ฒˆ ๋” wrapping ํ•˜์—ฌ ํ•ด๊ฒฐ.

What is the difference between ref, toRef and toRefs

const props = defineProps({ data: Object })
const data = toRef(props, "data")

Updated: Vue(Nuxt?)์˜ version์ด update ๋จ์— ๋”ฐ๋ผ toRef ์—†์ด ์ž˜ ๋˜๋Š” ๋“ฏ (vue v3.3.4)

Week 10, 2023 - CloudFront์—์„œ /subdir/index.html ์„œ๋น„์Šค ์„ธํŒ…

Setting Front CDN

Week 9, 2023 - XState

์ƒˆ๋กœ์šด ํ”„๋กœ์ ํŠธ์— ์ธ์ฆ๊ด€๋ จ ์ƒํƒœ๋ฅผ XState๋กœ ์ ์šฉํ•ด๋ณด๊ณ  ์žˆ๋Š”๋ฐ Nuxt, global state, XState ์ฝœ๋ผ๋ณด๋กœ ๋‚œํ•ญ.
article๋ณด๋ฉด ๋‹ค๋“ค ์ž˜ ์“ฐ๊ณ  ์žˆ๋˜๋ฐ, ๊ทธ ๋™์•ˆ ๋ณธ ๋ฌธ์„œ ์ค‘์—์„œ ์ œ์ผ ์ฝ๊ธฐ ํž˜๋“ฌ.
error๋ผ๋„ ๋ฑ‰์–ด์•ผ ํ•˜๋Š”๋ฐ ์™œ ์ฃ„๋‹ค ์นจ๋ฌตํ•˜์ง€?

  1. ๋‚ด๊ฐ€ ์˜ˆ์ƒํ•˜๊ธฐ๋ก  ์–ด๋–ค ๊ธฐ๋Šฅ์ด ์žˆ์–ด์•ผ ํ•˜๋Š”๋ฐ, ๋ฌธ์„œ์—๋Š” ์—†๊ณ 

  2. ํ•จ์ˆ˜ ๋‚ด์˜ navigateTo ์ฒ˜๋ฆฌ๊ฐ€ ์•ˆ๋˜์„œ XState ์ชฝ์„ ๊ณ„์† ๋ดค๋Š”๋ฐ Nuxt์—์„œ error๋„ ์•ˆ๋‚ด๊ณ  ์ฒ˜๋ฆฌ ์•ˆํ•˜๊ณ  ์žˆ์—ˆ๊ณ  (lifecycle ๋‹จ๊ณ„ ๋ฌธ์ œ๋กœ ๋ณด์ž„)

  3. global instance์ธ์ง€ ์ƒˆ๋กœ instance ์ƒ์„ฑ๋˜๋Š”์ง€ ๋ช…ํ™•ํžˆ ์•ˆ๋‚˜์™€์„œ ์ฃ„๋‹ค ๋’ค์ ธ๋ณด๊ณ 

  4. instance ์ƒ์„ฑ์ด๋ผ๋Š” ๊ธ€์„ github issue์—์„œ ์ฐพ๊ณ  state management๋ฅผ ํ•ด๋ณด๋‹ˆ ๋˜ invoke ์ฒ˜๋ฆฌ๊ฐ€ ์•ˆ๋˜๋Š”๊ฑฐ ๊ฐ™์•„์„œ ๊ณ„์† ํŒŒ๋ณด๋‹ˆ state์—์„œ๋ถ€ํ„ฐ computeํ•˜์ง€ ๋ง๊ณ  machine๋ถ€ํ„ฐ compute๋ฒ”์œ„์— ๋„ฃ์–ด์•ผ ํ•˜๊ณ ...

    const authMachine = useAuthMachine()
    const { state, send } = authMachine.value
    const loginStatus = computed(() => state.value) // ! state.value ๋ฒˆํ™”๊ฐ€ ์—†์Œ
    
    const loginStatus = computed(() => authMachine.value.state.value) // ์ด๋ ‡๊ฒŒ ํ•ด์•ผ state.value ๋ณ€ํ™”๊ฐ€ ๊ฐ์ง€๋œ๋‹ค.
    
  5. store์ชฝ์— useMachine์„ ๋„ฃ์œผ๋ฉด hook์ด๋ผ์„œ ๊ทธ๋Ÿฐ๊ฐ€ invoke๊ฐ€ ๋˜ ์•ˆ๋˜๊ณ ... (app.vue์—์„œ useMachine์„ ๋„ฃ์œผ๋ฉด ํ•ด๊ฒฐ๋จ). error๋ผ๋„ ๋ฑ‰๋“ ์ง€

  6. ๋ฌธ์„œ๋Š” ์™œ ๋˜ v4๋ž‘ v5 alpha ๋‚ด์šฉ์ด ์„ž์—ฌ์žˆ๋ƒ.

Week 9, 2023 - Layout about scroll bar

ํ˜„์žฌ ๋ฐ์Šคํฌํƒ‘ ์Šคํฌ๋กค ๋ฐ”๊ฐ€ body์—๋งŒ ์ ์šฉ๋˜์–ด ์žˆ๊ณ  header์—๋Š” ์—†์Šต๋‹ˆ๋‹ค.

chome ๊ณ„์—ด์—์„  ์Šคํฌ๋กค ๋ฐ”๊ฐ€ width ์ฐจ์ง€ ์•Š๊ฒŒ ํ•˜๋Š” overlay ์†์„ฑ ๋„ฃ๊ฒ ์Šต๋‹ˆ๋‹ค.

  • header๊ฐ€ ์Šคํฌ๋กค ๋ฌด๊ด€ํ•˜๊ฒŒ ๊ณ ์ • ์œ„์น˜๋ผ ๊ทธ๋Ÿฐ์ง€ ์Šคํฌ๋กค ๋ฐ” width ๋ฌด์‹œํ•ฉ๋‹ˆ๋‹ค.

apple site๋„ layout ์œ„์น˜ ๋ฒ—์–ด๋‚˜๊ฒŒ ๋‘๋„ค์š”.

Week 8, 2023 - Cloudfront: nuxt missing resource by html cache after new deployment

๋ฌธ์ œ

nuxt generateํ•˜์—ฌ s3๋ฅผ ํ†ตํ•ด cloudfront๋กœ ์„œ๋น„์Šคํ•˜๋ฉด, cache ์ •์ฑ… ์— ๋”ฐ๋ผ browser์—์„œ ์ƒˆ๋กœ ๋ฐฐํฌ ๋˜๊ธฐ ์ „์˜ index.html cache๋ฅผ ์ฝ์–ด ๋ฐฐํฌ๋กœ ์‚ญ์ œ๋œ .js, .css๋ฅผ ๋ชป ์ฐพ์•„ 404 error๊ฐ€ ๋œฌ๋‹ค. index.html cache๊ฐ€ ๋‚จ์•„ ์žˆ์œผ๋ฉด front ๋ฐฐํฌ ๋•Œ๋งˆ๋‹ค ์ƒˆ๋กœ build ๋œ assets์˜ uri์„ ๋ชป ๊ฐ€์ ธ์˜จ๋‹ค.

ํ•ด๊ฒฐ: Cache control - CloudFront functions

*.html pattern์—

cache-control: no-store,must-revalidate;

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control


์ฐธ๊ณ 

์ด๊ฒƒ๋„ ๊ฐ™์ง€๋งŒ... cache control๋กœ ๋ณ€๊ฒฝํ•œ ์ด์ „ ์ž‘์—…

How to make CloudFront never cache index.html on S3 bucket

A solution based on CloudFront configuration:

Go to your CloudFront distribution, under the "Behavior" tab and create a new behavior. Specify the following values:

  • Path Pattern: index.html
  • Object Caching: customize
  • Maximum TTL: 0 (or another very small value)
  • Default TTL: 0 (or another very small value)
  • Save this configuration.

CloudFront will not cache index.html anymore.


I think this answer applies to the Use legacy cache settings option in Cache and origin request settings. If you want to use an existing managed policy by selecting the Use a cache policy and origin request policy option, I think the correct value is Managed-CachingDisabled

Week 7, 2023 - Windows Subsystem for Linux

๋ฐ‘์˜ ๊ตญ์„ฑ์› ์œ ์ „์ž ๊ฒ€์‚ฌ ์‹ ๊ณ  ์ž‘์—…. ๋ฐ์ดํ„ฐ ๋งŒ๋“œ์‹œ๋Š” ๋ถ„๋“ค์ด ์•ผ๊ทผํ•˜๊ณ  ํ† ์š”์ผ์—๋„ ์ž‘์—…ํ•˜์…”์„œ ์ผ์š”์ผ์— ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ž‘ ์‹ค์ œ ๋ฐ์ดํ„ฐ ๋“ฑ๋ก ํ…Œ์ŠคํŠธ๋ฅผ ํ•จ.

WSL ์„ค์น˜ ํ›„ pnpm i error. ํ•˜๋‹จ ๋‹ต๊ธ€๋ณด๋‹ˆ ์ด๊ฒŒ ๋ญ”๊ฐ€ ์‹ถ๋‹ค. ๊ฒฐ๊ตญ windows ์˜ํ–ฅ์„ ๋ฐ›๋Š”๋‹ค๋Š” ๊ฑฐ์ž–์•„. ๋‚ ๋ฆฌ๊ณ  windows์šฉ์œผ๋กœ ์„ธํŒ…

Solution for WSL

I solved this by mounting C:/ with default permissions bound to my user instead of root. I followed the guide here: https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/

sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata,uid=1000,gid=1000,umask=22,fmask=111

This mounts all files on the C drive as my user instead of root. Therefore sudo is not needed to run npm i

Volta

windows ์„ค์น˜ ํ›„ ์‹คํ–‰์ด ์•ˆ๋จ

https://github.com/volta-cli/volta/issues/1392#issuecomment-1336254236

์ข€ ์ฐพ์•„๋ณด๋‹ˆ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ํ™•์ธํ•˜๋ผ๊ณ  ํ•จ. ๋จ. ๊ณต์‹ ๋ฌธ์„œ linux ์„ค์น˜์—๋Š” ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋“ฑ๋กํ•˜๋ผ๊ณ  ํ•ด๋†“๊ณ  windows์—๋Š” ๊ทธ๋Ÿฐ๊ฑฐ ์•ˆ์จ์žˆ๋Š”๋ฐ?

Week 6, 2023 - ๊ตญ์ƒ์› ์œ ์ „์ž ๊ฒ€์‚ฌ ์‹ ๊ณ  - Playwright script

์‹คํ–‰์ด ๋น ๋ฅด๊ณ  test code recording์ด ํŽธํ•œ playwright๋กœโ€ฆ

๊ตญ์ƒ์› ํ•ญ๋ชฉ ์ž…๋ ฅ Error

๊ตญ์ƒ์› ์‚ฌ์ดํŠธ์—์„œ item ์ž…๋ ฅํ•  ๋•Œ ํ•„์ˆ˜ ํ•ญ๋ชฉ์ด ๋น ์ง€๋ฉด alert์„ ์ฃผ์ง€๋งŒ, max length๊ฐ€ over๋˜๋ฉด ๊ฒฝ๊ณ  ์—†์ด ์ €์žฅ๋๋‹ค๊ฐ€ ๋‚˜์ค‘์— ํ™•์ธ๋˜๋ฉด ์ €์žฅ ์•ˆ๋œ๊ฑธ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ํ•ด์„œ ํ•ญ๋ชฉ์ €์žฅํ™•์ธ function์œผ๋กœ ์ €์žฅ๋๋Š”์ง€ ํ™•์ธ ์ ˆ์ฐจ๋ฅผ ๋„ฃ์Œ

Week 5, 2023 - Cypress โ†’ Playwright โ†’ Cypress

Playwright์˜ Test code structuring ๋ฌธ์ œ

Playwright

playwright๋Š” test ๋งˆ๋‹ค ๋…๋ฆฝ์ ์ธ๊ฑธ ๊ฐ€์ •ํ•˜์—ฌ parallelํ•˜๊ฒŒ ์‹คํ–‰ํ•˜๋„๋ก ๊ถŒ์žฅ.

๋ฌธ์ œ๋Š” ํ•˜๋‚˜์˜ story๋ฅผ ํ…Œ์ŠคํŠธ ํ•˜๋Š”๋ฐ step๋ณ„๋กœ ๋‚˜๋ˆŒ ์ˆ˜ ์—†์Œ. (feature request๋Š” ์žˆ๋Š”๋ฐ ๋‚ฎ์€ ์šฐ์„ ์ˆœ์œ„๋กœ 1๋…„ ๋ฐ˜ ๋™์•ˆ ์ง„์ „์—†์Œ)

์–ด๋–ค ๊ธ€์—๋Š” test.step์„ ์“ฐ๋ผ๊ณ  ํ–ˆ๋Š”๋ฐ, ์จ๋ณด๋‹ˆ step3์—์„œ error๊ฐ€ ๋‚˜๋„ ์ „์ฒด story์—์„œ error๋‚ฌ๋‹ค๋Š” ๋ณด๊ณ ๋งŒ ๋‚˜์˜จ๋‹ค. debug mode๋กœ ๋Œ๋ ค๋„ ๊ฐ™์Œ. (interface๊ฐ€ ๋‹ฌ๋ผ๋ณด์ด๊ธด ํ•œ๋ฐ...)

test.describe.config serial๋กœ test ๋‚˜๋ˆ ์„œ ์“ฐ๋ฉด ๊ฐ€๋Šฅํ•˜๊ธด ํ•œ๋ฐ, testํ•˜๋‚˜ ๋๋‚  ๋•Œ๋งˆ๋‹ค browser context๊ฐ€ reset ๋จ. (=page reset)

์™„์ „ deal breaker์ธ๋ฐ, playwright๋ฅผ ์จ์•ผ ํ•˜๋‚˜? global config๋กœ serialํ•˜๊ฒŒ ํ•˜๋ฉด ๋ ๊นŒ? test.describe.config๋ž‘ ์ฐจ์ด ์—†์„ ๊ฑฐ ๊ฐ™์€๋ฐ test๋งˆ๋‹ค my-test setting์„ ํ•˜๋„๋ก ํ•จ? step์˜ ์‹œ์ž‘๋‹จ๊ณ„ ๋งˆ๋‹ค context๋ฅผ settingํ•˜๋ผ๊ณ ?

๋ฌธ์„œ๋„ ๋„ˆ๋ฌด ๋นˆ์•ฝ https://playwright.dev/docs/api/class-test#test-step

test.step
Declares a test step.

Cypress

์ฐพ์•„๋ณด๋‹ˆ cypress์—์„œ๋„ test code recording ๊ธฐ๋Šฅ์ด ์žˆ๋‹ค. ์‹œํ—˜ ๊ธฐ๋Šฅ์ด์ง€๋งŒ. (experimentalStudio)

ver.10.0์—์„œ ์‚ญ์ œํ–ˆ๋‹ค๊ฐ€ feedback์—์„œ ๋ถ€ํ™œ์‹œ์ผœ๋‹ฌ๋ผ๋Š” ์š”์ฒญ์ด ๋งŽ์•„์„œ ver.10.7์—์„œ ๋ถ€ํ™œ. ํ˜„์žฌ ver.12.5.1. ๋ฐ˜๋…„ ์ •๋„ ์ง€๋‚ฌ๋Š”๋ฐ ์•„์ง๋„ experimental ๋‹จ๊ณ„๋ผ๋Š”๊ฒŒ ์ข€ ๊ทธ๋ ‡์ง€๋งŒ, ๋‚ด๋ ธ๋‹ค๊ฐ€ feedback ๋ฐ›๊ณ  ๋ถ€ํ™œํ•œ๊ฑฐ๋ผ ์—†์–ด์งˆ๊ฑฐ ๊ฐ™์ง€๋Š” ์•Š์Œ. ํ•ด์„œ cypress๋กœ ๊ณ„์† ์“ธ ๋“ฏ.

์˜ค๋žœ๋งŒ์— cypress ๋Œ๋ ค๋ณด๋‹ˆ env ์‹คํ–‰ ์ž์ฒด๊ฐ€ ๋„ˆ๋ฌด ๋Š๋ฆฌ๋‹ค. playwright ์“ฐ๋‹ค๊ฐ€ ์“ฐ๋‹ˆ ์—ญ์ฒด๊ฐ์ด ์‹ฌํ•จ.

Week 4, 2023 - AWS EC2 ํ…Œ์ŠคํŠธ ์„œ๋ฒ„ ๋ณผ๋ฅจ ์‚ญ์ œ๋จ

๊ฒฝ๊ณผ

์•„์นจ ์ถœ๊ทผํ•˜๋‹ˆ ํ…Œ์ŠคํŠธ ์„œ๋ฒ„ CPU ์ ์œ  ๊ฒฝ๊ณ ๊ฐ€ ๋œธ. ํ™•์ธํ•ด๋ณด๋‹ˆ 100%์—์„œ ๊ณ„์† ์œ ์ง€๋˜์–ด์„œ EC2 Instance๋ฅผ reboot.
๋ช‡ ๋ถ„ ๋’ค์— ๋ณ€ํ™”๊ฐ€ ์—†์–ด์„œ suspend. ๋ช‡ ๋ถ„ ๋’ค์— ์›น ์‚ฌ์ดํŠธ ์ ‘์† ์•ˆ๋˜์–ด ํ™•์ธํ•ด๋ณด๋‹ˆ ์ข…๋ฃŒ ๋จ. ??? log๋ฅผ ํ™•์ธํ•ด๋ณด๋‹ˆ AutoScailing์ด ์ฃฝ์—ฌ๋ฒ„๋ฆผ.

๋” ํ™•์ธํ•ด๋ณด๋‹ˆ ์ž๋™ ์ƒ์„ฑ๋œ instance์˜ volumn์ด ๊ณ„์Šน๋˜์ง€ ์•Š๊ณ  ์ƒˆ๋กœ ์ƒ์„ฑ ๋จ. ์ด๊ฑฐ๊นŒ์ง„ ์ดํ•ด๊ฐ€ ๊ฐ€๋Š”๋ฐ ๊ธฐ์กด volumn์„ ์ž๋™ ์‚ญ์ œ? ์ด๋Ÿฐ ๋ฐฉ์‹์ด๋ฉด ๋ฏฟ๊ณ  ์“ธ ์ˆ˜๊ฐ€ ์žˆ๋‚˜? ๋‚˜์ค‘์— ์•Œ์•„๋ณด๋‹ˆ EC2 ์ƒ์„ฑ ์‹œ ๊ธฐ๋ณธ์œผ๋กœ root volumn์ด ์ข…๋ฃŒ ์‹œ ์‚ญ์ œ ์„ค์ •๋œ๋‹ค. ๐Ÿคจ

ํ•ด๊ฒฐ

GitHub Actions - S3 - Code Deploy week4-2023__test-server, GitHub Actions Code Deploy Git Pull๋ฅผ ํ†ตํ•ด ๋ณต๊ตฌ.

Week 3, 2023 - Nuxt generate ์‹œ, dynamic route์—์„œ payload error

ํ˜„์ƒ

next generate๋กœ ์ƒ์„ฑ๋œ ์‚ฌ์ดํŠธ์—์„œ payload ์ƒ์„ฑ ์•ˆํ•˜๋Š” dynamic route path์—์„œ๋„ payload๋ฅผ ์š”๊ตฌssr-prerendering?

ํ•ด๊ฒฐ

crawlLinks: true์™€ ํ•จ๊ป˜ nuxt build๋กœ ์ƒ์„ฑ

When using this option with nuxi build, static payloads won't be generated by default at build time. For now, selective payload generation is under an experimental flag. โ€” https://nuxt.com/docs/getting-started/deployment#selective-pre-rendering

//nuxt.config.js
{
  nitro: {
    // ์ด config ์—†์ด nuxt generateํ•˜๋ฉด dynamic route๊นŒ์ง€ payload๋ฅผ try. error ๋ฐœ์ƒ.
    prerender: {
      crawlLinks: true,
      routes: ['/', '/ko'],   // /ko๋Š” @nuxtjs/i18n module์˜ ํ•œ๊ตญ์–ด ์ง€์›์„ ์œ„ํ•ด
    },
  }
}

์ฐธ๊ณ ํ•œ ๋ฌธ์„œ๋“ค

Week 2, 2023 - Playwright CORS setting

Allow Extension

๊ฒฐ๋ก ์€ ์‹คํŒจ. load๋Š” ๋์ง€๋งŒ ๊ธฐ๋ณธ off๋กœ ๋˜์–ด ์žˆ์–ด browser ์ฒ˜์Œ ์‹คํ–‰ํ•  ๋•Œ ์†์œผ๋กœ on ์‹œ์ผœ์•ผ ํ•จ.

# Run find . -type d -iname "<EXTENSION ID HERE>"
// playwright.config.js
use: {
   launchOptions: {  // https://playwright.dev/docs/api/class-testoptions#test-options-launch-options
      args: [  // https://playwright.dev/docs/chrome-extensions
         `--disable-extensions-except=~/Library/Application Support/Google/Chrome/Default/Extensions/lfhmikememgdcahcdlaciloancbhjino/0.3.5_0`,
      ],
   },
}

Off web security

์ด์ชฝ์œผ๋กœ ํ•ด๊ฒฐchromium-only

// playwright.config.js
use: {
   launchOptions: {  // https://playwright.dev/docs/api/class-testoptions#test-options-launch-options
      args: ['--disable-web-security'],
   },
}

Week 2, 2023 - Playwright ๋„์ž…

cypress์— ๋น„ํ•ด ๋‹ค์Œ ์ด์ ์ด ํ™•์—ฐํ•˜๋‹ค. (๊ทธ๋ฆฌ๊ณ  ๋‹จ์ ์ด ๋“œ๋Ÿฌ๋‚˜๋Š”๋ฐ...)

  1. ์†๋„๊ฐ€ ๋น ๋ฅด๊ณ  (browser๋ฅผ ์ง์ ‘ ๋„์šฐ์ง€ ์•Š๊ณ  ํ…Œ์ŠคํŠธ๋งŒ ์‹คํ–‰์‹œํ‚ฌ ์ˆ˜ ์žˆ์Œ)
  2. VS code์™€์˜ ์—ฐ๊ฒฐ์ด ๋”์šฑ ๊ธด๋ฐ€ํ•˜๋‹ค.
    1. browser์—์„œ์˜ ์ž…๋ ฅ์„ test code๋กœ ์ƒ์„ฑํ•ด์คŒ.
    2. vs code์—์„œ selector์— cursor๋ฅผ ๋‘๋ฉด, browser์—์„œ ํ•ด๋‹น element๊ฐ€ ํ‘œ์‹œ๋จ

Week 2, 2023 - temp branch ์šด์˜

๋ฌธ์ œ

๋ฐฐํฌ ํ™˜๊ฒฝ์—์„œ๋งŒ ํ…Œ์ŠคํŠธ ํ•  ์ˆ˜ ์žˆ๋Š” ๋‚ด์šฉ์ด๋ผ๋ฉด ์ง€์†์ ์œผ๋กœ ์ˆ˜์ •ยท๋ฐฐํฌยทํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰
์ด ๊ณผ์ • ์ค‘์— ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๊ฐ€ ํ…Œ์ŠคํŠธ ์„œ๋ฒ„์— ๋ฐฐํฌํ•˜๋ฉด ๋‚ด์šฉ์ด ์„œ๋กœ ์ƒ์‹ค๋˜๊ฑฐ๋‚˜ ๋ธŒ๋žœ์น˜ conflict๊ฐ€ ๋นˆ๋ฒˆํ•˜๊ฒŒ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ, ๊ฐœ๋ฐœ์ž๋ผ๋ฆฌ ํ…Œ์ŠคํŠธ ๋ธŒ๋žœ์น˜, ์„œ๋ฒ„๋ฅผ ์“ฐ๊ฒ ๋‹ค๊ณ  ์•Œ๋ฆฐ ๋’ค์— ๋…์ ์ ์œผ๋กœ ์‚ฌ์šฉ ์ค‘ (fixup์œผ๋กœ ์Œ“์•„๊ฐ€๋ฉฐ ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ์œผ๋‚˜, ๊ฒฐ๊ตญ์—” commit์„ ์ •๋ฆฌํ•œ ํ›„, ์ •๋ฆฌํ•œ ๊ฑธ ๋‹ค์‹œ ํ…Œ์ŠคํŠธํ•ด์•ผ ํ•˜๋Š”๋ฐ, ์ด ๋•Œ conflict๊ฐ€ ๋Œ€๋Ÿ‰ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค.)

ํ•ด๊ฒฐ

temp branch ์šด์˜. husky๋ฅผ ์ด์šฉํ•˜์—ฌ temp branch๋ฅผ pushํ•˜๊ธฐ ์ „์— origin/test branch๋ฅผ merge

https://stackoverflow.com/questions/6372334/git-commit-hooks-per-branch/6376054#6376054

Trouble shooting

pushํ•  ๋•Œ ๋‹ค์Œ error๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด chmod๋กœ ํ•ด๋‹น ํŒŒ์ผ์— ์‹คํ–‰ ๊ถŒํ•œ์„ ์ค„ ๊ฒƒ

hint: The '.husky/pre-push' hook was ignored because it's not set as executable.

test branch merge ํ›„ remote์—๋Š” push๋๋Š”๋ฐ, local์—์„œ๋Š” push ์•ˆ๋œ ๊ฑธ๋กœ ํ‘œ์‹œ
โ†’ post push hook์ด ์—†์–ด์„œ merge๊ฐ€ ์ผ์–ด๋‚˜๋ฉด ์†์œผ๋กœ fetch ์ž…๋ ฅํ•ด์•ผ ํ•จ. ์•„๋‹ˆ๋ฉด fetch ์„ ํ–‰ ์ž…๋ ฅ

git push;git fetch

Week 52, 2022 - Tailwind - Dynamic class names

class = `bg-${ zero ? pageColor : baseColor}` // not work
class = zero ? `bg-${pageColor}` : `bg-${baseColor}` // not work

Week 51, 2022 - SPA framework - S3 - CloudFront ๋ฐฐํฌ ์‹œ 404 error ์ฒ˜๋ฆฌ

์—†๋Š” URI๋กœ ์ ‘๊ทผ ์‹œ 403 error๊ฐ€ ๋œฌ๋‹ค. ์•„๋งˆ๋„ ํ•ด๋‹น url path๋ฅผ cloudFront์—์„œ ์ธ์‹ํ•˜์ง€ ๋ชปํ•ด์„œ S3๋กœ ์š”์ฒญ์ด ๊ฐ€๊ณ  public์ด ์•„๋‹ˆ๋‹ˆ permission denied ์—๋Ÿฌ

cloudfront์—์„œ 403 error๋ฅผ SPA framework index.html๋กœ ์ฒ˜๋ฆฌํ•˜๋„๋ก ํ•ด์ฃผ๋ฉด framework์—์„œ 404 ์ฒ˜๋ฆฌํ•ด ์คŒ

Week 50, 2022 - tailwind css

์ƒˆ nuxt3 project์— tailwind ๋„์ž…. ๊ทธ ๋™์•ˆ ์ œ์ž‘์ž ์†Œ๊ฐœ๊ธ€์—์„œ motivation๊ณผ ๊ฒฐ๊ณผ๊ฐ€ ๋ชจ์ˆœ๋˜๋Š” ๊ฑธ ๋ด์„œ ๊บผ๋ ธ๋Š”๋ฐ, code colocation์œผ๋กœ ์ธํ•œ DX, ์†๋„ ํ–ฅ์ƒ ๋•Œ๋ฌธ์— ์จ๋ณด๊ธฐ๋กœ ํ•จ.

Week 49, 2022 - Nuxt3 UI Framework

.com์— ์“ฐ์ธ buefy UI framework๋Š” .co.kr์— ์“ฐ์ด๋Š” ํ”„๋กœ์ ํŠธ ์ง€์›X (major version)

Candidates

  1. naiveui - ์ด์Šˆ ๋“ฑ๋ก ๊ธ€์ด ์ค‘๊ตญ์–ด๊ฐ€ ๋” ๋งŽ์Œ
    • sketch kit free
    • Naive UI Snippets - vs code
  2. antdv - figma kit ๊ตฌ๋งคํ•จ - ๋ฒ„๊ทธ ๋‹ต๋ณ€์ด ์ฃ„๋‹ค ์ค‘๊ตญ์–ด
  3. primevue โœ…
  4. vuetifyjs
  5. https://element-plus.org/en-US/component/button.html
  6. ui-elements
    • no figma or sketch
  7. inkline
    • storybook, no figma or sketch

Week 48, 2022 - Refine package.json product section

pnpm install --prod --frozen-lockfile

product์— ์“ฐ์ง€ ์•Š๋Š” package ์„ค์น˜๋ฅผ ํ”ผํ•˜์—ฌ ์ƒˆ package ์„ค์น˜ ์‹œ์˜ ์‹œ๊ฐ„์„ 37 โ†’ 19์ดˆ๋กœ ์ค„์ž„.
js resource size๋„ 9mb ์ •๋„ ์ค„์Œ (github cache ํ™•์ธ)

Week 47, 2022 - nuxt3 generate false negative error

sentry setting test ๋•Œ๋ฌธ์— ์ผ๋ถ€๋Ÿฌ error๋ฅผ ๋‚ด๊ณ  ๋ฐฐํฌํ–ˆ๋Š”๋ฐ ๊ณ„์† ์ •์ƒ ๋™์ž‘ํ•จ.
github actions log ํ™•์ธํ•˜๋‹ˆ...
generate์‹œ์—

WARN Using experimental payload extraction for full-static output. You can opt-out by setting experimental.payloadExtraction to false.

๋ผ๊ณ  ๋œจ๋”๋‹ˆ... ๊ด€๋ จ์žˆ๋‚˜?

Week 45, 2022 - TanStack Query ์ ์šฉ

Powerful asynchronous state management, server-state utilities and data fetching.
cache on API request.
report detail modal โ†’ page๋กœ ๋ณ€ํ™˜ํ•จ์— ๋”ฐ๋ผ summary ํ™”๋ฉด๊ณผ ์ „ํ™˜์ด ์žฆ๊ณ  ๊ทธ ๋•Œ๋งˆ๋‹ค API request๋ฅผ ํ•จ.
stale time์„ ์„ค์ •ํ•˜์—ฌ ์ •ํ•ด์ง„ ์‹œ๊ฐ„ ๋‚ด์—๋Š” request ์—†์ด cache data ํ™œ์šฉํ•˜๋„๋ก ์ˆ˜์ •

TanStack Query ์ ์šฉ ์ด์ „. ๋ฆฌํฌํŠธ ์š”์•ฝโ†”์ƒ์„ธย ํŽ˜์ด์ง€ ์ด๋™ ์‹œ ๋งˆ๋‹ค API request ๋ฐœ์ƒTanStack Query ์ ์šฉ ์ดํ›„. Cache๋ฅผ ํ™œ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฆฌํฌํŠธ ์š”์•ฝย ํŽ˜์ด์ง€์—์„œ ์ถ”๊ฐ€ API request๊ฐ€ ์—†์–ด์ง

Week 44, 2022 - Google app script about i18n

Week 39, 2022 - Package manager yarn โ†’ pnpm

๋ฐฐํฌ ์‹œ๊ฐ„ -40s (package ์„ค์น˜ ์‹œ๊ฐ„ ๊ฐ์†Œ) - ์บ์‹œํ™œ์šฉ ์ฐจ์ด? ๊ฐ™์€ script์ธ๋ฐโ€ฆ

local disk space ์ ˆ์•ฝ


ํ•œ ๋‹ฌ 188k transaction

Week 29, 2022 - Webpack v3 โ†’ v5

vue3์ด ๋‚˜์˜จ ์‹œ์ ์—์„œ ๋ฌด์กฐ๊ฑด ์ตœ์‹  plugin์„ ์“ฐ๋ฉด ํ˜ธํ™˜์ด ์•ˆ๋˜๋ฏ€๋กœ vue2์— ๋งž๋Š” ๋ฒ„์ „ ์ผ์ผํžˆ ์ฐพ์•„ ์„ค์น˜ํ•จ.

Week 15, 2022 - Cypress

e


Footnotes

  1. instance fields: https://stackoverflow.com/a/60026710/5163033ห„

  2. safari-14_1-release-notes: https://developer.apple.com/documentation/safari-release-notes/safari-14_1-release-notes#JavaScript-and-WebAssemblyห„

  3. chart.js-issue-11151: https://github.com/chartjs/Chart.js/issues/11151ห„

  4. 19-yarn: --prefer-offline ์ด๋‚˜ --cache-dir ์„ค์ •์ด๋‚˜, if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}๋‚˜ ๋‹ค ์ž‘๋™ ์•ˆ๋์Œ.ห„

  5. private-package: project๋งˆ๋‹ค ๋‹ค๋ฅธ ๊ณณ์ด ์žˆ๋‹ค๋ฉด composition์ด๋‚˜ injection์œผ๋กœ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. + ๊ด€๋ จ code๋ฅผ ํ•ด๋‹น project์—์„œ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. report ์ „์šฉ ์‚ฌ์ดํŠธ๋กœ ๋งŒ๋“ค๋ฉด ๋‹ค๋ฅธ project ๊ด€๋ จ code๋ฅผ ์‚ฌ์ดํŠธ์—์„œ ๊ด€๋ฆฌํ•ด์•ผ ํ•จ.ห„

  6. week4-2023__test-server: ์ž‘์„ฑํ•ด๋†“์€ ๋ฌธ์„œ์˜ command text์— spacebar ๋Œ€์‹  ๋‹ค๋ฅธ ๋ณด์ด์ง€ ์•Š๋Š” ๋ฌธ์ž๊ฐ€ ๋“ค์–ด๊ฐ€์„œ copy&paste ํ–ˆ์„ ๋•Œ error ๊ณ„์† ๋ฐœ์ƒํ–ˆ์—ˆ์Œ ๐Ÿคจห„

  7. ssr-prerendering? - SSR์„ ํ†ตํ•ด prerendering ํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ, report์˜ ๊ฒฝ์šฐ๋Š” ๊ฐœ์ฒด ๋ณ„ ํŽ˜์ด์ง€๋ฅผ ๋ชจ๋‘ ์ƒ์„ฑ์‹œํ‚ค์ง„ ์•Š์„ ์˜ˆ์ •์ด๋ฏ€๋กœห„

  8. chromium-only - chromium๋งŒ ํ•ด๊ฒฐ. ๋‹ค๋ฅธ browser๋„ ํ•ด๋‹น option์„ ์ฐพ์•„ ๋„ฃ๋“ ๊ฐ€, CORS ์„ธํŒ…์„ ๋ถ€ํƒํ•˜๋“ ๊ฐ€ ํ•ด์•ผ ํ•จ.ห„


Backlinks