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

[Mission5/김지성] Project_Notion_VanillaJs 과제 #60

Open
wants to merge 1 commit into
base: 4/#5_jisung
Choose a base branch
from

Conversation

jisung24
Copy link
Member

📌 과제 설명

바닐라 JS만을 이용해 노션을 클로닝합니다.

기본적인 레이아웃은 노션과 같으며, 스타일링, 컬러값 등은 원하는대로 커스텀합니다.

  • 기능을 우선 다 완성한 후 스타일링 하려합니다.

✔️ 화면 좌측에 Root Documents를 불러오는 API를 통해 루트 Documents를 렌더링합니다.
✔️Root Document를 클릭하면 오른쪽 편집기 영역에 해당 Document의 Content를 렌더링합니다.

✔️ 해당 Root Document에 하위 Document가 있는 경우, 해당 Document 아래에 트리 형태로 렌더링 합니다.

✔️ Document Tree에서 각 Document 우측에는 + 버튼이 있습니다. 해당 버튼을 클릭하면, 클릭한 Document의 하위 Document로 새
Document를 생성하고 편집화면으로 넘깁니다.

편집기에는 기본적으로 저장 버튼이 없습니다. Document Save API를 이용해 지속적으로 서버에 저장되도록 합니다.

✔️ History API를 이용해 SPA 형태로 만듭니다.

✔️ 루트 URL 접속 시엔 별다른 편집기 선택이 안 된 상태입니다.

✔️ /documents/{documentId} 로 접속시, 해당 Document 의 content를 불러와 편집기에 로딩합니다.

👩‍💻 요구 사항과 구현 내용

✅ 피드백 반영사항

✅ PR 포인트 & 궁금한 점

  • 개인사정으로 너무 늦어졌습니다...
  • 최대한 빨리 나머지 기능 완성하고 스타일링까지 끝내겠습니다.

Copy link

@JunilHwang JunilHwang left a comment

Choose a reason for hiding this comment

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

아직 완성이 덜 된 것 같네요 ㅋㅋㅋ 다 되면 다시 보러 올게요!

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./src/styles/App.css">
<script src="./src/main.js" type="module"></script>

Choose a reason for hiding this comment

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

이 script 태그가 head에 있는 것과 body에 있는 것
어떤 차이가 있을까요?
차이가 있다면 어떤 차이가,
차이가 없다면 왜 차이가 없는지?

Comment on lines +3 to +4
const VITE_API_END_POINT = "https://kdt-frontend.programmers.co.kr";
const VITE_USERNAME = "jisungkim";

Choose a reason for hiding this comment

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

VITE 라는 prefix가 붙은 이유가 있을까요?

Comment on lines +14 to +16
if (res.ok) {
return await res.json();
}

Choose a reason for hiding this comment

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

여기서 await을 쓰고 안 쓰고가 어떤 차이가 있을까요?

Comment on lines +8 to +12
...options,
headers: {
"Content-Type": "application/json",
"x-username": `${VITE_USERNAME}`,
},

Choose a reason for hiding this comment

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

options가 headers 속성을 가지고 있다고 가정해본다면, 여기서 headers를 덮어쓰게 되지 않을까요?
그렇다면 options의 headers와 여기 내부에 있는 headers를 같이 혼용해서 쓰고 싶다면 어떻게 해야 좋을까요?

...options,
headers: {
"Content-Type": "application/json",
"x-username": `${VITE_USERNAME}`,

Choose a reason for hiding this comment

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

여기서 바로 username을 넘겨주기보단, 바깥에서 username을 받아와서 넘겨주도록 해주면 어떨까요? 그래야 request가 더 범용적으로 쓰일 수 있을 것 같아요!

가령, 우리팀 모든 사람들의 문서를 가져오고 싶다면?

이라는 가정을 해보는거죠 ㅋㅋ

Comment on lines +6 to +7
import DocumentHeader from "./DocumentHeader.js";
import DocumentList from "./DocumentList.js";

Choose a reason for hiding this comment

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

이 부분도 앞선 리뷰를 토대로 index.js 같은걸로 묶어줄 수 있을 것 같아요~

여기서 중요한게 components 내에서도 계층 구조를 가질 수 있지 않을까 고민해보면 좋답니다!

Comment on lines +48 to +53
pageRender: async (id) => {
// api요청!
const nextState = await getDocument(id);
console.log(nextState);
// 데이터를 받아온다.!!! => 이 데이터를 이제 documentpage에 꽂아주면 돼!
},

Choose a reason for hiding this comment

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

받아오기만 하고 있네요!?

Comment on lines +21 to +25
this.render = async () => {
sideBar.render(); // home안에다가 넣고
edit.render(); // home안에다가 넣고
$target.appendChild($document); // home을 #app안에다가 넣는다.
};

Choose a reason for hiding this comment

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

이러면 render를 할 때 마다 $target에 $document가 추가되지 않을까요?

Comment on lines +3 to +4
import DocumentEdit from "../components/DocumentEdit.js";
import DocumentSidebar from "../components/DocumentSidebar.js";

Choose a reason for hiding this comment

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

여기도 앞선 리뷰를 토대로 개선해볼 수 있겠죠!?

@@ -0,0 +1,21 @@
import DocumentEdit from "../components/DocumentEdit.js";
import DocumentSidebar from "../components/DocumentSidebar.js";

Choose a reason for hiding this comment

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

여기도 동일합니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants