Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sure, that's good advice. But all that stuff already happened here except for "complain enough".

Also I didn't realize lazy loading was a common need. Does that mean that awkward syntax is going to be everywhere? Surely there's a better way to get that, like with an import lazy keyword. Really anything would be better.



The `import<TModule>(url: string): Promise<TModule>` syntax/special function was what the TC39 committee agreed to for lazy/dynamic imports after much bikeshedding. It's a Stage 3 ES proposal [1], which means it is likely in the next ES spec version, and is already supported in some browsers and many tools (such as webpack).

[1] https://github.com/tc39/proposal-dynamic-import




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: