bake:devbuggood first issue
描述
What version of Bun is running?
1.2.5-canary.70+8a177f6c8
What platform is your computer?
Darwin 24.3.0 arm64 arm
What steps can reproduce the bug?
Set up a Bun + React web app with HTML imports and HMR.
Bun.servewithroutesimport index from './index.htmlroutes: { '/': index }bun add react react-dom<script src="index.tsx"></script>import React from 'react; import ReactDOM from 'react-dom/client; ReactDOM.render(document.body, <App />export default function App() { return (<div className={App.name}>TODO</div>) }
What is the expected behavior?
class="App"
What do you see instead?
class="App2"
Additional information
This really seems like a problem to me, because these names are programmer-originated and the bundler shouldn't mangle them the same way it shouldn't mangle any other identifier it cannot be sure isn't used outside of JS (e.g. there is no minification of data attribute names because they could have meaning in CSS selectors).