Skip to content

Support "function-like" import() #12933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jmalonzo opened this issue Dec 15, 2016 · 2 comments
Closed

Support "function-like" import() #12933

jmalonzo opened this issue Dec 15, 2016 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@jmalonzo
Copy link

The proposal for function-like import() is currently in stage-3, and I think it'd be nice if Typescript will support it in future versions.

For example, one such project that already supports it is webpack which checks for import() as a code-splitting construct (deprecating System.import in v2 and replacing it altogether in v3).

TypeScript Version: 2.0.10

Code

// A *self-contained* demonstration of the problem follows...

import('page/profile').then(() => /* load route */ );

Expected behavior:
The compiler allows the dynamic import syntax as above.

Actual behavior:
-> error TS1128: Declaration or statement expected.

@normalser
Copy link

#12364

@jmalonzo
Copy link
Author

Thanks @wallverb

@mhegazy mhegazy added the Duplicate An existing issue was already created label Dec 15, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants