zthxxx / react-dev-inspector

jump to local IDE code directly from browser React component by just a simple click
https://react-dev-inspector.zthxxx.me
MIT License
1.16k stars 68 forks source link

feat: add feature of jumping to the place of reference #20

Closed nzreal closed 3 years ago

nzreal commented 3 years ago
  1. add feature of jumping to the place of reference
  2. separate the logic of getting codeInfo from components and normal nodes
  3. gitignore history
zthxxx commented 3 years ago

@nzreal I have try this PR (61bbc7a) in local dev, but it seems also CANNOT work while click on div,p,span, etc.

zthxxx commented 3 years ago

@nzreal I have try this PR (61bbc7a) in local dev, but it seems also CANNOT work while click on div,p,span, etc.

example click <Keypress> like here

image

zthxxx commented 3 years ago

after fix: special handling ... forwardRef(a7f5ec2), actually it will jump when click <Keypress>Ctrl</Keypress>,

but the jump position is as same as before, in Keypress component return code <S.KeyTone>, like master branch.

image

nzreal commented 3 years ago

image @zthxxx It's a special example that it dosen't work well on Context or forwardRef components. But It will work correctly when click normal components, such as the repo i offered you before. I'm finding out all of the special situations and figuring out how to deal with the special situation stably

zthxxx commented 3 years ago

@nzreal Thanks for your great work, could you just add (or change) a demo component in ./sites/umi3/src ?

nzreal commented 3 years ago

@zthxxx you're welcome image

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/zthxxx/react-dev-inspector/A8tKrRmw9xVa6384uuwfEPSxcdW2
✅ Preview: https://react-dev-insp-git-fork-nzreal-improve-inspect-the-place-9c2b25.vercel.app

zthxxx commented 3 years ago

@nzreal thanks a lot! I see your demo commit so I see what you means, and I pushed a commit to adjust demo components style, so we can test this feature with origin <Keypress> component which we use it for example a lot.

One more things, I add Vercel preview deploy for all PR, so that we can review this feature with an online demo site, see:

image

nzreal commented 3 years ago

@zthxxx wow, that's cool. Next enhancement version i can use it to review

zthxxx commented 3 years ago

in reviewing

zthxxx commented 3 years ago

@nzreal if you review and confirm after 95970d0 , I will merge this PR

nzreal commented 3 years ago

image the fiber may be empty, so i add a logic to judge that

nzreal commented 3 years ago

the fiber may be empty, so i add a logic to judge that

@nzreal for example?

image image

zthxxx commented 3 years ago

the fiber may be empty, so i add a logic to judge that

@nzreal sorry, i found that's types error, and fixed in dfd2b22, please review again

before:

image

after:

image