-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
chore: @types/dom-webcodecs #2557
Conversation
Warning Rate limit exceeded@MrKou47 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 32 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)
WalkthroughThis pull request introduces three distinct changes. First, it adds a new development dependency to Changes
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 (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2557 +/- ##
==========================================
+ Coverage 68.90% 68.92% +0.01%
==========================================
Files 961 961
Lines 100266 100266
Branches 8679 8686 +7
==========================================
+ Hits 69092 69107 +15
+ Misses 30914 30899 -15
Partials 260 260
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
package.json
(1 hunks)packages/rhi-webgl/src/GLTexture2DArray.ts
(1 hunks)scripts/typedoc.sh
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: release
- GitHub Check: build (22.x, windows-latest)
- GitHub Check: codecov
- GitHub Check: build (22.x, macos-latest)
- GitHub Check: lint
- GitHub Check: e2e (22.x)
🔇 Additional comments (2)
package.json (1)
36-36
:✅ Verification successful
Verify @types/dom-webcodecs version compatibility.
Let's ensure we're using the latest compatible version of the type definitions.
🌐 Web query:
What is the latest version of @types/dom-webcodecs on npm?
💡 Result:
The latest version of
@types/dom-webcodecs
on npm is 0.1.13, last published on October 8, 2024[4][6]. This package provides TypeScript definitions for the WebCodecs API specifications[4][7].For installation, use:
npm install --save @types/dom-webcodecsThe package has no dependencies and is maintained under the DefinitelyTyped repository[4][7]. Note that updates to these types may occasionally align with upcoming TypeScript releases before they become stable[1].
Citations:
- 1: [@types/dom-webcodecs] Types are updated for new Typescript versions too early DefinitelyTyped/DefinitelyTyped#65942
- 2: https://www.npmjs.com/package/@types/dom-webcodecs/v/0.1.8?activeTab=versions
- 3: https://www.npmjs.com/package/@types/web
- 4: https://www.npmjs.com/package/@types/dom-webcodecs
- 5: https://classic.yarnpkg.com/en/package/@types/dom-webcodecs
- 6: https://www.npmjs.com/package/@types/dom-webcodecs?activeTab=code
- 7: https://www.jsdelivr.com/package/npm/@types/dom-webcodecs
- 8: https://www.npmjs.com/package/@types/dom-webcodecs/v/0.1.1?activeTab=versions
- 9: https://security.snyk.io/package/npm/@types%2Fdom-webcodecs/0.1.8
- 10: https://npm.runkit.com/@types/dom-webcodecs
@types/dom-webcodecs version is up-to-date
We verified via npm that version 0.1.13 is the latest release for the type definitions. Since the current package.json dependency already specifies "^0.1.13", no changes are necessary.
scripts/typedoc.sh (1)
17-18
:❓ Verification inconclusive
LGTM! Change to pnpx aligns with project's package manager.
The switch from npx to pnpx is correct as the project uses pnpm as its package manager.
Let's verify we're using the latest stable version of typedoc:
🌐 Web query:
What is the latest version of typedoc?
💡 Result:
The latest version of TypeDoc is 0.27.7, released on February 9, 2025[1][2][5]. This update includes features like improved file injection support with
@includeCode
and@inline
tags, enhanced watch mode functionality, and fixes for handling type references and documentation warnings[2][4]. It supports TypeScript versions 5.0 through 5.7 and requires Node.js v18 or newer[1][3]. The package can be installed via npm withnpm install typedoc
[5].Citations:
- 1: https://typedoc.org/documents/Overview.html
- 2: https://github.com/TypeStrong/typedoc/releases
- 3: https://typedoc-plugin-markdown.org/docs/versioning
- 4: https://typedoc.org/documents/Changelog.html
- 5: https://www.npmjs.com/package/typedoc
- 6: https://typedoc.org
- 7: https://www.npmjs.com/package/typedoc-plugin-markdown
- 8: https://sourceforge.net/projects/typedoc.mirror/
- 9: https://github.com/HiDeoo/starlight-typedoc/releases
PNPX usage confirmed; verify TypeDoc dependency version.
The change from using npx to pnpx is appropriate given our use of pnpm. One note: our current setup appears to pin the TypeDoc version to 0.23.28, yet the latest stable release is 0.27.7 (released February 9, 2025). Please verify if we should update the dependency or if the current version is intentionally maintained.
(<Exclude<TexImageSource, VideoFrame>>imageSource).width ?? (imageSource as unknown as VideoFrame).codedWidth, | ||
(<Exclude<TexImageSource, VideoFrame>>imageSource).height ?? (imageSource as unknown as VideoFrame).codedHeight, |
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.
🛠️ Refactor suggestion
Simplify type assertions and add null checks.
The current type assertions are complex and could be simplified while improving type safety.
Consider this safer implementation:
- (<Exclude<TexImageSource, VideoFrame>>imageSource).width ?? (imageSource as unknown as VideoFrame).codedWidth,
- (<Exclude<TexImageSource, VideoFrame>>imageSource).height ?? (imageSource as unknown as VideoFrame).codedHeight,
+ 'codedWidth' in imageSource ? imageSource.codedWidth : imageSource.width,
+ 'codedHeight' in imageSource ? imageSource.codedHeight : imageSource.height,
This approach:
- Uses property checks instead of type assertions
- Eliminates potential undefined access
- Is more maintainable and type-safe
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
(<Exclude<TexImageSource, VideoFrame>>imageSource).width ?? (imageSource as unknown as VideoFrame).codedWidth, | |
(<Exclude<TexImageSource, VideoFrame>>imageSource).height ?? (imageSource as unknown as VideoFrame).codedHeight, | |
'codedWidth' in imageSource ? imageSource.codedWidth : imageSource.width, | |
'codedHeight' in imageSource ? imageSource.codedHeight : imageSource.height, |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information:
Summary by CodeRabbit
Chores
Refactor