Skip to content

fix(load-list): avoid tinyList and tinyTimeLine regisiter twice #2854

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

Merged
merged 3 commits into from
Feb 5, 2025

Conversation

shenjunjian
Copy link
Collaborator

@shenjunjian shenjunjian commented Feb 5, 2025

PR

  1. 修改loadList组件的注册名字为 tinyLoadList
  2. 从总入口处,屏蔽掉 time-line-new的包
  3. 修改crop组件内的ref名称

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #2832

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Enhanced runtime filtering to streamline the simplified display by extending the criteria for component exclusion.
    • Improved the list display component with refined property validation and a clearer naming convention for better consistency.
    • Added functionality to handle user interactions in the crop interface, including closing with the Escape key and automatic closure upon confirmation.
  • Bug Fixes

    • Updated component references to ensure consistency across the application.
  • Chores

    • Removed unnecessary package dependency to simplify the project.

Copy link

coderabbitai bot commented Feb 5, 2025

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • examples/sites/demos/pc/app/user/hide-selected-composition-api.vue

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR updates component exclusion logic and refines component validation. It adds the new component 'TimeLineNew' to the exclusion arrays in both the CLI build process and module utilities, affecting the behavior in simple runtime mode. Additionally, it modifies the Vue component by updating its property validator for the direction prop (switching from indexOf to includes) and renaming the component from a generic 'List' to a more specific 'LoadList'. No changes have been made to exported or public declarations.

Changes

File(s) Change Summary
internals/cli/.../build/build-entry-app.ts
internals/cli/.../module-utils.ts
Added 'TimeLineNew' to component exclusion arrays used in the simple runtime mode and overall exclusion logic.
packages/vue/.../load-list/src/index.ts Updated the direction property validator to use includes and renamed the component from $prefix + 'List' to $prefix + 'LoadList'.
packages/renderless/.../index.ts
packages/vue/.../src/pc.vue
Renamed local variable cropImage to cropImageRef in the createCrop function and updated the corresponding reference in the Vue template.
packages/vue/package.json Removed dependency @opentiny/vue-time-line-new from dependencies.

Possibly related PRs

Suggested labels

bug, enhancement

Suggested reviewers

  • zzcr

Poem

I'm a rabbit with a coding beat,
Hopping through arrays with nimble feet.
TimeLineNew joined our exclusion crew,
Helping our build process stay fresh and new.
In Vue land, our LoadList is now complete,
Cheering with joy—let's code, repeat! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Walkthrough

此PR修复了loadList组件的注册问题,将其注册名称修改为tinyLoadList,并在总入口处屏蔽了time-line-new包的注册。此更改旨在避免tinyList和tinyTimeLine组件的重复注册问题。

Changes

文件 概要
internals/cli/src/commands/build/build-entry-app.ts 添加了'TimeLineNew'到组件列表中。
internals/cli/src/shared/module-utils.ts 将'TimeLineNew'添加到需要排除的组件列表中。
packages/vue/src/load-list/src/index.ts 修改了组件名称为tinyLoadList,并优化了direction属性的验证逻辑。
🪧 Tips For further assistance, please describe your question in the comments and @petercat-assistant to start a conversation with me.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 701f2aa and c3354e5.

📒 Files selected for processing (3)
  • internals/cli/src/commands/build/build-entry-app.ts (1 hunks)
  • internals/cli/src/shared/module-utils.ts (1 hunks)
  • packages/vue/src/load-list/src/index.ts (2 hunks)
🔇 Additional comments (3)
packages/vue/src/load-list/src/index.ts (1)

7-7: LGTM! Modern array method usage.

The change from indexOf > -1 to includes improves code readability while maintaining the same functionality.

internals/cli/src/commands/build/build-entry-app.ts (1)

115-115: LGTM! Consistent with PR objectives.

Adding 'TimeLineNew' to notSimpleComponents correctly implements the PR objective to disable the time-line-new package from the main entry point.

internals/cli/src/shared/module-utils.ts (1)

17-17: LGTM! Consistent component exclusion.

Adding 'TimeLineNew' to excludeComponents maintains consistency with its exclusion in notSimpleComponents, ensuring the component is properly excluded from processing.

@@ -19,7 +19,7 @@ export const loadListProps = {
}

export default defineComponent({
name: $prefix + 'List',
name: $prefix + 'LoadList',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify component name change impact.

The component has been renamed from List to LoadList. While this name is more descriptive, it's a breaking change that could affect existing usage.

Run this script to find potential usages that need updating:


🏁 Script executed:

#!/bin/bash
# Search for any imports or usage of the old component name
rg -l "(?:import|from).*List['\"]|(?:<|@)tiny-list" 

Length of output: 319

Breaking change detected due to component rename

  • The component was renamed from List to LoadList in packages/vue/src/load-list/src/index.ts.
  • The grep output indicates that the following demo files still reference the old component (likely via tags like <tiny-list> or similar):
    • examples/sites/demos/mobile/app/list/slots.vue
    • examples/sites/demos/mobile/app/list/single-line.vue
    • examples/sites/demos/mobile/app/list/double-line.vue
    • examples/sites/demos/mobile/app/list/double-list.vue
    • examples/sites/demos/mobile/app/list/imformation-list.vue

These usages need to be updated to reflect the new LoadList name to prevent breakage.

@shenjunjian shenjunjian changed the title [WIP] fix(load-list): avoid tinyList and tinyTimeLine regisiter twice fix(load-list): avoid tinyList and tinyTimeLine regisiter twice Feb 5, 2025
@github-actions github-actions bot added the bug Something isn't working label Feb 5, 2025
Copy link

github-actions bot commented Feb 5, 2025

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

@zzcr zzcr merged commit b572e51 into opentiny:dev Feb 5, 2025
5 checks passed
@shenjunjian shenjunjian deleted the fix-avoid-tinyLIst-tinyTimeLine-warn branch March 10, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants