-
Notifications
You must be signed in to change notification settings - Fork 299
fix(renderless): restore the removed InfiniteScroll variable #2882
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(renderless): restore the removed InfiniteScroll variable #2882
Conversation
Warning Rate limit exceeded@shenjunjian has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 36 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe pull request adds a new dependency on Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
[e2e-test-warn] 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 |
Walkthrough此PR将被移除的InfiniteScroll变量还原到renderless/common中。此更改涉及在 Changes
|
@@ -0,0 +1,3 @@ | |||
import { InfiniteScroll } from '@opentiny/vue-directive' |
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.
确保@opentiny/vue-directive
包中确实存在InfiniteScroll
导出,以避免运行时错误。
WalkthroughThis PR restores the removed InfiniteScroll variable to renderless/common. This change involves reimporting and exporting the InfiniteScroll variable in Changes
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/renderless/src/common/deps/dom.ts (1)
1-20
: Consider adding TypeScript types and documentation.The exported utility functions would benefit from:
- TypeScript type declarations for better type safety and IDE support
- JSDoc comments describing each function's purpose, parameters, and return values
Consider adding type information and documentation:
+/** + * DOM manipulation and event handling utilities + * @module dom + */ + +/** + * Attaches an event handler to an element + * @param {Element} element - The target element + * @param {string} event - The event name + * @param {Function} handler - The event handler + */ export { on, off, // ... add similar documentation for other functions } from '@opentiny/utils'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/renderless/src/common/deps/dom.ts
(1 hunks)
🔇 Additional comments (1)
packages/renderless/src/common/deps/dom.ts (1)
1-20
: Verify exports from '@opentiny/utils'.Let's ensure all exported functions are properly defined in the '@opentiny/utils' package.
❌ Verification inconclusive
🏁 Script executed:
#!/bin/bash # Description: Check if all exported functions exist in @opentiny/utils # Search for function definitions in @opentiny/utils ast-grep --pattern 'export function $name($$$) { $$$ }' | grep -E 'on|off|once|hasClass|addClass|removeClass|getStyle|setStyle|isScroll|getScrollContainer|isInContainer|getDomNode|getScrollTop|stopPropagation|preventDefault|getScrollParent|useScrollParent|isDisplayNone'Length of output: 272
I'll run a new script to search if these functions might be defined using arrow functions. This will help further verify that the expected exports exist:
🏁 Script executed:
#!/bin/bash # Search for arrow function export definitions for the expected functions in @opentiny/utils ast-grep --pattern 'export const $name = ($$$) => $$$' | grep -E 'on|off|once|hasClass|addClass|removeClass|getStyle|setStyle|isScroll|getScrollContainer|isInContainer|getDomNode|getScrollTop|stopPropagation|preventDefault|getScrollParent|useScrollParent|isDisplayNone'Length of output: 271
The previous scripts didn't return results, likely because the package's exports may not be defined with the patterns we checked. To further verify the dependency, let’s check if the
@opentiny/utils
package is declared in the rootpackage.json
(which gives us confidence that its exported functions are available). We'll run a script for that:
🏁 Script executed:
#!/bin/bash # Verify that @opentiny/utils is included as a dependency in package.json at the repository root grep '@opentiny/utils' package.jsonLength of output: 35
Let's run a new script that searches for any mention of
"@opentiny/utils"
in allpackage.json
files within the repository. This will help us verify if the dependency is declared somewhere (for example, inpackages/renderless/package.json
) even if it's not in the repository root.
🏁 Script executed:
#!/bin/bash # Search for '@opentiny/utils' in any package.json file in the repository grep -R '"@opentiny/utils"' .Length of output: 2880
Review of DOM Re-Export File from '@opentiny/utils'
- The re-export file in
packages/renderless/src/common/deps/dom.ts
correctly re-exports the listed DOM utility functions.- Our automated searches confirmed that
@opentiny/utils
is declared as a dependency (via multiple package.json files), which suggests that the package is available.- However, automated pattern searches (using both function and arrow function patterns) did not match any explicit definitions. This likely means the utilities are exported using alternative or aggregated patterns in
@opentiny/utils
.- It is advisable to manually verify within the
@opentiny/utils
package that all functions (on
,off
,once
, etc.) are indeed exported (and that their TypeScript types and documentation—if needed—are provided) to ensure consistency with the intended PR objectives.
packages/renderless/package.json
Outdated
@@ -37,6 +37,7 @@ | |||
}, | |||
"dependencies": { | |||
"@opentiny/utils": "workspace:~", | |||
"@opentiny/vue-directive": "workspace:~", |
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.
依赖要删除
PR
还原 InfiniteScroll 指令变量到renderless/common中去
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit