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

[Bug]: generateUidIdentifierBasedOnNode with JSX returning _objectObject #14418

Closed
1 task done
blaumeise20 opened this issue Apr 3, 2022 · 13 comments
Closed
1 task done
Assignees
Labels
good first issue i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: traverse

Comments

@blaumeise20
Copy link

💻

  • Would you like to work on a fix?

How are you using Babel?

babel-loader (webpack)

Input code

visitors: {
    JSXElement(path) {
        console.log(path.generateUidIdentifierBasedOnNode(path.node));
        // logs `_objectObject`
    }
}

Configuration file name

No response

Configuration

No response

Current and expected behavior

Logs _objectObject to the console, but should log _div when calling with <div></div>

Environment

  System:
    OS: macOS 10.15.7
  Binaries:
    Node: 17.7.2 - /usr/local/bin/node
    npm: 7.14.0 - /usr/local/bin/npm
  npmPackages:
    @babel/helper-plugin-utils: ^7.16.7 => 7.16.7 
    @babel/plugin-syntax-jsx: ^7.16.7 => 7.16.7 
    @babel/types: ^7.17.0 => 7.17.0 

Possible solution

Change

parts.push(node.name);
to call gatherNodeParts(node.name, parts).

Additional context

No response

@babel-bot
Copy link
Collaborator

Hey @blaumeise20! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@nicolo-ribaudo
Copy link
Member

Thanks for the bug report!

If it is the first time that you contribute to Babel, follow these steps: (you need to have make and yarn available on your machine)

  1. Write a comment there to let other possible contributors know that you are working on this bug.
  2. Fork the repo
  3. Run git clone https://github.com/<YOUR_USERNAME>/babel.git && cd babel
  4. Run yarn && make bootstrap
  5. Wait ⏳
  6. Run make watch (or make build whenever you change a file)
  7. Add a test in packages/babel-traverse/test/scope.js (it looks like we don't have any test for that function yet, it's only tested in transform fixtures)
  8. Update the code!
  9. yarn jest traverse to run the tests
  10. If it is working, run make test to run all the tests
  11. Run git push and open a PR!

If you have any questions, feel free to ask!

@SophonieBouye
Copy link

Hi @nicolo-ribaudo , it's still possible to work on this issue ?

@blaumeise20
Copy link
Author

Wow, I forgot that. I will try to fix it as soon as I can!

@SophonieBouye
Copy link

Okay Nice 🚀

@AnmolBansalDEV
Copy link

Can I work on this issue?

@blaumeise20
Copy link
Author

If you want ofc! I don't have much time anyways 😀

@SophonieBouye
Copy link

@AnmolBansalDEV are you take it?

@AnmolBansalDEV
Copy link

yes! was busy that's why couldn't reply

@AnmolBansalDEV
Copy link

hey, I went through the file, the proposed change has already been applied

@JLHwung
Copy link
Contributor

JLHwung commented Aug 10, 2022

@AnmolBansalDEV You are right. It has been fixed in #14648, specifically mentioned in #14648 (comment).

Closing it as it has been fixed in another PR.

@JLHwung JLHwung closed this as completed Aug 10, 2022
@AnmolBansalDEV
Copy link

Thank you for replying, although the issue is resolved. I'm new to open source, and few weeks into it I'm feeling lost. Can you guide me please .
Thank you!

@SophonieBouye
Copy link

SophonieBouye commented Aug 24, 2022

@AnmolBansalDEV read the contribution rules and just take a issue and work on it ;)

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 24, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: traverse
Projects
None yet
Development

No branches or pull requests

7 participants