Closed nwidger closed 3 months ago
Yeah, please do submit a PR and I'll be happy to review it!
@bvaughn Awesome, thanks! I've just opened https://github.com/bvaughn/react-resizable-panels/pull/382.
If you're happy with the changes and merge the PR, would it be possible to make a new release containing the fix?
❤️ → ☕ givebrian.coffee
@bvaughn Thanks you so much, I really appreciate it!
Projects using this package and building with React <18 (the
useId
hook was introduced in React 18) andesbuild
v0.19.6 or new (v0.23.0 is the latest version) see an error similar to the following:It seems like starting with
esbuild
v0.19.6, the line here is minified from:to just:
and therefore is no longer sufficiently obfuscated. I believe this issue similar in nature to #82. It appears other projects facing similar issues have further obfuscated the reference to
React.useId
to:You can see this in action using the
esbuild
playground link below. Using the Version pulldown in the top-right you can see how the old version was sufficiently obfuscated up untilesbuild
v0.19.6, whereesbuild
apparently became smart enough to minify it to justReact.useId
.https://esbuild.github.io/try/#dAAwLjIzLjAALS1taW5pZnkALy8gY3VycmVudCB2ZXJzaW9uLCBtaW5pZmllcyB0byAiUmVhY3QudXNlSWQiClJlYWN0WyJ1c2VJZCIudG9TdHJpbmcoKV07CgovLyBwcm9wb3NlZCB2ZXJzaW9uLCBtaW5pZmllcyB0byAiUmVhY3RbYHVzZUlkJHtNYXRoLnJhbmRvbSgpfWAuc2xpY2UoMCw1KV0iClJlYWN0W2B1c2VJZCR7TWF0aC5yYW5kb20oKX1gLnNsaWNlKDAsIDUpXTs
Would you be opposed to further obfuscating this line using the
Math.random()
technique above? If so I would be happy to open a PR with the change. Thanks!