Skip to content

Conversation

@Yradex
Copy link
Collaborator

@Yradex Yradex commented Apr 30, 2025

Summary

Refactor MTS js_fns_to_extract to make props keys and values accessible.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@changeset-bot
Copy link

changeset-bot bot commented Apr 30, 2025

⚠️ No Changeset found

Latest commit: 5912ce4

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 no changesets

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

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

@Yradex Yradex requested a review from Copilot April 30, 2025 09:46

This comment was marked as outdated.

@Yradex Yradex changed the title refactor(react/transform): refactor MTS js_fns_to_extract to use HashMap for better management refactor(react/transform): refactor MTS js_fns_to_extract to use HashMap Apr 30, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 30, 2025

CodSpeed Performance Report

Merging #672 will not alter performance

Comparing Yradex:mts/first-screen (5912ce4) with main (f4bbda2)

Summary

✅ 1 untouched benchmarks

@Yradex Yradex force-pushed the mts/first-screen branch from dc7d0b8 to 5912ce4 Compare April 30, 2025 10:07
@Yradex Yradex changed the title refactor(react/transform): refactor MTS js_fns_to_extract to use HashMap refactor(react/transform): MTS js_fns_to_extract to make props keys and values accessible Apr 30, 2025
@Yradex Yradex requested a review from Copilot April 30, 2025 10:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the handling of worklet function extraction in the MTS transform by changing the representation of extracted JavaScript functions from a Box to a vector of key-value pairs.

  • Changed types for js and extracted function expressions to Vec<(IdentName, Box)>.
  • Updated checks and iterations to accommodate the new vector-based structure.
  • Adjusted the VisitMut implementation in extract_ident to collect function expressions as tuples.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/react/transform/src/swc_plugin_worklet/gen_stmt.rs Updates to handle extracted_js_fns as a vector and rebuild the object literal for worklet transformation.
packages/react/transform/src/swc_plugin_worklet/extract_ident.rs Changes js_fns_to_extract type handling, including using take() and updating the collection process in VisitMut.

@codecov
Copy link

codecov bot commented Apr 30, 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!

@codecov
Copy link

codecov bot commented Apr 30, 2025

Bundle Report

Bundle size has no change ✅

@Yradex Yradex force-pushed the mts/first-screen branch from 3532f19 to 5912ce4 Compare May 6, 2025 03:28
@Yradex Yradex marked this pull request as ready for review May 6, 2025 03:28
@Yradex Yradex requested review from colinaaa and hzy May 6, 2025 03:28
@Yradex Yradex added this pull request to the merge queue May 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 6, 2025
@colinaaa colinaaa added this pull request to the merge queue May 6, 2025
github-merge-queue bot pushed a commit that referenced this pull request May 6, 2025
… and values accessible (#672)

## Summary

Refactor MTS `js_fns_to_extract` to make props keys and values
accessible.

## Checklist

- [x] Tests updated (or not required).
- [x] Documentation updated (or not required).
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 6, 2025
@colinaaa colinaaa added this pull request to the merge queue May 6, 2025
Merged via the queue into lynx-family:main with commit 40fb90f May 6, 2025
33 of 51 checks passed
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