petehunt / node-jsx

transparently require() jsx from within node
164 stars 32 forks source link

performance: add options.checkDocblock to check existance of docblock before transforming #32

Closed nemtsov closed 8 years ago

nemtsov commented 9 years ago

This change will optionally check the @jsx React.DOM docblock prior to transforming. This is disabled by default and enabled via the checkDocblock option.

Motivation: I have a fairly large app with many dependencies. Without this change, it takes up to 4 seconds to React.transform all of the .js files. With checkDocblock enabled it takes approx. 700ms.

As an alternative, it would have been possible to rename all of the jsx files to use the .jsx extension and set the extension options; but I prefer not to do that yet and keep the .js extension.