์ „์ฒด ๊ธ€

Front-end Developer
Svelte

Svelte - Reactivity

๐Ÿ“Œ ๋ชฉ๋ก Introduction Assignments Declarations Statements Updating arrays and objects Conclusion Reference ๐Ÿ“Œ Introduction ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ ๊ฐ€์žฅ ์ค‘์š”ํ•œ reactivity์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋˜๊ฒŒ javascript ์Šค๋Ÿฝ๋”๋ผ๊ตฌ์š”. ์ง๊ด€์ ์ด๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค. vanila javscript๋ฅผ ์งœ๋Š” ๋Š๋‚Œ์ด ๋งŽ์ด ๊ฐ•ํ•˜๊ฒŒ ๋“ค์—ˆ๋˜๊ฑฐ ๊ฐ™์•„์š”. ๊ทธ๋Ÿผ ํ•œ๋ฒˆ ๋ณผ๊นŒ์š”? ๐Ÿ“Œ Assignments ์ผ๋‹จ ๋จผ์ € ๊ฐ„๋‹จํ•˜๊ฒŒ counter๋ฅผ ๊ตฌํ˜„ํ•ด๋ณผ๊ฒŒ์š”. reactivity๋ฅผ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด์„œ click event๋ฅผ ์‚ฌ์šฉํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. {count} + - let ํ‚ค์›Œ๋“œ๋ฅผ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋ฐ”๋กœ ์ด๋ ‡๊ฒŒ ํ•ด์ค„ ์ˆ˜ ์žˆ์–ด์š”. ๐Ÿ“Œ Declarations vue์—์„œ์˜..

Svelte

Svelte - Basic

