+
Skip to content

Conversation

siketyan
Copy link
Member

Summary

Exposes a workspace method scan_project_folder via the WASM API. This will enable use of type inference and project rules in the playground.

Test Plan

Manually tested with the playground locally.

Docs

N/A

@siketyan siketyan requested review from a team July 25, 2025 15:32
@siketyan siketyan self-assigned this Jul 25, 2025
Copy link

changeset-bot bot commented Jul 25, 2025

⚠️ No Changeset found

Latest commit: be2d768

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 14 packages
Name Type
@biomejs/biome Minor
@biomejs/wasm-bundler Minor
@biomejs/wasm-nodejs Minor
@biomejs/wasm-web Minor
@biomejs/js-api Major
@biomejs/cli-win32-x64 Minor
@biomejs/cli-win32-arm64 Minor
@biomejs/cli-darwin-x64 Minor
@biomejs/cli-darwin-arm64 Minor
@biomejs/cli-linux-x64 Minor
@biomejs/cli-linux-arm64 Minor
@biomejs/cli-linux-x64-musl Minor
@biomejs/cli-linux-arm64-musl Minor
@biomejs/backend-jsonrpc Patch

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions bot added the A-Project Area: project label Jul 25, 2025
#[instrument(level = "debug", skip(ctx))]
fn scan_folder(folder: &Utf8Path, ctx: ScanContext) -> ScanFolderResult {
let start = Instant::now();
let start = web_time::Instant::now();
Copy link
Member Author

Choose a reason for hiding this comment

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

web_time::Instant is a drop-in replacement of std::time::Instant backed by performance.now() with wasm-bindgen.

Copy link

codspeed-hq bot commented Jul 25, 2025

CodSpeed Performance Report

Merging #7005 will not alter performance

Comparing feat/wasm-scanner (be2d768) with next (527db7f)

Summary

✅ 115 untouched benchmarks

@siketyan siketyan force-pushed the feat/wasm-scanner branch from 9cfe24f to bf11e53 Compare July 25, 2025 15:51
@@ -0,0 +1,5 @@
---
"@biomejs/biome": patch
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this change primarily affects the wasm packages, probably should also include the wasm packages in this list.

Copy link
Member Author

@siketyan siketyan Jul 25, 2025

Choose a reason for hiding this comment

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

@dyc3 Actually we only use @biomejs/biome and @biomejs/js-api for changing which packages to ship. Bumping @biomejs/biome also ships WASM packages.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right, but when the changelogs get rendered out, the change only shows up for a package if its listed in the changeset. Each package has it's own changelog.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, WASM API changes should be listed in the changelogs for @biome/wasm-*. However, we don't render changelogs for packages other than @biome/biome and @biome/js-api for now, so adding WASM packages is meaningless. Let me align it with #6896 for this time.

Copy link
Member

@ematipico ematipico Jul 26, 2025

Choose a reason for hiding this comment

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

I think @dyc3 makes a good point. We usually publish everything together, but we can add a changelog line for those packages. I can update the changeset of the other PR (as long as they all are patch/minor).

Copy link
Member Author

Choose a reason for hiding this comment

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

I merged the changeset to yours, adding wasm-* packages to the list. be2d768

@@ -0,0 +1,5 @@
---
"@biomejs/biome": patch
Copy link
Member

Choose a reason for hiding this comment

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

I did the same here #6896 but merged into next. I think it's fine to have them shipped in patches, but we should agree how we should ship new APIs from core :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't notice your PR 😔 Then should I close this as I suppose exposing update_module_graph is sufficient to enable project rules?

Copy link
Member

@ematipico ematipico Jul 25, 2025

Choose a reason for hiding this comment

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

I exposed those functions because I thought they were more useful for the playground, where there are single files.

The methods I exposed should be useful for project rules, however they require more plumbing.

This doesn't mean that this new method is useless, because we could use it for the JavaScript APIs as well :)

Let's merge the PR nonetheless :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll rebase this to next and ship with the methods you added :)

@siketyan siketyan changed the base branch from main to next July 26, 2025 11:54
@siketyan siketyan force-pushed the feat/wasm-scanner branch from bf11e53 to 19713e6 Compare July 26, 2025 11:56
@siketyan siketyan force-pushed the feat/wasm-scanner branch from 19713e6 to 38de486 Compare July 26, 2025 11:56
@siketyan siketyan force-pushed the feat/wasm-scanner branch from 38de486 to be2d768 Compare July 26, 2025 12:16
@siketyan siketyan merged commit b510e6f into next Jul 26, 2025
27 of 28 checks passed
@siketyan siketyan deleted the feat/wasm-scanner branch July 26, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载