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: Embeing GitHub Discussions into Frontend Fundamentals #167

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Kimbangg
Copy link
Member

@Kimbangg Kimbangg commented Feb 25, 2025

📝 Key Changes

  • Embed GitHub Discussions into Frontend Fundamentals.
    • Phase 1: Enable discussion viewing, including filtering, sorting, and pagination.
    • Phase 2: Provide detailed discussion views and allow users to create new discussions.

🖼️ Before and After Comparison

조회 기능

@Kimbangg Kimbangg requested a review from milooy February 25, 2025 12:46
Copy link

vercel bot commented Feb 25, 2025

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

Name Status Preview Comments Updated (UTC)
frontend-fundamentals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2025 7:47am

Copy link
Collaborator

@milooy milooy left a comment

Choose a reason for hiding this comment

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

Looks perfect for the MVP!

Comment on lines 171 to 173
text: "디스커션 보기",
link: "/code/dicussions/table"
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about adding 'community' to path?
e.g "/code/community/dicussions/table"

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I Will Change Category Name 💯

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that there appears to be a small typo in the path. The current spelling is dicussions, but I believe the correct spelling should be discussions. Also, it seems the folder path code/dicussions would need to be updated to code/discussions!

Copy link
Member Author

Choose a reason for hiding this comment

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

sortField,
sortDirection,
handleSort
} = useGithubDiscussions(props.owner, props.repo, {
Copy link
Collaborator

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.

this.props is passed by component.
do you think this way is dangerous 👀 ?

<GithubDiscussions owner="toss" repo="frontend-fundamentals"  />

api/github.js Outdated
Comment on lines 1 to 22
export default async function handler(req, res) {
const { query, variables } = req.body || {};

if (!query) {
return res.status(400).json({ error: 'Missing "query" in request body' });
}

const GITHUB_ACCESS_TOKEN = process.env.READ_GITHUB_DISCUSSION_ACCESS_TOKEN;

if (!GITHUB_ACCESS_TOKEN) {
return res.status(500).json({ error: "Missing API Key" });
}

return fetch("https://api.github.com/graphql", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${GITHUB_ACCESS_TOKEN}`
},
body: JSON.stringify({ query })
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

But doesn't it reveals token on the network tab?

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand that if I use a serverless function, only the response provided by the Vercel server is exposed. 👀

<a :href="discussion.url" target="_blank">{{
discussion.title
}}</a>
<span v-if="discussion.closed" class="closed-badge">닫힘</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about using other word? e.g...

  • 완료
  • 정리 완료
  • 🎯 마무리된 토론

Copy link
Member Author

Choose a reason for hiding this comment

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

"🎯 마무리된 토론" 👍

Copy link
Member Author

@Kimbangg Kimbangg Mar 1, 2025

Choose a reason for hiding this comment

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

Copy link
Member Author

@Kimbangg Kimbangg left a comment

Choose a reason for hiding this comment

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

@milooy
I confirmed operation and verified that the personal token is not exposed through vercel preview. :)

image

@Kimbangg Kimbangg marked this pull request as ready for review March 1, 2025 07:50
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.

3 participants