๐Ÿ“Œ ๋ชฉ๋ก Introduction Adding Data Dynamic Attribute Styling Nested components HTML tags Conclusion Reference ๐Ÿ“Œ Introduction ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ ์ง€๋‚œ๋ฒˆ์— ์ด์–ด svetle์— ๊ธฐ๋ณธ์ ์ธ ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ ํ•œ๋ฒˆ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋งŽ์€ ๋ถ€๋ถ„ vue์—์„œ ์˜ํ–ฅ์„ ๋ฐ›์€ ๊ฒƒ ๊ฐ™์€ ๋Š๋‚Œ์ด ๋“œ๋„ค์š”. ๐Ÿ“Œ Adding Data ์ผ๋‹จ ๊ฐ„๋‹จํ•˜๊ฒŒ hello world์„ ๊ทธ๋ ค๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Hello {name} ์—ฌ๊ธฐ์„œ ์‹ ๊ธฐํ•œ๊ฑด ์ด๋ ‡๊ฒŒ ํ•ด๋„ ๋™์ผํ•˜๊ฒŒ ๋™์ž‘์„ ํ•ฉ๋‹ˆ๋‹ค. Hello {name} ์œ„์น˜๋Š” ๋”ฑํžˆ ์ƒ๊ด€์ด ์—†์–ด๋ณด์—ฌ์š”. ์ด๊ฑธ ํ† ๋Œ€๋กœ ๋ˆˆ์น˜๋ฅผ ์ฑŒ์ˆ˜ ์žˆ๋Š” ๋ถ€๋ถ„์€ ๋‹จ์ˆœ javascript ํ˜•์‹์œผ๋กœ๋งŒ compile์„ ํ•˜๋Š”๊ฒŒ ์•„๋‹Œ๊ฑฐ ๊ฐ™์•„์š”.(์•„์ง ํ™•์‹ค ํ•œ๊ฑด ์•„๋‹ˆ์ง€..

Svelte

Svelte - ์„ค์น˜ ๋ฐ ์‹คํ–‰ ๋ฐฉ๋ฒ•

๋ชฉ๋ก Introduction Set Up Conclusion Reference ๐Ÿ“Œ Introduciton ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ ์š”์ฆ˜ ํ•œ์ฐฝ ๋œจ๊ณ  ์ž‡๋Š” svelte์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์‚ฌ์‹ค ์ด๊ฑธ ์ ‘ํ•˜๊ฒŒ ๋œ ๊ณ„๊ธฐ๋Š” ์‹ค์ œ๋กœ svelte์— contribution์„ ํ•ด๋ณด๊ณ  ์‹ถ์–ด์„œ svelte์„ ๊ณต๋ถ€ํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์•„๋งˆ ๋งˆ์ง€๋ง‰ ์ฑ•ํ„ฐ์—์„œ๋Š” ์‹ค์ œ๋กœ contribute์„ ํ•ด๋ณด๋Š” ๊ทธ๋Ÿฐ ๋‹จ๊ณ„๊ฐ€ ์ด ๋ธ”๋กœ๊ทธ์— ์ ํ˜€์žˆ์œผ๋ฉด ์ข‹๊ฒ ๋„ค์š”. ๊ทธ๋Ÿผ ์ด์ œ ํ•œ๋ฒˆ ์‹œ์ž‘ํ•ด๋ณผ๊ฒŒ์š”. ๐Ÿ“Œ Set Up Svelte์„ ์‹œ์ž‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์—๋Š” ๋‘๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋‚˜๋Š” REPL์ด๋ผ๋Š”๊ฑธ ์ด์šฉํ•˜๋Š” ๊ฑด๋ฐ์š”. ์ด๊ฑธ ์ด์šฉํ•˜๋ฉด codebox์ฒ˜๋Ÿผ ์ธํ„ฐ๋„ท์—์„œ svelte์„ ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ์–ด์š”. ๋‘๋ฒˆ์งธ ๋ฐฉ๋ฒ•์€ digit์„ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.(CRA๋‚˜ vue-cli๊ฐ™์€ ํˆด..

Graphql_Apollo

Apollo - vue3์—์„œ apollo ์‚ฌ์šฉํ•˜๊ธฐ

๋ชฉ์ฐจ Introduction Installation main.js webpack gql file apollo composable Conclusion Reference ๐Ÿ“Œ Introduction ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ apollo๋ฅผ vue3์— ํ•œ๋ฒˆ ์ ์šฉํ•ด๋ณด๋Š” ํฌ์ŠคํŒ…์ž…๋‹ˆ๋‹ค. ํ•ด๋‹น ์ฝ”๋“œ๋Š” ์—ฌ๊ธฐ์„œํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ“Œ Installation npm install @apollo/client graphql react @vue/apollo-composable graphql-tag ์—ฌ๊ธฐ์„œ ์™œ ๊ฐ‘์ž๊ธฐ react๊ฐ€ ํŠ€์–ด๋‚˜์˜ค๋‚˜ ์‹ถ์œผ์‹œ๊ฒ ์ง€๋งŒ...๐Ÿ˜ญ ๋„ค react๋ฅผ ์„ค์น˜๋ฅผ ํ•ด์ค˜์•ผํ•ฉ๋‹ˆ๋‹ค. ํฌ์‘... apollo client์— ์•„๋งˆ.. react๊ฐ€ ์žˆ๊ณ .. ๋” ์ž์„ธํ•œ๊ฑด... ์ƒ๋žตํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๐Ÿ“Œ main.js // main.js impo..

Graphql_Apollo

Apollo - nodejs + mongo ์„œ๋ฒ„ ๋งŒ๋“ค๊ธฐ

๋ชฉ์ฐจ Introduction Apollo with express Connect mongo db Conclusion ๐Ÿ“Œ Introduction ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ Apollo๋ฅผ ์–ด๋–ป๊ฒŒ ์—ฐ๋™ํ•˜๋Š”์ง€์— ๋Œ€ํ•ด์„œ ํ•œ๋ฒˆ ์•Œ์•„๋ณผ๊ฒŒ์š”. ํ•ด๋‹น ์˜ˆ์ œ ์ฝ”๋“œ๋Š” ์—ฌ๊ธฐ์„œ ํ™•์ธ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ“Œ Apollo with express Apollo์—์„œ ๊ฐ€์žฅ ์ค‘์š”ํ•œ๊ฑด typeDefs์™€ resolvers์ž…๋‹ˆ๋‹ค. import express from "express"; import { ApolloServer, gql } from "apollo-server-express"; const app = express(); // typeDefs๋กœ ์Šคํ‚ค๋งˆ๋ฅผ ์„ค์ •ํ•ด์ค„์ˆ˜ ์žˆ์–ด์š”. const typeDefs = gql` type Query { hello: S..

React Study

React - context api

๐Ÿ“Œ ๋ชฉ์ฐจ Introduction context api Conclusion ๐Ÿ“Œ Introduction ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ context api๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ „์—ญ์—์„œ ์ƒํƒœ ๊ฐ’์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๐Ÿ“Œ context api context api๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ์— ์•ž์„œ ๋‘๊ฐ€์ง€ hook์„ ์•Œ์•ผํ•ฉ๋‹ˆ๋‹ค. createContext useContext ์ž…๋‹ˆ๋‹ค. createContext๋Š” ๋ง๊ทธ๋Œ€๋กœ context๋ฅผ ๋งŒ๋“ค์–ด์ค๋‹ˆ๋‹ค. const MyContext = createContext("defaultValue"); ์ฒซ๋ฒˆ์งธ ์ธ์ž๋กœ ์ดˆ๊ธฐ ๊ฐ’์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. useContext๋Š” createContext๋กœ ๋งŒ๋“  ๊ฐ’์„ ์‚ฌ์šฉํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. const text = useContext(MyContext); ๊ทธ๋Ÿผ ์ด์ œ ๊ฐ„..

React Study

React - custom hook

๋ชฉ์ฐจ Introduction custom hook Conclusion ๐Ÿ“Œ Introduction ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ custom hook์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. custom hook์€ ์ž์ฃผ ์‚ฌ์šฉ๋˜๋Š” react hooks๋ฅผ ๋ฌถ์–ด์„œ dryํ•จ์„ ์œ ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ์ด ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿผ ํ•œ๋ฒˆ ์•Œ์•„๋ณผ๊นŒ์š”? ๐Ÿ“Œ custom hook import { useReducer, useCallback } from "react"; const CHANGE_FORM = "CHANGE_FORM"; const RESET_FORM = "RESET_FORM"; function reducer(state, action) { switch (action.type) { case CHANGE_FORM: return { ...state, [action...

React Study

React - useReducer

๋ชฉ์ฐจ Introduction useState์™€์˜ ์ฐจ์ด์  reducer useReducer Conclusion ๐Ÿ“Œ Introduction ์•ˆ๋…•ํ•˜์„ธ์š”. ์˜ค๋Š˜์€ react์—์„œ ๋˜๋‹ค๋ฅธ state๊ด€๋ฆฌ hook์ธ useReducer์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. useReducer๋Š” vuex์™€ ๋น„์Šทํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. action์„ ํ†ตํ•ด ์ƒํƒœ๋ฅผ ๋ณ€๊ฒฝํ•ด์ค„ ์ˆ˜ ์žˆ๋‹ค๋Š” ์ ์—์„œ ๋น„์Šทํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ“Œ useState์™€์˜ ์ฐจ์ด์  ์ผ๋‹จ useState์—์„œ ๊ฐ’์„ ๋ฐ”๊ฟ”์ค„๋•Œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. setState(5);์ด๋ ‡๊ฒŒ setState๋ฅผ ์ด์šฉํ•˜์—ฌ ๋ฐ”๊ฟ”์ฃผ๊ฒŒ ๋˜๋Š”๋ฐ useReducer๋Š” ์กฐ๊ธˆ ๋‹ค๋ฆ…๋‹ˆ๋‹ค. dispatch({ type: INCREMENT });์ด๋ ‡๊ฒŒ action์— type์„ ๋ฐ›์•„ ๊ฐ’์„ ๋ฐ”๊พธ๋Š” ๊ฒƒ์„ ์ˆ˜ํ–‰ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ useS..