Coder Social home page Coder Social logo

shubhamverma1811 / vscode-react-outline Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 2.0 856 KB

A VSCode extension support for symbols and outlines for a React file.

Home Page: https://marketplace.visualstudio.com/items?itemName=ShubhamVerma18.react-outline

License: MIT License

TypeScript 100.00%
hacktoberfest react vscode vscode-extension

vscode-react-outline's Introduction

Hey there, I'm Shubham Verma! ๐Ÿ‘‹

A passionate self-taught Frontend Developer from India.

  • ๐Ÿ’ป Currently I am Senior Software Engineer - I at GeekyAnts
  • ๐Ÿ’ฌ Ask me about JavaScript, React
  • ๐Ÿ˜„ Pronouns: He / Him
  • โšก Fun fact: I can solve Rubik's Cube in under 2 minutes ๐Ÿ˜Ž

Recent Blog posts

Connect with me

Twitter | LinkedIn | Cal.com

Languages and Tools:

Languages

TypeScript JavaScript SCSS CSS HTML Python

Frontend

ReactJS NextJS Redux VueJS TailwindCSS NuxtJS Markdown Material UI React Router

Backend

ExpressJS NodeJS Netlify Heroku

Databases

Firebase PostgresSQL

vscode-react-outline's People

Contributors

shubhamverma1811 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kiko915 ayush10

vscode-react-outline's Issues

Native JSX parsing with TS

Hey! Your extension has two downsides:

  • it creates second tree, instead of integrating nodes into one united
  • it does unnecessary parsing work, so when you type a character, outline gets evaluated twice: TypeScript builtin support & your extension

When sticky scroll came out (that uses outline), I started to investigate how to make TypeScript see these JSX nodes natively, and I came with an easy solution:

https://github.com/zardoy/typescript-vscode-plugins/blob/ec33dc3f71ac0e92815aa845d7f56eaeacf6b5dd/typescript/src/getPatchedNavTree.ts#L22

You can check it, it works natively like a charm! (I've been using it for a few weeks)

I even made a post about it

I'd say that I contribute, but I think it'd fun to you to play with it and you can copy it yourself!
However I didn't add support for JSXFragment, but that's three lines of code!

Feel free to ask any kind of questions, I'd be happy to help you!

Handle JSX in props

The following condition is not handled, and it needs to be parsed.

<Input 
renderRight={<Box>...</Box>}
{...props}
/>

or

<Input 
renderRight={() => <Box>...</Box>}
{...props}
/>

Handle Call Expressions - map,filter

The following code wont be parsed as of now.

All the JSX should be detected i.e Hey and Box, in this case

{[].map(i => {
 
 if(someThing) {
  return <Hey/>
}

  <Box>...</Box>
}}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.