You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are small changes that not necessary related to the proposal: like change name from IncrementExpression to UpdateExpression (this is so that it is consistent with ES6 spec); small update on comment
TODO
Address declaration emit.... Current it will be an error when emit .d.ts, users will have to explicitly specify type of the dynamic import
Add more tests for noImplicitAny, specifier not string type, more emit tests
Document about how dynamic import behave with webpack and browserify
Note: this PR need #14692 so that baselines can be updated correctly..See (tests/cases/conformance/es2018/dynamicImport/importCallExpressionInAMD3.ts as example) compiler will throw exception when trying to write type of extendheritageclause
Note: ImportCallExpression is simply parse as CallExpression (similar to super call)
Also dynamic import can be parsed with type argument, it doesn't do anything at the moment (we can either error or that can be used for other purpose)
@filipesilva thanks for the document!. For webpack users it will probably be best to have module be ES2018 so that we don't downlevel emit and webpack2 can correctly support dynamic import
Correction: it will ESNext instead of ES2018....Also even using with esnext and not downlevel emit, webpack will not allow dynamic name....The benefit of not downlevel with webpack seems to be in that webpack will do code-splitting
@yuit so is this going to be forthcoming in the next TypeScript release? 2.3.4 complains about import() even with target of esnext. Not sure if I'm missing something.
@yuit so is this going to be forthcoming in the next TypeScript release? 2.3.4 complains about import() even with target of esnext. Not sure if I'm missing something.
this will be in TS 2.4. you can give it a try today in typescript@next
@trotyl Thanks. That helps me only to the extent that i know that i actually targetted ECMAScript 2015 modules. It doesn't tell me what my tsconfig.json should look like. Simply changing the module compiler option to es2018 results in the same error.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
11 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#14495
IncrementExpression
toUpdateExpression
(this is so that it is consistent with ES6 spec); small update on commentTODO
Address declaration emit.... Current it will be an error when emit .d.ts, users will have to explicitly specify type of the dynamic import
Add more tests for noImplicitAny, specifier not string type, more emit tests
Update baselines'
Update breaking change. https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes. Use termUpdateExpression
instead ofIncrementExpression
Document about how dynamic import behave with webpack and browserify
Note: this PR need #14692 so that baselines can be updated correctly..See (tests/cases/conformance/es2018/dynamicImport/importCallExpressionInAMD3.ts as example) compiler will throw exception when trying to write type of extendheritageclause
Note: ImportCallExpression is simply parse as CallExpression (similar to super call)
Also dynamic import can be parsed with type argument, it doesn't do anything at the moment (we can either error or that can be used for other purpose)