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

🐛 fix: clerk appearance is not applied #3105

Merged
merged 2 commits into from
Jul 2, 2024
Merged

🐛 fix: clerk appearance is not applied #3105

merged 2 commits into from
Jul 2, 2024

Conversation

phuctm97
Copy link
Contributor

@phuctm97 phuctm97 commented Jul 1, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • ⚡️ perf
  • 📝 docs

🔀 变更说明 | Description of Change

When useAppearance returns different result during SSR vs. client-side (when theme mode is auto), the appearance is not applied. It's because Clerk internally re-applies SSR props after transition which overrides client-side props, see https://github.com/clerk/javascript/blob/main/packages/nextjs/src/app-router/client/ClerkProvider.tsx. This re-renders the provider after transition to make sure client-side props are always applied.

Copy link

vercel bot commented Jul 1, 2024

@phuctm97 is attempting to deploy a commit to the LobeHub Pro Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @phuctm97

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.75%. Comparing base (ae5987a) to head (22f3e4e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3105   +/-   ##
=======================================
  Coverage   93.75%   93.75%           
=======================================
  Files         388      388           
  Lines       23968    23968           
  Branches     1767     1766    -1     
=======================================
  Hits        22470    22470           
  Misses       1498     1498           
Flag Coverage Δ
app 93.75% <ø> (ø)
server 68.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arvinxx
Copy link
Contributor

arvinxx commented Jul 2, 2024

I think it's a good way to solve the issue that clerk provider introduce. But I wonder if there is any possible that Clerk solve this problem at their side? Or in another words, when can we remove these codes?

Copy link

vercel bot commented Jul 2, 2024

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

Name Status Preview Comments Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 2:45pm
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 2:45pm

@phuctm97
Copy link
Contributor Author

phuctm97 commented Jul 2, 2024

I think it's a good way to solve the issue that clerk provider introduce. But I wonder if there is any possible that Clerk solve this problem at their side? Or in another words, when can we remove these codes?

I reported this issue to them. Hopefully they'll fix it soon. The code only re-renders the clerk provider once, it shouldn't a problem regardless imo.

Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

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

It's fine as a fix at our side now. I hope we can remove this part if the Clerk side solve the issue.

@arvinxx arvinxx merged commit cf9c145 into lobehub:main Jul 2, 2024
6 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @phuctm97 ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

github-actions bot pushed a commit that referenced this pull request Jul 2, 2024
### [Version&nbsp;1.2.5](v1.2.4...v1.2.5)
<sup>Released on **2024-07-02**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix clerk appearance is not applied correctly.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fix clerk appearance is not applied correctly, closes [#3105](#3105) ([cf9c145](cf9c145))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Jul 2, 2024
### [Version&nbsp;1.45.3](v1.45.2...v1.45.3)
<sup>Released on **2024-07-02**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix clerk appearance is not applied correctly.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fix clerk appearance is not applied correctly, closes [lobehub#3105](https://github.com/bentwnghk/lobe-chat/issues/3105) ([cf9c145](cf9c145))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
ipoly pushed a commit to ipoly/lobe-chat that referenced this pull request Jul 29, 2024
ipoly pushed a commit to ipoly/lobe-chat that referenced this pull request Jul 29, 2024
### [Version&nbsp;1.2.5](lobehub/lobe-chat@v1.2.4...v1.2.5)
<sup>Released on **2024-07-02**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix clerk appearance is not applied correctly.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fix clerk appearance is not applied correctly, closes [lobehub#3105](lobehub#3105) ([cf9c145](lobehub@cf9c145))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

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

Successfully merging this pull request may close these issues.

3 participants