alangpierce/sucrase

How to remove `__source` and other double underscored attributes?

renhiyama opened this issue ยท 2 comments

Since I am using sucrase along with preact + htm, It just works, except htm seems to render those not-needed attributes...
image
I would prefer to not show these attributes in the first place, rather than running a loop over every element to remove those attributes...

Hi @renhiyama , you can avoid the __source props by passing production: true in the Sucrase options. Sorry, the README docs don't mention that option right now, I'm planning to add it soon. Hope that helps!

Thanks, it works! Also cheers on making this fast asf parser! Its lightweight + works over esm.sh! Ree.js - a new framework that focuses on "no building" will be happy to use this in memory (with caching). To top it off, Sucrase is so fast that it starts serving jsx and others in less than 1 sec, compared to other frameworks taking atleast 10 secs! Sucrase is really some god level parser for sure!