Skip to content
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

refactor: align starts_with with the same semantics #2872

Merged
merged 3 commits into from
Apr 23, 2023

Conversation

hyf0
Copy link
Contributor

@hyf0 hyf0 commented Apr 23, 2023

Related issue (if exists)

Summary

  • functions named with starts_with should match itself.
  • Reafctor matching logic of import.meta, which uses strict to loose order to do matching after this PR.

🤖 Generated by Copilot at 93b2022

This pull request improves the handling of import.meta expressions in the JavaScript plugin for rspack. It refactors the scanning code, adds support for typeof import.meta, and fixes a possible conflict with import.meta.webpackHot. It also moves some functions to a more appropriate module.

Walkthrough

🤖 Generated by Copilot at 93b2022

  • Handle typeof import.meta and typeof import.meta.xxx expressions before other cases of import.meta and import.meta.xxx in ImportMetaScanner visitor to avoid conflicts and simplify code (link, link, link)
  • Add import.meta itself as a valid case for is_member_expr_starts_with_import_meta function and move it to import_meta_scanner.rs module to reduce imports and simplify logic (link)

@hyf0 hyf0 requested review from ahabhgk and h-a-n-a as code owners April 23, 2023 03:59
@changeset-bot
Copy link

changeset-bot bot commented Apr 23, 2023

⚠️ No Changeset found

Latest commit: 67acef8

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

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Apr 23, 2023
@hyf0 hyf0 requested review from underfin and removed request for h-a-n-a and ahabhgk April 23, 2023 04:05
@hyf0 hyf0 added this pull request to the merge queue Apr 23, 2023
Merged via the queue into main with commit 5232e3a Apr 23, 2023
@hyf0 hyf0 deleted the hyf_234892903489028390483 branch April 23, 2023 04:54
siyou pushed a commit to siyou/rspack that referenced this pull request May 14, 2023
…2872)

* refactor: align `starts_with` with the same semantics

* Fix

* Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants