I was also curious, why are there so many variatio...
# typescript
m
I was also curious, why are there so many variations for types? I seems to really slow down vscode.
l
What kind of variations are you thinking of?
m
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
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
Yeah it works just extremely slow. Other projects are fine and I see this behavior with a new pulumi project.
l
Even if you have only one import statement?
m
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
It doesn’t look like you’re importing from a specific version though ^
l
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
I will try a version but it seems weird how that would perform better.
l
No Brion, I tried and it was still quite slow. I was agreeing with you.