jsx / JSX

JSX - a faster, safer, easier JavaScript
http://jsx.github.io/
MIT License
1.46k stars 102 forks source link

Lazy load for native class binding #156

Open gfx opened 11 years ago

gfx commented 11 years ago

Lazy loading for native class binding is necessary to use native(...) in the JSX compiler itself. That is, the web compiler try to require node modules but it always fails.

kazuho commented 11 years ago

IMO this should be (can be) handled by #157, although I wonder if always stripping unused code is a good idea.

OTOH, why don't you use try-catch inside the native(...) attribute to defer the problem being detected? The JavaScript expression within the native(...) attribute may return null if the load failed.