nextjs + it dev nextjs context Next.js - 서버 컴포넌트에서 useContext() 사용하기넥스트js는 서버컴포넌트와 클라이언트 컴포넌트로 나뉘어진다 그렇기 때문에 React 기반의 훅들을 사용할 때는 한번더 생각해보아야 한다 오늘은 useContext() 를 어떻게 사용하는 지 알아볼 것이다 Next.js - 서버 컴포넌트에서 useContext() 사용하기 리액트에서 전역 변수를 전달하기 위해 redux / useContext 를 사용하였다 Next.js에서 useContext 를 사용하려고 하니 한가지 제약이 있었다 You are using createContext in a Server Component but it only works in Client Components → 바로 클라이언트 컴포넌트에서만 사용이 가능하다는 것이다 createContext in a Server Compo.. wono | discuss | tweet + it dev nextjs jwt jose [Next.js@13] jwt 라이브러리, jsonwebtoken 대신 jose[Next.js@13] jsonwebtoken 대신 jose Next.js에서 jwt를 생성할 때 늘 쓰던 jsonwebtoken 모듈을 시도했다. 결과는 오류! 공식 문서에 따르면 Edge 런타임은 모든 Node.js API를 지원하진 않는다고 알려준다. error - Error: The edge runtime does not support Node.js 'buffer' module. jose 그래서 대체 모듈을 찾다가 jose 라는 모듈을 찾았다. 해당 모듈은 종속성없이 작동한다. 내부에 각 모듈들은 독립적이기에 트리쉐이킹도 가능하다고한다. 지원 목록을 보면 맨 아래에 당당하게 Vercel이 있다. 현재 jwt 생성과 복호화를 jose를 통해 모듈화시켜서 사용하고있다. import { JWTPaylo.. wono | discuss | tweet + it dev nextjs build eslint eslint 적용시 이슈(rules 무시, 우선순위)👍 이번시간에는 eslint적용시 만날 수 있는 이슈와 해결방법을 알아보았다! 1. 일부 rules 무시하는 법 특정 코드에서 eslint의 rules을 무시해야할 때가 있다. 이때 우리는 파일 자체를 무시하거나, 다음 라인, 특정 범위의 코드를 무시할 수 있다. 만약 index.js의 test함수에서 no-unused-vars를 무시하고 싶다면 어떻게 해야할까? (1) 특정 파일 무시 만약 파일 차원에서 무시하려면 .eslintignore에 파일명을 추가하면 된다. 하지만 이 경우, index.js에 대해 전체 eslint를 적용하지 않는 단점이 있다. // .**eslintignore** index.js (2) 다음 라인만 무시 두 번째 방법으로 주석을 이용할 수 있다. 만약 다음 라인만 무시하고 싶.. wono | discuss | tweet + it dev nextjs build eslint How to disable typescript for failing my builds with nextjs?Getting a bunch of type errors upon running yarn next build, for example: Type error: Property 'href' does not exist on type '{ name: string; }'. Which causes my build to fail. Is there a command i... wono | discuss | tweet + it dev nextjs build eslint [Next.js 14] 프로젝트 빌드 시 발생하는 no-console 에러 해결 [ES-Lint]console.log일반적으로 JavaScript 프로그래밍 시 디버깅 목적으로 브라우저의 console.log 메서드를 자주 사용할 것이다.물론 콘솔 로그는 간편한 디버깅 도구이긴 하지만,보안 이슈가 발생할 우려가 있기에 실제로 배포되는 웹 어플리케이션에는 포함되지 않는 것이 좋다. ESLintESLint는 자바스크립트 코드에서 에러가 있는 부분에 표시를 해주는 정적 코드 분석 도구이다.일반적으로 Typescript, Prettier과 함께 웹 프로그래밍을 할 때 함께 설치되며, 코드의 퀄리티를 보장해준다.ESLint는 하나의 규칙으로 no-console 룰을 가지고 있는데,빌드(npm run build) 시 콘솔 로그가 포함되어 있을 경우 규칙 위반으로 처리하여 빌드가 정상적으로 완료되지 않는다. n.. wono | discuss | tweet + it dev nextjs jose [Next.js@13] jwt 라이브러리, jsonwebtoken 대신 jose[Next.js@13] jsonwebtoken 대신 jose Next.js에서 jwt를 생성할 때 늘 쓰던 jsonwebtoken 모듈을 시도했다. 결과는 오류! 공식 문서에 따르면 Edge 런타임은 모든 Node.js API를 지원하진 않는다고 알려준다. error - Error: The edge runtime does not support Node.js 'buffer' module. jose 그래서 대체 모듈을 찾다가 jose 라는 모듈을 찾았다. 해당 모듈은 종속성없이 작동한다. 내부에 각 모듈들은 독립적이기에 트리쉐이킹도 가능하다고한다. 지원 목록을 보면 맨 아래에 당당하게 Vercel이 있다. 현재 jwt 생성과 복호화를 jose를 통해 모듈화시켜서 사용하고있다. import { JWTPaylo.. wono | discuss | tweet + it dev nextjs jose jsonwebtoken NEXTjs (jose)next.js에서 jsonwebtoken 에러미들웨어는 노드의 런타임 기능을 사용하고 있으나 Edge 런타임은 노드 항목을 지원하지 않는다.jsonwebtoken jwt.verify(token, ); jose await jwtVerify(token, new Text wono | discuss | tweet + it dev nextjs jwt refresh [Next.JS] 사용자 인증 및 401을 위한 middleware 설정[Next.JS] 사용자 인증 및 401을 위한 middleware 설정 wono | discuss | tweet + it dev nextjs jwt Next.js 14 App Router로 JWT 기반 세션 인증 구현하기이 튜토리얼에서는 Next.js 14의 App Router를 사용해 써드파티 라이브러리 없이 JWT 기반의 세션 인증을 구현하는 방법을 다룹니다. wono | discuss | tweet + it dev nextjs nextauth 드리프트의 myCodings드리프트의 myCodings.fly.dev! wono | discuss | tweet + it dev nextjs jwt refresh [나만의 명언집 프로젝트] NextJS(^14.1) 에서 적용한 accessToken 을 이용한 토큰 인증에서 refresh + access 방식으로 수정오늘의 명언 이 포스트의 목적 더보기 이번에 약 1달의 기간동안 나만의 명언집 프로젝트에 리액트의 메타 프레임워크인 NextJS 14.1 버전을 사용하였습니다. 이 프로젝트에 로그인 인증을 구현하기 위해서 간편한 인증 라이브러리인 next-auth( → 현재는 auth.js 로 새단장중)와 같은 도구를 사용 하지 않고, 전통적인 방식의 JWT 라이브러리를 활용해서 인증을 구현하였습니다. 이 포스트의 목적은 기존 프로젝트에 적용된 jwt 인증 방식(accessToken 기반)의 보안상 문제점을 인식하고, 이를 개선하기 위해 refreshToken 을 적용하는 리팩토링 과정에서 보이는 여러 가지 문제점들을 기록하고 개선하는 모든 과정을 정리하는 것 입니다. 따라서 내용의 흐름이 부자연스러울 수 있다는 점을 .. wono | discuss | tweet + it dev nextjs mobile jwt how to handle autherization for mobile apps in next.js 14I want to create a next.js 14 app and use its api routes to connect a RN mobile app. But the thing is I am new to next.js and don't have much experience or understanding of cookies but I have worke... wono | discuss | tweet + id dev nextjs nextauthjs mobile using_nextauth_with_a_react_native_app_iosandroid wono | discuss | tweet + it dev nextjs shadcnui dialog [bug]: Sidebar on mobile requires a DialogTitle · Issue #5746 · shadcn-ui/uiDescribe the bug When I open the sidebar on mobile I get this error: hook.js:608 `DialogContent` requires a `DialogTitle` for the component to be accessible for screen reader users. If you want to hide the `DialogTitle`, you can wrap it ... wono | discuss | tweet + it dev nextjs shadcnui modal One Practical Application of Next.JS Parallel and Intercepting Routes: Better UX with Modals.I have been using Next.js for all my projects for about a year now, and there is always something new... Tagged with nextjs, learning, frontend, react. wono | discuss | tweet + it dev nextjs modal Next.js 14 강좌 6편. 인터셉팅 라우팅(Intercepting Routes)과 병렬 인터셉팅 라우팅(Parallel Intercepting Routes) 살펴보기Next.js에서 라우팅 가로채기인 인터셉팅 라우팅과 병렬 인터셉팅 라우팅에 대해 살펴보기 wono | discuss | tweet + it dev nextjs modal [Next.js] parellel routes + intercepting routes로 모달 만들기next.js app router에서 추가된 Parallel Routes와 Intercepting Routes를 이용한 모달 만들기 wono | discuss | tweet + it dev nextjs api Next.js API Routes: The Ultimate GuideLearn how to build robust, secure, and efficient API endpoints in Next.js. This comprehensive guide will walk you through the critical best practices for creating robust, secure, and efficient API endpoints in Next.js. wono | discuss | tweet + it dev nextjs request headers Routing: Middleware | Next.jsLearn how to use Middleware to run code before a request is completed. wono | discuss | tweet + it dev nextjs headers Routing: Route Handlers | Next.jsCreate custom request handlers for a given route using the Web's Request and Response APIs. wono | discuss | tweetNext
+ it dev nextjs context Next.js - 서버 컴포넌트에서 useContext() 사용하기넥스트js는 서버컴포넌트와 클라이언트 컴포넌트로 나뉘어진다 그렇기 때문에 React 기반의 훅들을 사용할 때는 한번더 생각해보아야 한다 오늘은 useContext() 를 어떻게 사용하는 지 알아볼 것이다 Next.js - 서버 컴포넌트에서 useContext() 사용하기 리액트에서 전역 변수를 전달하기 위해 redux / useContext 를 사용하였다 Next.js에서 useContext 를 사용하려고 하니 한가지 제약이 있었다 You are using createContext in a Server Component but it only works in Client Components → 바로 클라이언트 컴포넌트에서만 사용이 가능하다는 것이다 createContext in a Server Compo.. wono | discuss | tweet
+ it dev nextjs jwt jose [Next.js@13] jwt 라이브러리, jsonwebtoken 대신 jose[Next.js@13] jsonwebtoken 대신 jose Next.js에서 jwt를 생성할 때 늘 쓰던 jsonwebtoken 모듈을 시도했다. 결과는 오류! 공식 문서에 따르면 Edge 런타임은 모든 Node.js API를 지원하진 않는다고 알려준다. error - Error: The edge runtime does not support Node.js 'buffer' module. jose 그래서 대체 모듈을 찾다가 jose 라는 모듈을 찾았다. 해당 모듈은 종속성없이 작동한다. 내부에 각 모듈들은 독립적이기에 트리쉐이킹도 가능하다고한다. 지원 목록을 보면 맨 아래에 당당하게 Vercel이 있다. 현재 jwt 생성과 복호화를 jose를 통해 모듈화시켜서 사용하고있다. import { JWTPaylo.. wono | discuss | tweet
+ it dev nextjs build eslint eslint 적용시 이슈(rules 무시, 우선순위)👍 이번시간에는 eslint적용시 만날 수 있는 이슈와 해결방법을 알아보았다! 1. 일부 rules 무시하는 법 특정 코드에서 eslint의 rules을 무시해야할 때가 있다. 이때 우리는 파일 자체를 무시하거나, 다음 라인, 특정 범위의 코드를 무시할 수 있다. 만약 index.js의 test함수에서 no-unused-vars를 무시하고 싶다면 어떻게 해야할까? (1) 특정 파일 무시 만약 파일 차원에서 무시하려면 .eslintignore에 파일명을 추가하면 된다. 하지만 이 경우, index.js에 대해 전체 eslint를 적용하지 않는 단점이 있다. // .**eslintignore** index.js (2) 다음 라인만 무시 두 번째 방법으로 주석을 이용할 수 있다. 만약 다음 라인만 무시하고 싶.. wono | discuss | tweet
+ it dev nextjs build eslint How to disable typescript for failing my builds with nextjs?Getting a bunch of type errors upon running yarn next build, for example: Type error: Property 'href' does not exist on type '{ name: string; }'. Which causes my build to fail. Is there a command i... wono | discuss | tweet
+ it dev nextjs build eslint [Next.js 14] 프로젝트 빌드 시 발생하는 no-console 에러 해결 [ES-Lint]console.log일반적으로 JavaScript 프로그래밍 시 디버깅 목적으로 브라우저의 console.log 메서드를 자주 사용할 것이다.물론 콘솔 로그는 간편한 디버깅 도구이긴 하지만,보안 이슈가 발생할 우려가 있기에 실제로 배포되는 웹 어플리케이션에는 포함되지 않는 것이 좋다. ESLintESLint는 자바스크립트 코드에서 에러가 있는 부분에 표시를 해주는 정적 코드 분석 도구이다.일반적으로 Typescript, Prettier과 함께 웹 프로그래밍을 할 때 함께 설치되며, 코드의 퀄리티를 보장해준다.ESLint는 하나의 규칙으로 no-console 룰을 가지고 있는데,빌드(npm run build) 시 콘솔 로그가 포함되어 있을 경우 규칙 위반으로 처리하여 빌드가 정상적으로 완료되지 않는다. n.. wono | discuss | tweet
+ it dev nextjs jose [Next.js@13] jwt 라이브러리, jsonwebtoken 대신 jose[Next.js@13] jsonwebtoken 대신 jose Next.js에서 jwt를 생성할 때 늘 쓰던 jsonwebtoken 모듈을 시도했다. 결과는 오류! 공식 문서에 따르면 Edge 런타임은 모든 Node.js API를 지원하진 않는다고 알려준다. error - Error: The edge runtime does not support Node.js 'buffer' module. jose 그래서 대체 모듈을 찾다가 jose 라는 모듈을 찾았다. 해당 모듈은 종속성없이 작동한다. 내부에 각 모듈들은 독립적이기에 트리쉐이킹도 가능하다고한다. 지원 목록을 보면 맨 아래에 당당하게 Vercel이 있다. 현재 jwt 생성과 복호화를 jose를 통해 모듈화시켜서 사용하고있다. import { JWTPaylo.. wono | discuss | tweet
+ it dev nextjs jose jsonwebtoken NEXTjs (jose)next.js에서 jsonwebtoken 에러미들웨어는 노드의 런타임 기능을 사용하고 있으나 Edge 런타임은 노드 항목을 지원하지 않는다.jsonwebtoken jwt.verify(token, ); jose await jwtVerify(token, new Text wono | discuss | tweet
+ it dev nextjs jwt refresh [Next.JS] 사용자 인증 및 401을 위한 middleware 설정[Next.JS] 사용자 인증 및 401을 위한 middleware 설정 wono | discuss | tweet
+ it dev nextjs jwt Next.js 14 App Router로 JWT 기반 세션 인증 구현하기이 튜토리얼에서는 Next.js 14의 App Router를 사용해 써드파티 라이브러리 없이 JWT 기반의 세션 인증을 구현하는 방법을 다룹니다. wono | discuss | tweet
+ it dev nextjs jwt refresh [나만의 명언집 프로젝트] NextJS(^14.1) 에서 적용한 accessToken 을 이용한 토큰 인증에서 refresh + access 방식으로 수정오늘의 명언 이 포스트의 목적 더보기 이번에 약 1달의 기간동안 나만의 명언집 프로젝트에 리액트의 메타 프레임워크인 NextJS 14.1 버전을 사용하였습니다. 이 프로젝트에 로그인 인증을 구현하기 위해서 간편한 인증 라이브러리인 next-auth( → 현재는 auth.js 로 새단장중)와 같은 도구를 사용 하지 않고, 전통적인 방식의 JWT 라이브러리를 활용해서 인증을 구현하였습니다. 이 포스트의 목적은 기존 프로젝트에 적용된 jwt 인증 방식(accessToken 기반)의 보안상 문제점을 인식하고, 이를 개선하기 위해 refreshToken 을 적용하는 리팩토링 과정에서 보이는 여러 가지 문제점들을 기록하고 개선하는 모든 과정을 정리하는 것 입니다. 따라서 내용의 흐름이 부자연스러울 수 있다는 점을 .. wono | discuss | tweet
+ it dev nextjs mobile jwt how to handle autherization for mobile apps in next.js 14I want to create a next.js 14 app and use its api routes to connect a RN mobile app. But the thing is I am new to next.js and don't have much experience or understanding of cookies but I have worke... wono | discuss | tweet
+ id dev nextjs nextauthjs mobile using_nextauth_with_a_react_native_app_iosandroid wono | discuss | tweet
+ it dev nextjs shadcnui dialog [bug]: Sidebar on mobile requires a DialogTitle · Issue #5746 · shadcn-ui/uiDescribe the bug When I open the sidebar on mobile I get this error: hook.js:608 `DialogContent` requires a `DialogTitle` for the component to be accessible for screen reader users. If you want to hide the `DialogTitle`, you can wrap it ... wono | discuss | tweet
+ it dev nextjs shadcnui modal One Practical Application of Next.JS Parallel and Intercepting Routes: Better UX with Modals.I have been using Next.js for all my projects for about a year now, and there is always something new... Tagged with nextjs, learning, frontend, react. wono | discuss | tweet
+ it dev nextjs modal Next.js 14 강좌 6편. 인터셉팅 라우팅(Intercepting Routes)과 병렬 인터셉팅 라우팅(Parallel Intercepting Routes) 살펴보기Next.js에서 라우팅 가로채기인 인터셉팅 라우팅과 병렬 인터셉팅 라우팅에 대해 살펴보기 wono | discuss | tweet
+ it dev nextjs modal [Next.js] parellel routes + intercepting routes로 모달 만들기next.js app router에서 추가된 Parallel Routes와 Intercepting Routes를 이용한 모달 만들기 wono | discuss | tweet
+ it dev nextjs api Next.js API Routes: The Ultimate GuideLearn how to build robust, secure, and efficient API endpoints in Next.js. This comprehensive guide will walk you through the critical best practices for creating robust, secure, and efficient API endpoints in Next.js. wono | discuss | tweet
+ it dev nextjs request headers Routing: Middleware | Next.jsLearn how to use Middleware to run code before a request is completed. wono | discuss | tweet
+ it dev nextjs headers Routing: Route Handlers | Next.jsCreate custom request handlers for a given route using the Web's Request and Response APIs. wono | discuss | tweet