Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] on demand revalidate api #224

Merged
merged 5 commits into from
Jul 22, 2023

Conversation

itjustbong
Copy link
Contributor

Description

  • on demand revalidate api 추가 관련 링크
  • nextJS 12 버전 -> 13 업그레이드
  • 초기 revalidate time 1s -> 7d 변경

Related tickets

none

PR Checklist

@vercel
Copy link

vercel bot commented Jul 2, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @morethanmin on Vercel.

@morethanmin first needs to authorize it.

src/components/PostCard.tsx Show resolved Hide resolved
site.config.js Show resolved Hide resolved
if (path && typeof path === "string") {
await res.revalidate(path)
} else {
const posts = await getPosts()
Copy link
Contributor Author

@itjustbong itjustbong Jul 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 부분에서 시간이 오래 걸려 종종 타임아웃이 발생하는데, 크리티컬한 이슈가 아니라고 생각해서 우선 그대로 뒀습니다.

해결책으로는 edge 런타임을 활용해보고자 합니다.
다만, 현재 상황에서 edge 런타임을 바로 적용하면 Cannot read properties of undefined(reading 'node') 에러가 발생해서 해결책을 찾는 중입니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edge runtime에서 revalidate API를 제공하지 않는 것 같습니다ㅠㅠ

기존 런타임으로 돌리면 타임아웃이 발생하고,
edge 런타임에서는 아직 revalidate API를 사용할 수 없는 것 같은데,
혹시 @morethanmin 님께서 좋은 방법을 알고 계실까요...🥲

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itjustbong

안녕하세요. 혹시 타임아웃이 발생하는 경우에 대해서 좀 더 설명해주실 수 있을까요? 제가 테스트 했을 땐 발생하는 경우가 없었습니다. (데이터 크기의 차이일 수도 있을 것 같습니다)

그리고 관심 갖고 PR주셔서 감사합니다 ㅎㅎ. 아직 고칠 부분이 너무 많은데... 저도 좀 더 업데이트 해보겠습니다 😅

Copy link
Contributor Author

@itjustbong itjustbong Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@morethanmin

안녕하세요!
우선 PR 확인해주셔서 감사드립니다.

제가 테스트 해봤을 때는 타임아웃이 가끔 발생하는데 아마 데이터 양의 차이일 것 같다는 생각이 듭니다.
만약에 에러가 발생한다면 하기와 같이 에러로 뜹니다.
스크린샷 2023-07-10 오후 4 33 06

하기 링크에서 직접 테스트를 해보실 수도 있을 것 같습니다!

확인 부탁드리며, 저도 morethanmin 님 덕분에 포폴 사이트 조금조금 완성해 나가고 있습니다!
앞으로 필요한 업데이트 사항 이슈등에 공유해주시면 저도 같이 개발해보겠습니다 🙂

Copy link
Owner

@morethanmin morethanmin Jul 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

공유 감사합니다. 그러네요.. 일단 올려두고 데이터가 많을 때 timeout 발생하는 부분은 별도 이슈로 만들어두면 좋을 것 같습니다. 항상 감사합니다!

@itjustbong itjustbong marked this pull request as ready for review July 2, 2023 11:26
@morethanmin morethanmin self-requested a review July 3, 2023 01:18
@vercel
Copy link

vercel bot commented Jul 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
morethan-log ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2023 1:52pm

@morethanmin morethanmin merged commit 60d9965 into morethanmin:main Jul 22, 2023
gusleyva added a commit to gusleyva/c4cydonia-vercel-blog that referenced this pull request Dec 17, 2023
* feat: update favicon and icon

* adding post author  (morethanmin#41)

* feat: update typescript

* fix: build error

* refactor: refactoring code

* refactor: refactoring code

* chore: update config

* chore: update README.md

* feat: updating author property

* Adding mobile profile section, Updating README (morethanmin#44)

* refactor: refactoring code

* refactor: refactoring code

* feat: adding responsive profile component

* fix: disable profile info

* feat: add bio and role

* chore: update README.md

* feat: mobile view

* feat: darkmode color

* chore: update config

* chore: update config

* Adding Post Custom Thumbnail (morethanmin#56)

* refactor: refactoring code

* refactor: refactoring code

* feat: adding responsive profile component

* fix: disable profile info

* feat: add bio and role

* chore: update README.md

* feat: mobile view

* feat: darkmode color

* fix: setting orderby variable

* feat: add thumbnail

* fix: build error

* fix: build error

* Adding Error Page, Fixing Some Issue (morethanmin#63)

* feat: add profile in post card component

* feat: style post header

* fix: updating profile_photo undefind check

* feat: adding 404 page

* feat: adding thumbnail in post detail page

* fix: using default next image loader

* fix: fixing user name issue

* Workflow Changes + Refactoring (morethanmin#67)

* feat: add prettier config file

* refactor: Move config files to site.config

* feat: Updated the Pull request template

* feat: Add Bug report Form

* feat: Updated the bug_report template

* feat: Updated code of conduct

* feat: Updated Contributing Docs

* feat: update Pull Request template

* fix: adding image domain (morethanmin#71)

* [Fix] notion-toggle 내부 element overflow 해결 (morethanmin#68)

* Bugfix: notion-toggle 내부 element overflow 해결

* Refactor: delete useless important

* [DOCUMENTATION] Documentation Updates (morethanmin#73)

* chore: move 2 files, update 2 files and delete 1 file

* docs: update PULL_REQUEST_TEMPLATE.md

* feat: update Footer.tsx

* feat: support mermaid digram  close morethanmin#77 (morethanmin#78)

* [REFACTOR] refactoring code (morethanmin#79)

* refactor: adding mermaid hook

* refactor: adding some type, refactoring get post

* chore: update config

* refactor: refactoring detail page

* feat: changing font (morethanmin#80)

* [UPDATE] tailwind.config.js (morethanmin#84)

* chore: update document

* chore: add contributors and sponsors

* docs: add contributors

* [FIX] no notion profile photo error (morethanmin#97)

* fix: no notion profile photo error (morethanmin#91)

* chore: change profile image src path to const

* docs: update contributors

* docs: update FUNDING.yml

* [FEAT] add cusdis comment support (morethanmin#103)

* feat: add cusdis feature

* docs: add cusdis to readme

* docs: update contributors

* fix: make cusdis theme same to blog theme (morethanmin#107)

* fix not applied fonts "Pretendard" (morethanmin#114)

* docs: update contributors

* typo: fix typo (morethanmin#120)

* docs: update contributors

* [FEAT] add "category" property (morethanmin#122)

* feat: add category

* feat: update coloring logic

* fix: update tailwind

* fix: add category readOnly props

* feat: add category inputs

* fix: category ui issue

* fix: typo

* [FIX] category overflow issue (morethanmin#123)

* feat: add category

* feat: update coloring logic

* fix: update tailwind

* fix: add category readOnly props

* feat: add category inputs

* fix: category ui issue

* fix: typo

* fix: navbar z-index

* fix: fix typo (TPostStatus) (morethanmin#132)

* fix: table notion overflow on mobile (morethanmin#144)

* docs: update contributors

* change to overflow auto (morethanmin#145)

* Fix:google analytics not working even though I have add ga id correctly (morethanmin#146)

* rename all env use in next build to NEXT_PUBLIC_

* fix document

* feat: ✨ adding sticky section (morethanmin#163)

* chore: 📦 update notion-client (morethanmin#171)

* [FEAT] react notion x 및 NotionRender 업데이트 (morethanmin#174)

* Feat: getPosts 요청 감소 로직 추가

* Feat: react-notion-x 업데이트 및 NotionRederer 수정

* build: 📦 update package

* feat: ✨ update background color

* [FIX] Notion Token Error (morethanmin#185)

* feat: add `index.d.ts` to declare `prismjs`

* feat: add code token recognition for multiple languages

* chore: add contributor

* chore: fix readme.md

* Update README.md (morethanmin#199)

Add user guide in english

* fix: fix serviceCard (morethanmin#238)

* chore: update readme.md

* [Feat] on demand revalidate api (morethanmin#224)

* feat: upgrade next, react, react-dom

* fix: remove a tag in link tag

- for next13

* chore: revalidateTime to confing

* feat: on demand revalidate api 추가

* doc: revalidate api 설명 주석 추가

* [FEAT] migrate emotion to tailwind (morethanmin#246)

* feat: update next.js

* feat: install emotion

* feat: convert layout style

* refactor: rename containers folder

* feat: convert category css

* feat: convert feed, taglist style

* feat: convert MobileProfileCard style

* feat: convert feed style

* feat: convert feed page style

* feat: ✨ remove tailwind

* feat: ✨ add themeProvider

* refactor: refactor structure

* refactor: refactor structure

* feat: darkmode

* feat: update theme

* fix: fix build error

* fix: fix post card ui (morethanmin#247)

* fix: fix comment darkmode (morethanmin#248)

* fix: fix tag background color

* fix: refactor comment box

* feat: improve notion css

* refactor: refactor error page

* refactor: refactor api

* refactor: ♻️ update meta config

* feat: refactoring ssr using react query

* fix: fix build error

* fix: remove console.log

* fix: set queryKey argument

* fix: fix default category not visible

* fix: fix type error

* feat: update feed ui

* feat: change utterances value

* FIX :: color set code to use record

* fix: change utterances value (morethanmin#271)

* docs: update readme.md

* docs: update README.md

* chore: update README.md

* feat: naver site verification

* Update site.config.js

* revert site.config.js

* clarification to README.md

* 20231217 - Download latest updates

---------

Co-authored-by: front_이상민 <[email protected]>
Co-authored-by: Lee Sang Min <[email protected]>
Co-authored-by: Vaishak Kaippanchery <[email protected]>
Co-authored-by: JaeSang1998 <[email protected]>
Co-authored-by: Obaid Al Teneiji <[email protected]>
Co-authored-by: Jinhwan Kim <[email protected]>
Co-authored-by: morethanmin <[email protected]>
Co-authored-by: itjustbong <[email protected]>
Co-authored-by: 도다 <[email protected]>
Co-authored-by: lisiver <[email protected]>
Co-authored-by: Octoping <[email protected]>
Co-authored-by: Octoping <[email protected]>
Co-authored-by: linnil <[email protected]>
Co-authored-by: 홍승현 <[email protected]>
Co-authored-by: halang <[email protected]>
Co-authored-by: SEOKKAMONI <[email protected]>
Co-authored-by: Randall <[email protected]>
Co-authored-by: Yongjun Cho <[email protected]>
Co-authored-by: Evelyn Gaskin <[email protected]>
Co-authored-by: Gustavo Leyva <[email protected]>
cheongsan pushed a commit to cheongsan/blog that referenced this pull request Dec 12, 2024
* feat: upgrade next, react, react-dom

* fix: remove a tag in link tag

- for next13

* chore: revalidateTime to confing

* feat: on demand revalidate api 추가

* doc: revalidate api 설명 주석 추가
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants