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

github_start_9 최진영 과제 제출합니다. #2

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

joi0104
Copy link
Member

@joi0104 joi0104 commented Apr 1, 2020

vue 환경에서 개발하였습니다.

실행은 node가 깔린 환경에서 npm install로 setup을 해주신 뒤에,

npm run serve를 통해 실행하시면 됩니다!

vue의 렌더링 매커니즘이나 반응형에 대한 지식이 미흡하여 속도가 조금 느린 결함이 존재합니다 ㅠ

Copy link
Member

@lallaheeee lallaheeee left a comment

Choose a reason for hiding this comment

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

뷰는 정말 신기한 거같아요! 덕분에 뷰 코드도 읽어보네요 ㅎㅎ 고생하셨습니다 🤩

Comment on lines 36 to 42
.then((res) => {
this.isFetchSuccess = true;
this.repoNameList = [];
res.data.forEach((element) => {
this.repoNameList.push(element.name);
});
})
Copy link
Member

Choose a reason for hiding this comment

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

제가 vue는 잘 모르지만 아래는 어떠나유?! ㅎㅎ

Suggested change
.then((res) => {
this.isFetchSuccess = true;
this.repoNameList = [];
res.data.forEach((element) => {
this.repoNameList.push(element.name);
});
})
.then(({data: repos}) => {
this.isFetchSuccess = true;
this.repoNameList = repos.map(repo => repo.name);
})

