https://pulumi.com logo
#typescript
Title
# typescript
m

melodic-easter-82419

04/20/2021, 8:38 PM
I was also curious, why are there so many variations for types? I seems to really slow down vscode.
l

little-cartoon-10569

04/20/2021, 9:23 PM
What kind of variations are you thinking of?
m

melodic-easter-82419

04/20/2021, 10:18 PM
For
@pulumi/azure-native
, I see a lot of types that seems to be duplicates? These seem to be version specific. Is the idea supporting multiple azure apis in the azure-native package?
Copy code
import * as v20150801 from "./v20150801";
import * as v20150801preview from "./v20150801preview";
import * as v20160301 from "./v20160301";
import * as v20160601 from "./v20160601";
import * as v20160801 from "./v20160801";
import * as v20160901 from "./v20160901";
import * as v20180201 from "./v20180201";
import * as v20181101 from "./v20181101";
import * as v20190801 from "./v20190801";
import * as v20200601 from "./v20200601";
import * as v20200901 from "./v20200901";
import * as v20201001 from "./v20201001";
import * as v20201201 from "./v20201201";
This seems to cause confusion for the typescript server and I see extremely long load times for intellisense
l

little-cartoon-10569

04/20/2021, 10:36 PM
Yes this is intentional, so you can lock your native api to a specific version. You should import only one of those. If you're not sure, then go with the base package, which maps to "latest".
So long as you import only one version of the API (or maybe 2 or 3, if you need different versions for different resources), then IntelliSense should go fine.
m

melodic-easter-82419

04/20/2021, 10:40 PM
Yeah it works just extremely slow. Other projects are fine and I see this behavior with a new pulumi project.
l

little-cartoon-10569

04/20/2021, 10:43 PM
Even if you have only one import statement?
m

melodic-easter-82419

04/20/2021, 10:58 PM
Yes I actually import a single resource at a time. So something like
Copy code
import { ResourceGroup } from "@pulumi/azure-native/resources";
import { Vault, Secret } from "@pulumi/azure-native/keyvault";
import { WebApp, AppServicePlan } from "@pulumi/azure-native/web";
r

red-match-15116

04/20/2021, 11:23 PM
It doesn’t look like you’re importing from a specific version though ^
l

loud-helicopter-75345

04/21/2021, 12:34 PM
e.g.
import {ResourceGroup} from '@pulumi/azure-native/resources/v20210101'
However Brion Fuller is correct. I just tried adding
@pulumi/azure-native
and vs-code has become a LOT less responsive without even adding a single import statement.
m

melodic-easter-82419

04/26/2021, 8:32 PM
I will try a version but it seems weird how that would perform better.
l

loud-helicopter-75345

04/26/2021, 8:40 PM
No Brion, I tried and it was still quite slow. I was agreeing with you.