logoalt Hacker News

frodowtf2 • today at 4:19 PM • 3 replies • view on HN

Is there any reason to not enable it globally?


Replies

zem • today at 9:38 PM

the main reason is import-time side effects, particularly intentional ones like the registry pattern.

also let me plug my work project, an analyser which will scan your code and see where it can safely enable lazy imports (tagged alpha, but we did our best to get a usable release out before 3.15 landed): https://github.com/Facebook/lifeguard

ris • today at 9:27 PM

Completely nondeterministic import order affected by code execution patterns?