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

Babel plugins (source mapping) #1252

Open
1 of 2 tasks
getflourish opened this issue Mar 9, 2025 · 0 comments
Open
1 of 2 tasks

Babel plugins (source mapping) #1252

getflourish opened this issue Mar 9, 2025 · 0 comments
Labels
triage New issues that needs consideration

Comments

@getflourish
Copy link

getflourish commented Mar 9, 2025

Tell us how you think we can improve Sandpack

Enable @babel/plugin-transform-react-jsx-source

Packages affected

  • sandpack-client
  • sandpack-react

What is this feature?

I would like users to click on React nodes in SandpackPreview and then highlight the code in the SandpackCodeEditor

Similar to Svelte’s inspector:
https://x.com/rich_harris/status/1636444006635716627

For this, there’s this library:
https://github.com/ericclemmons/click-to-component

But it relies on a Babel plugin:
@babel/plugin-transform-react-jsx-source

How would your idea work?

I assume I would need to be able to customize the Babel config, or make this an explicit feature of Sandpack?

babel.config.js

{ "plugins": ["@babel/plugin-transform-react-jsx"] }

@getflourish getflourish added the triage New issues that needs consideration label Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New issues that needs consideration
Projects
None yet
Development

No branches or pull requests

1 participant