-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(nvue-styler): 调整 uvue 中 flex-flow 拆分、支持 ::v-deep #5495
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures the flex-flow
transform is applied in uvue and updates the corresponding tests to reflect splitting flexFlow
into flexDirection
and flexWrap
.
- Always include
transformFlexFlow
for uvue (removed conditional guard) - Rename test properties from
flexFlow
toflex-flow
and expect separateflexDirection
/flexWrap
- Adjust test case counts and message indices
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/uni-nvue-styler/src/expand/index.ts | Removed the options.type !== 'uvue' guard so transformFlexFlow always applies |
packages/uni-nvue-styler/tests/uvueNormalize-android.spec.ts | Updated CSS property names in tests and expanded flexFlow split; adjusted message indices and added length check |
Comments suppressed due to low confidence (2)
packages/uni-nvue-styler/src/expand/index.ts:52
- Add a comment explaining why
transformFlexFlow
is now always applied (even for uvue) to clarify the removal of the conditional spread.
flexFlow: transformFlexFlow,
packages/uni-nvue-styler/tests/uvueNormalize-android.spec.ts:505
- Consider adding an assertion that the normalized output object contains both
flexDirection
andflexWrap
properties after splittingflexFlow
to ensure the transform works as intended.
flexDirection: 'row',
Size report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances flex-flow handling in the uni-nvue-styler
, especially for uvue contexts, and updates tests accordingly.
- Adds special selector normalization for
::v-deep
and:deep()
in uvue. - Makes
transformFlexFlow
unconditional in the declaration transforms. - Updates and adds tests for flex-flow splitting into
flexDirection
andflexWrap
.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/uni-nvue-styler/src/normalize/index.ts | Add uvue-specific handling for ::v-deep and :deep() selectors |
packages/uni-nvue-styler/src/expand/index.ts | Remove conditional around flexFlow transform |
packages/uni-nvue-styler/tests/uvueNormalize-ios.spec.ts | New tests for deep selector normalization |
packages/uni-nvue-styler/tests/uvueNormalize-android.spec.ts | Adjust flex-flow tests to output flexDirection /flexWrap and shift error assertions |
packages/uni-nvue-styler/tests/parse-nvue.spec.ts | Add tests for splitting flex-flow into separate properties |
Comments suppressed due to low confidence (3)
packages/uni-nvue-styler/src/normalize/index.ts:51
- Add the global flag to the regex (
/\s+/g
) so that multiple whitespace sequences throughout the selector are collapsed, not just the first.
.replace(/\s+/, ' ')
packages/uni-nvue-styler/src/expand/index.ts:52
- This transform is now applied unconditionally. If
uvue
should still skipflex-flow
, consider reintroducing a guard based onoptions.type
.
flexFlow: transformFlexFlow,
packages/uni-nvue-styler/src/normalize/index.ts:36
- Add a test case where a selector contains multiple
::v-deep
or:deep()
patterns to verify that all instances are correctly normalized.
const isUvue = opts.type === 'uvue'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adjusts flex‐flow splitting for uvue styling in the uni-nvue-styler package by refining deep selector handling and unconditionally applying the flexFlow transformation. Key changes include:
- In the normalize module, deep selector replacements for ::v-deep and :deep() are applied when opts.type is 'uvue'.
- In the expand module, the conditional check for uvue has been removed so that flexFlow is now always applied.
- New test cases have been added to verify the updated behavior across iOS, Android, and nvue modes.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/uni-nvue-styler/src/normalize/index.ts | Added uvue-specific deep selector handling and whitespace normalization updates. |
packages/uni-nvue-styler/src/expand/index.ts | Removed conditional spreading of flexFlow transformation, applying it for all types. |
packages/uni-nvue-styler/tests/uvueNormalize-ios.spec.ts | Added tests to verify deep selector processing and border properties. |
packages/uni-nvue-styler/tests/uvueNormalize-android.spec.ts | Updated tests to reflect changes in flex-flow property transformation and message indexing. |
packages/uni-nvue-styler/tests/parse-nvue.spec.ts | Introduced tests for flex-flow behavior and for cases where nvue does not support deep selectors. |
Comments suppressed due to low confidence (1)
packages/uni-nvue-styler/src/expand/index.ts:50
- The removal of the conditional spread means that the flexFlow transformation is now applied unconditionally. Please add an inline comment to explain that this behavior is an intentional change for uvue styling.
flexFlow: transformFlexFlow,
No description provided.