Skip to content
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

feat: remove findDomNode #295

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CoderSerio
Copy link

@CoderSerio CoderSerio commented Dec 30, 2024

what this PR does

  1. Remove the deprecated API findDOMNode.
  2. Add a check to prevent the delete button in the dir /examples, from causing an error, when clicked while the list is empty.
  3. Correct the port mentioned in README.md

Summary by CodeRabbit

  • 文档更新

    • 更新了开发说明中的本地服务器端口,从 9001 更改为 8000
  • 代码改进

    • Demo 组件中使用可选链接 ?. 优化 scrollTo 方法调用
    • 简化 useHeights 钩子中的高度收集逻辑,直接访问 DOM 元素属性

Copy link

vercel bot commented Dec 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
virtual-list ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 2:57am

Copy link

coderabbitai bot commented Dec 30, 2024

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

examples/basic.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /.eslintrc.js
Error: Cannot find module '@umijs/fabric/dist/eslint'
Require stack:

  • /.eslintrc.js
  • /node_modules/.pnpm/@eslint[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Module._load (node:internal/modules/cjs/loader:1074:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object. (/.eslintrc.js:1:14)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)

变更概览

变更说明

本次拉取请求包含对 rc-virtual-list 项目的三个文件进行了细微但重要的修改:README.md、examples/basic.tsx 和 src/hooks/useHeights.tsx。这些变更主要涉及开发服务器端口更新、代码健壮性改进和代码简化。

变更

文件 变更摘要
README.md 开发服务器端口从 9001 更改为 8000
examples/basic.tsx scrollTo 方法调用中添加可选链操作符 ?.
src/hooks/useHeights.tsx 移除 findDOMNode 工具,直接访问元素的 offsetHeight 和计算样式

序列图

sequenceDiagram
    participant Dev as 开发者
    participant App as 应用程序
    participant List as 虚拟列表
    
    Dev->>App: 启动开发服务器
    App->>List: 初始化虚拟列表
    List-->>App: 列表准备就绪
    Dev->>List: 调用 scrollTo 方法
    Note over List: 安全地处理方法调用
Loading

可能相关的 PRs

  • enhance: Scroll top should not shaking #296: 该 PR 中对 examples/basic.tsx 文件的更改涉及对 Demo 组件的修改,可能与本 PR 中的开发指令更新相关,影响虚拟列表组件的整体功能和用户体验。

诗歌

🐰 代码兔子的变更颂歌 🥕

端口轻移,八千取代九千一
可选链接,安全舞动
DOM 节点直达,不再绕远路
简洁优雅,兔子微笑
代码如春风,轻轻拂过


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 182111c and debf618.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • examples/basic.tsx (10 hunks)
  • src/hooks/useHeights.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • README.md
  • examples/basic.tsx
  • src/hooks/useHeights.tsx

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant