Readit News logoReadit News
Posted by u/jsunderland323 a month ago
Launch HN: JSX Tool (YC F25) – A Browser Dev-Panel IDE for React
Hi HN, We’re Jamie & Dan, building JSX Tool (https://jsxtool.com) a new inspector/dev panel IDE that allows you to navigate to any line of your React project’s JSX with just a click and a command click to explore your render stack.

Demo video: https://www.youtube.com/watch?v=JIIXvN7vhrs

I’ve been writing React code for nearly a decade. Since I first saw source maps in the days of Babel and Redux, I’ve always wanted to be able to edit my code from the source maps. I’ve also always wanted to be able to inspect my JSX like it was HTML.

Last year, I found my first real use of AI was taking ad-hoc CSS changes in the Chrome element inspector, pasting them into ChatGPT, and asking for the equivalent in Tailwind. I’d then paste those changes into my React TSX files.

I wanted to streamline this process but came to the conclusion that to do so I needed to build a JSX inspector. I had to write a custom AST parser to create a mapping between the JSX and HTML. So I hacked on an inspector for a couple of months that connected JSX to the DOM in both directions.

The next feature was adding a CSS editor, like the one in the browser inspectors but for JSX. Unlike styling a piece of HTML I decided that any in memory style edits to a React fiber should be globally applied, as if you had tweaked that line of code in your codebase.

Finally, I was able to add the two AI features I really wanted: (1) prompt for in-memory styles for when I was pixel tweaking, and (2) save those temporary changes back to my codebase in the convention of the codebase I was working in.

To accomplish talking to the filesystem from the Chrome extension I built a little local server that mounts from the root of your project and allows the extension to send file-system commands back to your project root. We named this the “Dev Server”. (Note: You can fully use us as a JSX inspector without this server installed.)

After all that, I found that to convert myself as a user I needed it to be a pretty fully functional IDE. I needed vim bindings, I needed a typechecker, I needed auto-complete, I needed a linter, I needed code search and I needed a proper file explorer. Fortunately we were able to take advantage of the dev-server architecture we had stumbled onto in order to add an LSP server and Rip Grep. At this point, after months of dog fooding, I use JSX Tool for almost all of my website edits.

We’re still rough around the edges for mobile but we’re working on that.

All of the IDE stuff not involving AI is free and works fine without AI. We let you get a taste of the prompting stuff for free but apply some rate limits.

The extension itself is not open source but the dev server with the LSP is. It’s a great foundation if you want to build any sort of in-browser IDE and it's nearly React agnostic. Building the dev server was a big undertaking so I’d love to see someone fork it and find value in it.

In the future we want to start adding things that we are in a position to take advantage of over something like Cursor, such as letting AI give you code suggestions for runtime exceptions or work with the network logs. We think that the convenience of having your IDE in the dev panel gives us a leg up in convenience and workflow context.

Anyway, regardless of how you feel about AI coding, I wanted to make something that was useful with or without AI. We’d love it if you gave it a spin and we want to share anything we can about the technical side of the product that you might find interesting.

onion2k · a month ago
I have no doubt this could be a useful tool given the nice looking UX, but everything it does is already in Devtools.

If you open Devtools, then click "Sources", there are two options in the left panel 'Page' and 'Workspace'. Change to workspace and add the folder where your project lives. Now you can edit the code for your React (or anything else) project in Devtools and it'll save to your filesystem. You can make this a part of the project if you want to - https://chromium.googlesource.com/devtools/devtools-frontend...

Gemini is integrated into the Sources panel, so I just opened a JSX file and asked what classes I'd use in Tailwind to replace my CSS and it told me the right answer. It didn't update the code though. That 'Apply Edits' feature in jsxtool would be useful for a non-dev user.

chrisweekly · a month ago
Excited to try this! I think you're really onto something w your insight about advantages of IDE in devtools context. I've been doing React about a decade too (and webdev since 1998), and this really resonates.
jsunderland323 · a month ago
Aw thanks so much. I knew there had to be some folks whom this would resonate with.

I'm excited for you to try it out too! Please let me know how it goes

zaksingh · a month ago
Congrats on the launch! I think this has a lot of potential in eliminating context-switching. DevTools has always felt unintuitive/unfamiliar coming from an IDE, so just bringing the IDE UX and vim keybindings over is already a big improvement. It also makes LLM prompting feel better contextualized.

As an aside, thinking back to learning React seven or eight years ago by watching a bunch of tutorial videos where they'd switch between IDE and browser views or awkward split screens, this seems like a way better format for explainers/walkthroughs of frontend code.

jsunderland323 · a month ago
Haha. I had the same thought. I told my mom if it doesn’t work out for developers I can always pitch it as a tool to teach people React.

Thanks for the comment man!

csomar · a month ago
I am failing to get it work on a "custom" setup. I run my own server with localhost pointed to the domain, with HTTPS on locally generated certificates.

I tried

    npx @jsx-tool/jsx-tool start --logging --server-host codeinput.com --server-protocol https --server-port 443 --insecure
but got

    [jsx-tool] Proxy server running at http://localhost:4000
    [jsx-tool] Forwarding to https://codeinput.com:443
    [jsx-tool] WebSocket server listening on ws://localhost:12021
    [jsx-tool] LSP worker exited with code 1
    [jsx-tool] Restarting LSP worker...
    [jsx-tool] LSP worker already started
    (node:7881) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    [jsx-tool] Proxy error: unable to verify the first certificate; if the root CA is installed locally, try running Node.js with --use-system-ca
    [jsx-tool] Proxy error: unable to verify the first certificate; if the root CA is installed locally, try running Node.js with --use-system-ca
Maybe you should explain a bit what the server does and what it needs to connect to? why does it need some kind of a "proxy"? I understand you are trying to make a simple one click/command solution but some setups are more complicated than the standard yarn dev nextjs app.

jsunderland323 · a month ago
Hey csomar. If you switch over to discord I can work through it with you there.

> I understand you are trying to make a simple one click/command solution but some setups are more complicated than the standard yarn dev nextjs app.

I agree our docs are totally lacking on the more advanced dns setups! I'm so sorry.

> Maybe you should explain a bit what the server does and what it needs to connect to? why does it need some kind of a "proxy"?

If you don't do the manual installation where you point to the web-socket server in your <head>, it will inject that tag into your <head> tag. The web socket it how the chrome extension communicates with your file system.

You don't need the proxy for most things. It's fine to continue to just use codeinput.com as long as you have a way of making the websocket url discoverable to the extension.

The only other use case for the proxy is if you are on a page that has over 10k react fibers and are not using vite. This comes up a lot in things like CRMs or Next projects with a lot of 3rd party dependencies. In that case we have to find and replace a part of the react source that limits the number of React Fibers with source maps from 10k to 1m.

I tried to give a system design overview here but I will be the first to admit that it's pretty lacking https://jsxtool.com/docs/dev-server/system-design

polishdude20 · a month ago
This is exactly what I was looking for the other day! I'm very happy you guys are working on this because I can see a lot of potential. My main use case is just finding which element in my code controls which element in the browser when I hover over it.

My current workflow is to be in the dev tools, find the element I want to edit, edit the CSS to see if it looks how I want, copy the classname and html to then search in my codebase and make the exact same change there.

mundial2k2 · a month ago
I first tried to install the chrome extension. Got things up and running with vite. Thought maybe i needed a subscription to be able to use the AI features - tried that. But still, no matter what i do everything works nicely, except for the submit button in the chrome extension for sending query to AI - no matter if i add own models or use existing. And now with credits as well, no joy.

Known thing?

Seen through documentation, tried all i can see. Even tried getting into the discord channel, but that was invalid as well..

dahyman · a month ago
So sorry about your experience. There is a new link to the discord channel being deployed right now.

I'd recommend ensuring you're on the latest version, as we just deployed some bug fixes. If you continue to run into problems opening your app on a new tab and then opening the extension on that tab is usually the fix.

Hopefully chat with you soon on discord!

copypaper · a month ago
This looks awesome!

>I needed it to be a pretty fully functional IDE. I needed [IDE feature]...

I'm just curious, why didn't you make this as a VS Code plugin to benefit from all the features of an IDE? I'd imagine you could do something similar to the Live Server plugin. That way you could support any browser and not worry about maintaining the IDE features.

jsunderland323 · a month ago
We actually do have a VSCode plugin we built a couple of months ago. It's a sort of a gnarly install if you run our dev-server from a docker container (which we do), so we shelved it. We dog food everything before putting it out. There's some cleanup we need to do before we publish it but it's coming.

> I'm just curious, why didn't you make this as a VS Code plugin to benefit from all the features of an IDE?

What I was trying to articulate is that I want is to write code in my dev-panel. I don't want to switch panes to an IDE for frontend tweaking. Of course there are times that I do want to switch to my IDE, which is why we developed the VSCode extension that is coming.

> I'd imagine you could do something similar to the Live Server plugin. That way you could support any browser and not worry about maintaining the IDE features.

This may turn out to be the right approach in the end. I've just explored the one avenue that you see today but I could be totally wrong and you might be right that the embedded browser in the IDE approach is the way to go.

copypaper · a month ago
Regardless of which approach ends up being right, the tool itself is amazing. Best of luck with it!
apsurd · a month ago
Came here to say something critical because modern front-end dev is a self-inflicted hellscape.

I watched the video and "deving from the UI" makes sense! Instantly get the value. Pretty cool!

It's another hurdle as to whether I'm really going to pay the switching cost of changing my dev flow, but it is a very intuitive and compelling proposition. well done.

jsunderland323 · a month ago
I walk into everything ready to be hyper critical, so thanks so much for saying that.

In my experience, I found the switching cost to be low for things like copy changes and css stuff (or lower than I expected). Obviously I am incentivized more than anyone else to use it but it’s actually painful to go to an IDE to make those small changes after you get used to it.

I don’t realistically expect anyone to use us as a full IDE yet. It’s got a ways to go but for simple things, it’s awesome. We’re going to keep chipping away though.