cmseguin / rollup-plugin-react-scoped-css

A rollup plugin designed to allow scoped css to be run in react (Compatible with vite and rollup)
38 stars 6 forks source link

fix: handle array destructuring with unbound elements #43

Closed hgwood closed 1 year ago

hgwood commented 1 year ago

Hello, and thank you for making rollup-plugin-react-scoped-css, which I've started using to migrate some apps from create-react-app to vite.

Array destructuring with unbound elements (eg let [, b] = [1, 2]) yields AST nodes which are null. rollup-plugin-react-scoped-css would crash on such nodes because it always calls Object.keys on AST nodes. This is a fix for such situations. It might cover other cases where acorn yields null AST nodes.

I hope you find it useful!

cmseguin commented 1 year ago

That makes a lot of sense! Let me know if you find anything else!

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 0.8.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

hgwood commented 1 year ago

Thank you very much for the quick release!