[svg-manager] SvgUniqueID를 useId 기반 SSR-safe id로 재작성#226
Draft
yongsk0066 wants to merge 6 commits into
Draft
Conversation
Collaborator
✅ Changeset detectedLatest commit: d0bea53
If no version change is needed, please add The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
|
Collaborator
NPM Packages📦 @naverpay/svg-managerTotal Sizes: 2.19 kB Total Changes: -1.98 kB (-47%) ✅ (Size Decreased)
powered by: naverpay size-action |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Describe your changes
SvgUniqueID가 매 렌더generateRandomString()으로 난수 id를 만들어 SSR↔CSR hydration 불일치를 일으키던 문제를 해결합니다.useId기반으로 재작성 — 서버/클라이언트에서 동일한 id가 나와 hydration-safelocalIdsMap싱글톤 의존을 순수 함수renameId()로 단순화toSafeId유틸 추가 —useId가 만드는 콜론 포함 id를url(#...)/CSS selector에 안전한 토큰으로 정규화deepMap단순화 (중복isValidElement검사 제거)'use client'전환은 #194 리뷰(discussion_r2285848228)에서 정리됐듯 서버/클라 id 시작점이 달라 불가피합니다.기존 동작은 동일하고 hydration 버그만 해결하며, client 컴포넌트를 import해도 import하는 쪽이 client가 되지는 않습니다(경계는 SvgUniqueID 서브트리 한정).
Request