fix: load spoqa font with webfontloader #99
Merged
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.
1️⃣ 어떤 작업을 했나요? (Summary)
쉽지 않네요. 😇
우선 문제는 1.0.1에서 1.0.2로 올라가면서 터지게 되는데, 처음에는 https://github.com/yourssu/YDS-React/pull/53/files 여기서 index.html 파일에서 폰트를 부르는 것만이 원인인 줄 알았습니다. (이것도 문제는 맞습니다. 디자인 시스템 라이브러리는 index.html 파일을 사용하지 않기 때문에, index.html 파일에서 폰트 호출 시 로딩 X)
하지만 기존
@import
방식으로 되돌려도 정상 로딩 되지 않았습니다.why?
라이브러리 배포 시 원래 dist 폴더만 포함시키는 것이 일반적이지만, 1.0.1까지는 저희가 src 소스 코드까지 전부 포함해서 배포 중이었습니다.
따라서
@import
방식으로 폰트를 로딩 하더라도 src 내 globalStyle 파일을 참조하여 폰트를 로딩한 것으로 보입니다.~1.0.1까지의 배포 형태
1.0.2부터 배포 형태
결국, 배포 형태가 바뀌면서 폰트 로딩 방식에 변화를 주어야 했고, webfontloader를 사용해서 비동기적으로 폰트를 로딩하는 방식을 채택하였습니다.
사용처 테스트도 전부 돌려보았고, 정상 출력되는거 확인했습니다.
2️⃣ 알아두시면 좋아요!
index.html 파일은 나중에 또 헷갈릴 수 있으니 그냥 삭제했습니다.
3️⃣ 추후 작업
이거랑 suffix icon PR 머지 후 진짜 1.1.1 배포.
4️⃣ 체크리스트 (Checklist)
main
브랜치의 최신 코드를pull
받았나요?