Skip to content

Conversation

@PupilTong
Copy link
Collaborator

@PupilTong PupilTong commented Jul 10, 2025

Summary by CodeRabbit

  • New Features

    • Added TypeScript type declarations for the web style transformer module, enabling type-safe interaction with its WebAssembly-based features.
  • Chores

    • Updated package configuration to include the new TypeScript typings in the package distribution.

@changeset-bot
Copy link

changeset-bot bot commented Jul 10, 2025

🦋 Changeset detected

Latest commit: 5cfa829

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 10, 2025

Walkthrough

A new TypeScript declaration file was added for the WebAssembly-based style transformer module, specifying its exports and initialization functions. The package configuration was updated to reference and include this typings file. Additionally, an empty changeset file was introduced for tracking purposes.

Changes

File(s) Change Summary
.changeset/kind-bars-pay.md Added an empty changeset file with only YAML front matter delimiters.
packages/web-platform/web-style-transformer/index.d.ts Introduced TypeScript declarations for the WebAssembly style transformer module and its exports.
packages/web-platform/web-style-transformer/package.json Updated typings path and included the new TypeScript declaration file in the package distribution.

Poem

A rabbit hops with glee today,
For typings now will light the way.
With WebAssembly in the mix,
And package tweaks, the build is fixed!
An empty changeset marks the spot—
More style transforms, ready or not!
🐇✨

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.

 ERROR  Cannot resolve version $@rspack/core in overrides. The direct dependencies don't have dependency "@rspack/core".
For help, run: pnpm help install

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

@PupilTong PupilTong requested a review from colinaaa July 10, 2025 11:59
@PupilTong PupilTong self-assigned this Jul 10, 2025
Copy link
Contributor

@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

🧹 Nitpick comments (1)
packages/web-platform/web-style-transformer/index.d.ts (1)

10-15: Array<any> discards type information

Using Array<any> voids IntelliSense and static checks. Consider defining a concrete result shape, e.g.:

export interface ParsedStyleEntry {
  name: string;
  value: string;
  // …
}
export function transform_raw_u16_inline_style_ptr_parsed(
  /* … */
): ParsedStyleEntry[] | undefined;

This keeps consumers type-safe without extra work.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 60095d7 and 5cfa829.

📒 Files selected for processing (3)
  • .changeset/kind-bars-pay.md (1 hunks)
  • packages/web-platform/web-style-transformer/index.d.ts (1 hunks)
  • packages/web-platform/web-style-transformer/package.json (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/web-platform/web-style-transformer/index.d.ts (1)
packages/web-platform/web-style-transformer/src/lib.rs (2)
  • transform_raw_u16_inline_style_ptr (11-26)
  • transform_raw_u16_inline_style_ptr_parsed (43-75)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: build / Build (Ubuntu)
  • GitHub Check: code-style-check
  • GitHub Check: CodeQL Analyze (actions)
  • GitHub Check: CodeQL Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/web-platform/web-style-transformer/index.d.ts (2)

26-39: Export map mirrors wasm-bindgen output correctly

The memory, function shims, table, and start entry match the generated .wasm exports. No correctness issues seen.


19-25: Incorrect suggestion: qualifying with globalThis won’t resolve missing DOM types
The proposed diff still relies on the dom lib being enabled—globalThis.RequestInfo, globalThis.URL, and globalThis.Response do not exist when you’ve opted out of the DOM library. To support Node‐only consumers you must either:

  • Document that lib: ["dom"] is required in consumers’ tsconfig

  • Or import the fetch types from a Node‐compatible library (e.g. undici or node-fetch):

    import type { RequestInfo, Response } from "undici";
    export type InitInput =
      | RequestInfo
      | URL
      | Response
      | BufferSource
      | WebAssembly.Module;

Likely an incorrect or invalid review comment.

packages/web-platform/web-style-transformer/package.json (1)

14-19: Typings path & files array updated correctly

Moving "typings" from dist/index.d.ts to index.d.ts and including it in "files" ensures the new declarations reach npm. Nice catch.

@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 10, 2025

CodSpeed Performance Report

Merging #1270 will not alter performance

Comparing PupilTong:p/hw/fix-ts-build-type-issue-for-web-rust (5cfa829) with main (60095d7)

Summary

✅ 10 untouched benchmarks

@PupilTong PupilTong enabled auto-merge July 10, 2025 12:15
@PupilTong PupilTong added this pull request to the merge queue Jul 10, 2025
@relativeci
Copy link

relativeci bot commented Jul 10, 2025

Web Explorer

#2826 Bundle Size — 294.21KiB (0%).

5cfa829(current) vs 60095d7 main#2821(baseline)

Bundle metrics  Change 1 change
                 Current
#2826
     Baseline
#2821
No change  Initial JS 139.86KiB 139.86KiB
No change  Initial CSS 31.88KiB 31.88KiB
Change  Cache Invalidation 0% 86.15%
No change  Chunks 4 4
No change  Assets 5 5
Change  Modules 205(+0.49%) 204
No change  Duplicate Modules 17 17
No change  Duplicate Code 4.26% 4.26%
No change  Packages 3 3
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#2826
     Baseline
#2821
No change  JS 220.19KiB 220.19KiB
No change  Other 42.14KiB 42.14KiB
No change  CSS 31.88KiB 31.88KiB

Bundle analysis reportBranch PupilTong:p/hw/fix-ts-build-type...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link

relativeci bot commented Jul 10, 2025

React Example

#2835 Bundle Size — 234.12KiB (0%).

5cfa829(current) vs 60095d7 main#2830(baseline)

Bundle metrics  no changes
                 Current
#2835
     Baseline
#2830
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 153 153
No change  Duplicate Modules 61 61
No change  Duplicate Code 45.85% 45.85%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#2835
     Baseline
#2830
No change  IMG 145.76KiB 145.76KiB
No change  Other 88.37KiB 88.37KiB

Bundle analysis reportBranch PupilTong:p/hw/fix-ts-build-type...Project dashboard


Generated by RelativeCIDocumentationReport issue

Merged via the queue into lynx-family:main with commit 209f1db Jul 10, 2025
46 checks passed
@PupilTong PupilTong deleted the p/hw/fix-ts-build-type-issue-for-web-rust branch July 10, 2025 12:37
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.

2 participants