Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # libs/extractor/src/native/element.rs # libs/extractor/src/native/tests.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
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.
Part of #411, depends on #1045 (base:
feat/react-native-pressed). PR 6 of the React Native plan:css()andclassName(D3).What it does
On React Native,
css()compiles to the style it describes, which is the value React Native'sstyletakes.classNameon a Devup UI element passes that style on:css()takes, as on the web:on ? {…} : null,on && {…});css()gives, or any style value, passed on whole and in order;css`padding: 8px 16px; background-color: $primary; border-radius: ${r};`. Property names are converted to React Native's camelCase,!importantand comments are dropped, and each interpolation must be a whole value.classNamecomes first, then its style props, then itsstyleprop.css()whose styles differ by theme, breakpoint or orientation reads the runtime, so it must be called in a function component or a hook. The hooks are inserted there, as for elements. Acss()that does not differ can be called anywhere, such as at the top of the file. It compiles to aStyleSheetentry and needs no runtime, including withruntime: false.cssimport is removed. A file importing onlycssfrom@devup-ui/reactno longer imports the package at all.stylewith compiled code: astyleprop holding acss()call or Devup UI elements now has them compiled. Before, they could overlap the rewrittenstyle.Build errors
className="p-4",className={`…`},css('p-4'). React Native has no classes; Tailwind is out of scope (D7)._active/_pressed) insidecss(): only the element knows it is pressed. Fix: give_activeto the element.${x}px), and a property React Native has no style for.cssused other than as a call, andcss(...parts).styled(),globalCss(),keyframes()andGridare still build errors and come in later PRs.Expo example and CI
apps/expodeclares the shape both buttons share withconst button = css({...})at the top of the file and passes it throughclassName. Locally,expo exportpassescheck-bundle.mjs.feat/react-native-pressedis added to thepull_requestbranches of the workflow. It will be removed when this PR is retargeted.Tests
css()at the top of a file and in a component;css()results, arrays, sequences and falsy parts;classNamewithstyle;style={css()}on a React Native component;!important, interpolations and empty text;css;runtime: false;cargo test --workspacepasses. There are no web snapshot changes.-D warningsandcargo fmtare clean.cargo llvm-covshows every new line covered.#411의 일부이며 #1045에 의존합니다 (base:
feat/react-native-pressed). React Native 계획의 6번째 PR인css()와className(D3)입니다.변경 내용
React Native에서
css()는 자신이 설명하는 스타일로 컴파일됩니다. 이 스타일은 React Native의style이 받는 값입니다. Devup UI 요소의className은 그 스타일을 그대로 넘깁니다(위 예시 참고).css()가 받는 것 (웹과 같음):on ? {…} : null,on && {…});css()가 준 값이나 임의의 스타일 값(통째로, 순서대로 전달);css`padding: 8px 16px; background-color: $primary; border-radius: ${r};`). 속성 이름은 React Native의 camelCase로 바꾸고,!important와 주석은 버립니다. 보간은 값 전체여야 합니다.className이 먼저 오고, 그다음 style prop, 마지막으로styleprop이 옵니다.css()는 런타임을 읽으므로 함수 컴포넌트나 hook 안에서 호출해야 합니다. hook은 요소와 마찬가지로 그곳에 삽입됩니다. 달라지지 않는css()는 파일 최상단 등 어디서든 호출할 수 있습니다. 이때는StyleSheet항목으로 컴파일되므로 런타임이 필요 없고,runtime: false에서도 동작합니다.cssimport는 제거됩니다.@devup-ui/react에서css만 import하던 파일은 이제 그 패키지를 전혀 import하지 않습니다.style:styleprop 안의css()호출이나 Devup UI 요소도 이제 컴파일됩니다. 이전에는 다시 쓰는style과 위치가 겹칠 수 있었습니다.빌드 에러
className="p-4",className={`…`},css('p-4'). React Native에는 클래스가 없고, Tailwind는 범위 밖입니다(D7).css()안의 press 스타일(_active/_pressed): 눌림 여부는 요소만 압니다. 해결: 요소에_active를 주세요.${x}px), React Native에 없는 속성css사용,css(...parts)styled(),globalCss(),keyframes(),Grid는 여전히 빌드 에러이며 다음 PR에서 다룹니다.Expo 예제와 CI
apps/expo는 두 버튼이 공유하는 모양을 파일 최상단의const button = css({...})로 선언하고className으로 넘깁니다. 로컬에서expo export가check-bundle.mjs를 통과했습니다.pull_requestbranches에feat/react-native-pressed를 추가했습니다. 이 PR의 base를 바꿀 때 제거합니다.테스트
css();css()결과, 배열, sequence, falsy 값과의 조합;style과 함께 쓰는className;style={css()};!important, 보간, 빈 텍스트 포함);css만 import하는 파일;runtime: false;cargo test --workspace가 통과합니다. 웹 snapshot 변경은 없습니다.-D warnings와cargo fmt는 깨끗합니다.cargo llvm-cov에서 새로 추가한 줄은 모두 커버됩니다.🤖 Generated with Claude Code