swc-project / swc

Rust-based platform for the Web
https://swc.rs
Apache License 2.0
31.29k stars 1.23k forks source link

fix(es/resolver): Skip resolving lowercase `JSXIdentifiers` #9686

Closed magic-akari closed 3 weeks ago

magic-akari commented 3 weeks ago

Related issue:

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: a5a0bc1327b019c94f3ead76a2bc87b0f41cae01

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

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

magic-akari commented 3 weeks ago

I'm not sure if I'm going in the right direction. Because the JSX Spec does not include discussions on lowercase. This is the behavior of React (and also other JSX implementations like Vue).

I'm curious if there's a JSX implementation that ignores case sensitivity and always resolves variables. If such a scenario existed, it would clash with React's approach, necessitating a rewrite of form.input.

What do you think? @kdy1

codspeed-hq[bot] commented 3 weeks ago

CodSpeed Performance Report

Merging #9686 will not alter performance

Comparing magic-akari:fix/issue-9685 (a5a0bc1) with main (4b4dcfa)

Summary

✅ 194 untouched benchmarks

kdy1 commented 3 weeks ago

IIRC, form.input is resolved as a form variable while form is not resolved. I'm not sure if this is the expected behavior according to the specifications.

kdy1 commented 3 weeks ago

@magic-akari FYI, https://chatgpt.com/c/67218e39-87cc-8007-9af6-e396ec65c420

magic-akari commented 3 weeks ago

@magic-akari FYI, https://chatgpt.com/c/67218e39-87cc-8007-9af6-e396ec65c420

Any conclusions?

Unable to load conversation 67218e39-87cc-8007-9af6-e396ec65c420

kdy1 commented 3 weeks ago

IMG_3467

I think the direction of the patch is correct

kdy1 commented 3 weeks ago

Thank you!