"eslintConfig": {
"root": true,
"env": {
"node": true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"node": true
"browser": true

가 되어야할 것 같아요! ㅎㅎ

Copy link
Member Author

Choose a reason for hiding this comment

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

오오 감사합니다!

<p>{{ totalRepoStarCount }} stars</p>
</div>
<hr>
<p v-if="isEmptyRepoList">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<p v-if="isEmptyRepoList">
<p v-if="!totalRepoCount">

사소한건데 이렇게 바꾸면 isEmptyRepoList를 줄일 수 있을 것 같아요! ㅎㅎ

Copy link
Member Author

Choose a reason for hiding this comment

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

오 감사합니다!

Comment on lines +67 to +68
.then((res) => {
this.repoList = res.data;
Copy link
Member

Choose a reason for hiding this comment

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

response가 꽤 길던데 메모리 사용을 줄이기 위해 필요한 데이터만 한번 추출하면 어떨까요?! ㅎㅎ

Copy link
Member Author

Choose a reason for hiding this comment

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

메모리는 미쳐 생각하지 못했네요 ㅎㅎ 감사합니다!

<repo-list-item
v-else
v-for="(repoListItem,idx) in repoList"
:key="idx"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
:key="idx"
:key="repoListItem.id"

는 어떠신가요?! ㅎㅎ

https://kr.vuejs.org/v2/guide/list.html#Maintaining-State

#repoList {
width: 500px;
}
#totalCount p{
Copy link
Member

Choose a reason for hiding this comment

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

스타일 설정을 위해 id를 부여하고 사용하신 이유가 있을까요?!

Copy link
Member Author

Choose a reason for hiding this comment

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

id로 접근해서 스타일을 설정하는 방식이 편해서 그런식으로 진행했었는데요. 다른 좋은 방법이 있을까요? 안그래도 id 지을때마다 힘들었었거든요 ㅎㅎ

Copy link

Choose a reason for hiding this comment

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

찾아보니 vue에도 styled-components가 있네요! 사용해보셔도 괜찮을듯해요

},
methods: {
fecthUserName() {
this.$http.get(`https://api.github.com/users/${this.userName}`)
Copy link
Member

Choose a reason for hiding this comment

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

username을 한번 검색한 후에 repo를 검색하는 이유가 있을까요?! !

Copy link
Member Author

Choose a reason for hiding this comment

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

유효한 username인지 확인하는 과정을 거쳤습니다. 검색한 username이 git 유저에 등록되어있지 않다면, 유효하지 않는 name이라는 안내창을 띄워줍니다!

Copy link

Choose a reason for hiding this comment

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

섬세하네요!

Comment on lines +5 to +7
<p>{{ totalRepoCount }} repositories</p>
<p>|</p>
<p>{{ totalRepoStarCount }} stars</p>

Choose a reason for hiding this comment

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

p태그마다 margin을 주기위한 의도였다면 상위 div를 flex로 주시고 Template Literal로 감싸줘도 좋을 것 같습니다 👍
#totalCount { display: flex; justify-content: space-between; //space-around; }

Suggested change
<p>{{ totalRepoCount }} repositories</p>
<p>|</p>
<p>{{ totalRepoStarCount }} stars</p>
<p>${ totalRepoCount } repositories | ${ totalRepoStarCount } star</p>

Copy link
Member Author

Choose a reason for hiding this comment

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

헛 그러네요 ㅎㅎ 왜 저땐 저생각을 못했을까요...? 감사합니다 ㅎㅎ

Comment on lines +49 to +53
totalRepoStarCount() {
return this.repoList
.map((element) => element.stargazers_count, [])
.reduce((x, y) => x + y, 0);
},

Choose a reason for hiding this comment

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

이런식으로 간소화 할수 있을거 같습니다!

Suggested change
totalRepoStarCount() {
return this.repoList
.map((element) => element.stargazers_count, [])
.reduce((x, y) => x + y, 0);
},
totalRepoStarCount() {
return this.repoList
.reduce((x, y) => x + y.stargazers_count, 0);
},

Copy link
Member Author

Choose a reason for hiding this comment

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

return this.repoList
  .reduce((accumulator, currentValue) => accumulator + currentValue.stargazers_count, 0);

이런식으로 수정하도록 하겠습니다! 감사합니다 ㅎㅎ

Copy link

@YukJiSoo YukJiSoo left a comment

Choose a reason for hiding this comment

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

자바스크립트도 알기전에 처음 접한게 vue였는데 이렇게 다시 vue 코드를 보게 될 줄 몰랐어요ㅋㅋㅋ
재밌었어요ㅎㅎ

@@ -0,0 +1,83 @@
{

Choose a reason for hiding this comment

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

package.json에 eslint, browseList, jest 관련 설정이 모두 포함되어 있는 것을
별도의 파일로 분리하면 어떨까요?

설정파일도 목적별로 분리하면 유지보수하기도 좋고 관심사 분리도 되어서 좋다고 생각해요!

Choose a reason for hiding this comment

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

저도 동의합니다. 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

오오 그러네요... 참고하도록 하겠습니다!

},
methods: {
onSubmit(evt) {
this.$router.push(`/${this.userName}`);

Choose a reason for hiding this comment

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

username 검색을 path에 추가해서 routing하는 식으로 구현하신 이유가 있나요?? 궁금해요!

Copy link
Member Author

Choose a reason for hiding this comment

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

이번에 네스티드 라우터를 써보고 싶어서 path를 추가하는 방식으로 구현을 해봤습니다 ㅎㅎ

new Vue({
router,
store,
render: (h) => h(App),

Choose a reason for hiding this comment

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

h는 어떤 의미가 있는건가요?? convention 같은 건가요??

Choose a reason for hiding this comment

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

저도 궁금합니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

이 부분은 처음에 뷰 프로젝트를 진행할 때 필요한 설정들을 자동으로 해주는 vue-cli가 자동으로 생성해줬던 부분이라 ㅎㅎ 위 코드에 대해서 자세히 보지는 못했네요 ㅎㅎ 저도 궁금해지는데.. 찾아보고 다시 리뷰 달도록 하겠습니다!

Copy link

@eastroots92 eastroots92 left a comment

Choose a reason for hiding this comment

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

뷰 신기하네요

@@ -0,0 +1,83 @@
{

Choose a reason for hiding this comment

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

저도 동의합니다. 👍

Comment on lines +9 to +15
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

Choose a reason for hiding this comment

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

위에 코드와 중복되는 것 같은데 의도하신 것이 맞을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

엇.. 그러네요! 수정하도록 하겠습니다!

@@ -0,0 +1,84 @@
<template>
<div id="repoList">

Choose a reason for hiding this comment

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

Suggested change
<div id="repoList">
<article id="repoList">

사실 vue 알 못 이라.
하이라키가 명확히 그려지진 않아, 적절한 semantic tag 부여인진 모르겠는데,

PC 페이지로 만들어지는 만큼 semantic tag들을 챙겨주시면 더 좋을 것 같습니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

그러네요! 개발하면서 시멘틱태그를 미쳐 신경쓰지 못했네요 감사합니다!

totalRepoStarCount() {
return this.repoList
.map((element) => element.stargazers_count, [])
.reduce((x, y) => x + y, 0);

Choose a reason for hiding this comment

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

정말 사소한 개인 피드백인데
reduce의 경우엔 js에서 기본적으로 내장된 함수여서 다른 분들이 쉽게 params 값들을 유추 할 수있을 듯 하나,
그럼에도 불구하고 최소한의 의미 부여를 하는 것은 어떻게 생각하세요?

Suggested change
.reduce((x, y) => x + y, 0);
.reduce((accumulator, currentValue) => accumulator + currentValue, 0);

Copy link

Choose a reason for hiding this comment

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

좋은 방법이라고 생각해요!

Copy link
Member Author

Choose a reason for hiding this comment

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

좋은거 같아요! 수정하도록 하겠습니다 ㅎㅎ

};
</script>

<style scoped>

Choose a reason for hiding this comment

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

lint 룰에서 space 2 였던 것 같은데

해당 부분에 space 4로 되어있는 것 같습니다! 의도하신 것이 맞을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

그러네요! css indent를 신경못쓰고 있었네요! 탭을 누르는 습관때문에.. 이렇게 습관이 무섭네요.. 수정하도록 하겠습니다 ㅎㅎ

new Vue({
router,
store,
render: (h) => h(App),

Choose a reason for hiding this comment

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

저도 궁금합니다!

#repoStar{
display: inline-block;
width: 10%;
font-size: 20px;

Choose a reason for hiding this comment

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

em과 px가 혼재되어있는데
어떤 기준으로 구분하여 사용하고 있는지 알 수 있을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

이 부분은 수정하다가 못바꿨던 부분이었네요 ㅎㅎ 의도했던건 px와 %만 사용하려고 했습니다 ㅎㅎ 수정하도록 할께요!

Copy link

@rdd9223 rdd9223 left a comment

Choose a reason for hiding this comment

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

뷰.js 는 처음봐서 정말 신기했어요 ㅋㅋㅋ
새로운 접근이라 재밌었습니다!!!

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
Copy link

Choose a reason for hiding this comment

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

동근님이 다른 리뷰에서 말씀하셨던 부분인긴 한데 여기 lang를 ko로 바꾸면 좋을거 같아요 ㅎㅎ

Copy link
Member Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants