Repository navigation
fix(react): back compat theming with context and add ThemeConsumer and createTheme - #712
Merged
Merged
Conversation
…d createTheme Refs #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refs #689 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Contributor
Changepacks@devup-ui/wasm@1.0.83 → 1.0.84 - bindings/devup-ui-wasm/package.jsonPatch
@devup-ui/bun-plugin@1.0.22 → 1.0.23 - packages/bun-plugin/package.jsonPatch
@devup-ui/components@0.1.60 → 0.1.61 - packages/components/package.jsonPatch
@devup-ui/eslint-plugin@1.0.22 → 1.0.23 - packages/eslint-plugin/package.jsonPatch
@devup-ui/next-plugin@1.0.90 → 1.0.91 - packages/next-plugin/package.jsonPatch
@devup-ui/plugin-utils@1.0.17 → 1.0.18 - packages/plugin-utils/package.jsonPatch
@devup-ui/react@1.0.44 → 1.0.45 - packages/react/package.jsonPatch
@devup-ui/reset-css@1.0.31 → 1.0.32 - packages/reset-css/package.jsonPatch
@devup-ui/rsbuild-plugin@1.0.67 → 1.0.68 - packages/rsbuild-plugin/package.jsonPatch
@devup-ui/vite-plugin@1.0.73 → 1.0.74 - packages/vite-plugin/package.jsonPatch
@devup-ui/webpack-plugin@1.0.71 → 1.0.72 - packages/webpack-plugin/package.jsonPatch
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
Merge main history while preserving this PR implementation. No manual conflict resolutions.
Merge main history while preserving this PR implementation. No manual conflict resolutions.
Merge main history while preserving this PR implementation. No manual conflict resolutions.
Merge main history while preserving this PR implementation. No manual conflict resolutions.
Merge main history while preserving this PR implementation. No manual conflict resolutions.
owjs3901
added a commit
that referenced
this pull request
Oct 15, 2026
Refs #684 2026-10-15: 갱신된 부모 #730 b28816c2를 두 부모 병합으로 통합했습니다. package.json은 모든 타입 fixture를 검사하는 프로젝트 명령으로 합쳤고, styled-components 선언의 중복 re-export만 제거하면서 확장 가능한 테마와 브랜드 및 부모의 createTheme·정규 ClassNamesArg를 보존했습니다. 승인된 #712 타입 보정으로 theme 함수의 undefined outer, 함수형 ThemeConsumer, withTheme의 theme override/ref를 실제 부모 구현과 일치시켰습니다. 같은 새 타입 증명이 보정 전 13개 오류를 재현하고 보정 후 통과했으며, React 18/19의 실제 배포 dist 소비자 검사도 통과했습니다. 런타임·Rust·캡처·프로토콜 변경은 없습니다. 최신 main a6ecc12 반영은 코디네이터 지시에 따라 MAIN SETTLED 이후 전파 단계로 남겨 둡니다. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.
Refs #689 (C 네 번째 PR).
main에서 분기했습니다.문제
useTheme·withTheme가ThemeProvider에 넘긴 theme이 아니라 빈 Proxy를 돌려줬습니다.t.colors.brand는var(--colors-brand)문자열이 됐고,JSON.stringify(t)·Object.keys(t)·{...t}는 모두 비어 있었습니다.ThemeProvider의 함수 theme(theme={outer => ...})과 객체 병합이 동작하지 않았습니다.ThemeConsumer가 없어styled-components가 런타임 의존성으로 남았습니다.createTheme도 alias와 타입이 없어 같은 문제가 있었습니다.withTheme이 ref를 넘기지 않았고, 호출자가 준theme을 덮어썼으며,displayName이 없었습니다.변경
ThemeProvider가 React context로 theme 객체를 내려줍니다.useTheme은 가장 가까운 provider의 theme 객체를 돌려주고, provider가 없으면{}를 돌려줍니다.withThemeforwardRef, React 18 호환).theme을 주면 그 값이 우선합니다.displayName은WithTheme(Name)형식입니다.ThemeConsumer를 추가했습니다.createTheme을 호환 구현했습니다.var(--sc-path, 값)이 됩니다.GlobalStyle,raw,vars,resolve()를 제공합니다.prefix/selector옵션을 받습니다.ThemeConsumer·createThemeimport를@devup-ui/react/compat로 옮기고, 타입 선언을 추가했습니다.createThemeAccessor를 제거했습니다.동작 변화
useTheme().x가var(--x)대신 provider가 준 실제 값을 돌려줍니다. 스타일에서 읽는 theme은 그대로 CSS 변수입니다.새로 생기는 오류
남은 항목
display:contents래퍼는 아직 남아 있습니다. 변수 범위를 DOM 구조 없이 지정하려면 별도 설계가 필요해 K #693에 문서화할 예정입니다.jsx/ClassNames/CacheProviderassert_is_empty수정은 fix(extractor): let a later css() part replace an earlier one's declarations #706, #709와 같습니다. 그래서 나중에 병합되는 쪽에서 충돌이 날 수 있으며, 내용이 같으므로 어느 쪽을 택해도 됩니다.검증
cargo clippy -D warnings(Rust 1.99),cargo test통과. 새 테스트test_styled_components_theme_apis_redirect_to_compat을 추가했습니다.bun test5481개 통과, 커버리지 100%. 새 브라우저 테스트는useStyledTheme,withTheme/ThemeConsumer, 중첩ThemeProvider,createTheme입니다.bun lint오류 0개. 경고 9개는 React 18 호환을 위해 쓴forwardRef/useContext에 대한 것입니다(D4).2026-10-08 업데이트: main 11790bef를 merge commit으로 병합했습니다; 충돌 파일: 없음; 충돌 없이 자동 병합했고, 이미 포함된 squash 원본은 조상 확인 후 ours 전략으로 중복 적용하지 않았습니다.