From c84b37dcc286343951e19e35cca0989ba41b53bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaeuk=20Lim=28=EC=9E=84=EC=9E=AC=EC=9A=B1=29?= Date: Tue, 1 Apr 2025 23:15:07 +0900 Subject: [PATCH 1/4] docs: add contribution md --- CONTRIBUTING.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f10c351 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,55 @@ +# Contributing + +We welcome contribution from everyone. + +## Issues + +You can contribute to this repository + +- Improving our [docs](https://mugglim.github.io/build-your-own-tanstack-query/). +- Improving our [tanstack-query-lite](../tanstack-query-lite/) features. + +## Get started + +### Installation + +Please follow these steps to get started: + +- Fork and clone this repository + + ``` + cd build-your-own-tanstack-query + ``` + +- Install package + ``` + npm install + ``` + +### Run docs dev server + +``` +npm run docs:dev +``` + +### Run dev server + +``` +npm run dev +``` + +## Pull Requests + +We merge pull requests by squashing all commits. +Please ensure your PR template titles match the example below. + +``` +: +``` + +`type` must be one of the following: + +- `feat`: A new tanstack-query-lite feature. +- `docs`: Documentation only changes. +- `fix`: A bug fix +- `chore`: Anything else From ed6f394822d1b685b8c945c10d60c43f59c83716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaeuk=20Lim=28=EC=9E=84=EC=9E=AC=EC=9A=B1=29?= Date: Tue, 1 Apr 2025 23:15:45 +0900 Subject: [PATCH 2/4] docs: improve format --- README.md | 29 +++++++++-------------------- en.md | 46 ++++++++++++++++++++++------------------------ 2 files changed, 31 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 7034646..4f5ce9f 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,18 @@ -
-

Build Your Own TanStack Query and useQuery

-
+# Build Your Own TanStack Query -

- 한국어 | English -

+한국어 | English ## Introduction -We're going to rewrite TanStack Query and useQuery from scratch. We'll be using the ideas and code from [Let's Build React Query in 150 Lines of Code!](https://www.youtube.com/watch?v=9SrIirrnwk0) and TanStack Query v5. +We're going to rewrite TanStack Query and useQuery from scratch. +We'll be using the ideas and code from [Let's Build React Query in 150 Lines of Code!](https://www.youtube.com/watch?v=9SrIirrnwk0) and TanStack Query v5. -## Play Locally - -Install package - -``` -npm install -``` +## Demo -Run development server +https://github.com/user-attachments/assets/11454b80-034a-4205-b051-5a3c78f1b9d0 -``` -npm run dev -``` +## Contributing -## Demo +We welcome contribution from everyone. Read below for contributing guidelines. -https://github.com/user-attachments/assets/11454b80-034a-4205-b051-5a3c78f1b9d0 +[CONTRIBUTING](/CONTRIBUTING.md) diff --git a/en.md b/en.md index 800704b..e6d7499 100644 --- a/en.md +++ b/en.md @@ -1,14 +1,11 @@ -
-

Build Your Own TanStack Query and useQuery

-
+# Build Your Own TanStack Query and useQuery -

- 한국어 | English -

+한국어 | English ## Introduction -We're going to rewrite TanStack Query and useQuery from scratch. We'll be using the ideas and code from [Let's Build React Query in 150 Lines of Code!](https://www.youtube.com/watch?v=9SrIirrnwk0) and TanStack Query v5. +We're going to rewrite TanStack Query and useQuery from scratch. +We'll be using the ideas and code from [Let's Build React Query in 150 Lines of Code!](https://www.youtube.com/watch?v=9SrIirrnwk0) and TanStack Query v5. > [!WARNING] > @@ -21,23 +18,24 @@ We're going to rewrite TanStack Query and useQuery from scratch. We'll be using ## TOC -- [Introduction](#introduction) -- [TOC](#toc) -- [Play Locally](#play-locally) -- [Architecture](#architecture) -- [Step 1: Core Implementation](#step-1-core-implementation) - - [QueryClient](#queryclient) - - [QueryCache](#querycache) - - [Query](#query) - - [QueryObserver](#queryobserver) -- [Step 2: Integration with React](#step-2-integration-with-react) - - [Trigger re-render when the state of Query changes](#trigger-re-render-when-the-state-of-query-changes) - - [QueryClientProvider](#queryclientprovider) - - [useQuery](#usequery) -- [Step 3: Additional Features](#step-3-additional-features) - - [1. Trigger refetch when the browser’s focus state changes](#1-trigger-refetch-when-the-browsers-focus-state-changes) - - [2. Creating a developer tool like ReactQueryDevtools](#2-creating-a-developer-tool-like-reactquerydevtools) -- [Reference](#reference) +- [Build Your Own TanStack Query and useQuery](#build-your-own-tanstack-query-and-usequery) + - [Introduction](#introduction) + - [TOC](#toc) + - [Play Locally](#play-locally) + - [Architecture](#architecture) + - [Step 1: Core Implementation](#step-1-core-implementation) + - [QueryClient](#queryclient) + - [QueryCache](#querycache) + - [Query](#query) + - [QueryObserver](#queryobserver) + - [Step 2: Integration with React](#step-2-integration-with-react) + - [Trigger re-render when the state of Query changes](#trigger-re-render-when-the-state-of-query-changes) + - [QueryClientProvider](#queryclientprovider) + - [useQuery](#usequery) + - [Step 3: Additional Features](#step-3-additional-features) + - [1. Trigger refetch when the browser’s focus state changes](#1-trigger-refetch-when-the-browsers-focus-state-changes) + - [2. Creating a developer tool like ReactQueryDevtools](#2-creating-a-developer-tool-like-reactquerydevtools) + - [Reference](#reference) ## Play Locally From 1100fb78e048a4bcf7c73ecf8dffb64c0ad930c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaeuk=20Lim=28=EC=9E=84=EC=9E=AC=EC=9A=B1=29?= Date: Tue, 1 Apr 2025 23:15:59 +0900 Subject: [PATCH 3/4] docs: remove unused file --- .github/PULL_REQUEST_TEMPLATE.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 50958f1..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,3 +0,0 @@ -## Description - -## Changes From e048f96c97f1249c6063002e8afa5259ffc743bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaeuk=20Lim=28=EC=9E=84=EC=9E=AC=EC=9A=B1=29?= Date: Tue, 1 Apr 2025 23:19:32 +0900 Subject: [PATCH 4/4] docs: change link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f10c351..00f0696 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ We welcome contribution from everyone. You can contribute to this repository - Improving our [docs](https://mugglim.github.io/build-your-own-tanstack-query/). -- Improving our [tanstack-query-lite](../tanstack-query-lite/) features. +- Improving our [tanstack-query-lite](https://github.com/mugglim/build-your-own-tanstack-query/tree/chore/add-contributing/tanstack-query-lite) features. ## Get started