Skip to content

Add support for Typescript 3.2 #13226

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

Merged
merged 5 commits into from
Dec 19, 2018
Merged

Add support for Typescript 3.2 #13226

merged 5 commits into from
Dec 19, 2018

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Dec 19, 2018

  • Update to TypeScript 3.2

  • fix(@ngtools/webpack): import as results in the alias being undefined with Typescript 3.2

When using the specifier.propertyName with typeChecker.getSymbolAtLocation it will return a more detailed symbol then we originally have in the usedSymbols set.

We should probably use symbol.id to actually check if the symbols are the same, however the id is not exposed in the Symbol interface.

Using node.name will return the same symbol that we have stored in the set.

Fixes #13212

@alan-agius4 alan-agius4 changed the title Feat typescript 3.2 Add support for Typescript 3.2 Dec 19, 2018
@ngbot
Copy link

ngbot bot commented Dec 19, 2018

Artifact Baseline Current Change
cli/new-production/test-project/main.js 174.25KB 175.29KB +1.04KB

@alan-agius4
Copy link
Collaborator Author

The 1Kb size change is due to the Angular 7.2 upgrade.

@angular angular deleted a comment from ngbot bot Dec 19, 2018
@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Dec 19, 2018
Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you ensure that the two special cases in the isUsed call still work? (Exporting the alias and using the alias as an object literal shorthand). They both use the text of the node but the name node has the original name and not the alias name.

@clydin
Copy link
Member

clydin commented Dec 19, 2018

Actually we could probably clean that up some and grab the aliased symbol if present when looping through the file.

@alan-agius4
Copy link
Collaborator Author

@clydin I have added some more tests, can you check if that's the tests you had in mind?

Alan Agius added 2 commits December 19, 2018 15:26
…ed with Typescript 3.2

When using the `specifier.propertyName` with `typeChecker.getSymbolAtLocation` it will return a more detailed symbol then we originally have in the `usedSymbols` set.

We should probably use `symbol.id` to actually check if the symbols are the same, however the `id` is not exposed in the Symbol interface.

Using `node.name` will return the same symbol that we have stored in the set.

Fixes #13212
Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, let's get this in and then followup with improved testing and a potential cleanup of the special cases.

@mgechev mgechev merged commit 24d9318 into angular:master Dec 19, 2018
@alan-agius4 alan-agius4 deleted the feat_typescript_3.2 branch December 19, 2018 19:17
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import as results in the alias being undefined with Typescript 3.2
5 participants