Skip to content

Commit afbd0ae

Browse files
jkodroffclaude
andauthored
Remove JavaScript examples from concepts documentation (#16516)
This removes all JavaScript code examples and choosable blocks from the concepts section while preserving TypeScript and other language examples. Updated 32 files to remove JavaScript choosable blocks and update language choosers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent 637604e commit afbd0ae

32 files changed

+73
-1111
lines changed

content/docs/iac/concepts/assets-archives.md

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,8 @@ There are three types of `Asset` objects:
3535
- `StringAsset`: The contents of the asset are read from a string in memory.
3636
- `RemoteAsset`: The contents of the asset are read from an `http`, `https` or `file` URI.
3737

38-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
38+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
3939

40-
{{% choosable language javascript %}}
41-
42-
```javascript
43-
let fileAsset = new pulumi.asset.FileAsset("./file.txt");
44-
let stringAsset = new pulumi.asset.StringAsset("Hello, world!");
45-
let remoteAsset = new pulumi.asset.RemoteAsset("http://worldclockapi.com/api/json/est/now");
46-
```
47-
48-
{{% /choosable %}}
4940
{{% choosable language typescript %}}
5041

5142
```typescript
@@ -111,19 +102,8 @@ variables:
111102
112103
Any of these assets can be passed to a resource accepting an `Asset` as input.
113104

114-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
115-
116-
{{% choosable language javascript %}}
117-
118-
```javascript
119-
let object = new aws.s3.BucketObject(`obj`, {
120-
bucket: bucket.id,
121-
key: key,
122-
source: fileAsset,
123-
});
124-
```
105+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
125106

126-
{{% /choosable %}}
127107
{{% choosable language typescript %}}
128108

129109
```typescript
@@ -204,20 +184,8 @@ There are three types of `Archive` objects:
204184
- `RemoteArchive`: The contents of the asset are read from an `http`, `https` or `file` URI, which must produce an archive of one of the same supported types as `FileArchive`.
205185
- `AssetArchive`: The contents of the archive are read from a map of either [`Asset`](#asset) or [`Archive`](#archive) objects, one file or folder respectively per entry in the map.
206186

207-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
208-
209-
{{% choosable language javascript %}}
187+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
210188

211-
```javascript
212-
let fileArchive = new pulumi.asset.FileArchive("./file.zip");
213-
let remoteArchive = new pulumi.asset.RemoteArchive("http://contoso.com/file.zip");
214-
let assetArchive = new pulumi.asset.AssetArchive({
215-
"file": new pulumi.asset.StringAsset("Hello, world!"),
216-
"folder": new pulumi.asset.FileArchive("./folder"),
217-
});
218-
```
219-
220-
{{% /choosable %}}
221189
{{% choosable language typescript %}}
222190

223191
```typescript
@@ -305,20 +273,8 @@ Note that a folder may be passed to `FileArchive` to construct an archive from t
305273

306274
Any of these archives can be passed to a resource accepting an `Archive` as input.
307275

308-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
276+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
309277

310-
{{% choosable language javascript %}}
311-
312-
```javascript
313-
let fn = new aws.lambda.Function(`fn`, {
314-
role: role.arn,
315-
runtime: "python3.7",
316-
handler: "hello.handler",
317-
code: fileArchive,
318-
});
319-
```
320-
321-
{{% /choosable %}}
322278
{{% choosable language typescript %}}
323279

324280
```typescript

content/docs/iac/concepts/components/_index.md

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,8 @@ To author a new component, either in a program or for a reusable library, create
3232

3333
Here's a simple component example:
3434

35-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
36-
37-
{{% choosable language javascript %}}
38-
39-
```javascript
40-
class MyComponent extends pulumi.ComponentResource {
41-
constructor(name, myComponentArgs, opts) {
42-
super("pkg:index:MyComponent", name, {}, opts);
43-
}
44-
}
45-
```
35+
{{< chooser language "typescript,python,go,csharp,java" >}}
4636

47-
{{% /choosable %}}
4837
{{% choosable language typescript %}}
4938

5039
```typescript
@@ -307,23 +296,8 @@ Component resources often contain child resources. The names of child resources
307296

308297
This example demonstrates both the naming convention and how to designate the component resource as the parent:
309298

310-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
311-
312-
{{% choosable language javascript %}}
313-
314-
```javascript
315-
class MyComponent extends pulumi.ComponentResource {
316-
constructor(name, myComponentArgs, opts) {
317-
super("pkg:index:MyComponent", name, {}, opts);
318-
319-
// Create Child Resource
320-
this.bucket = new aws.s3.Bucket(`${name}-bucket`,
321-
{}, { parent: this });
322-
}
323-
}
324-
```
299+
{{< chooser language "typescript,python,go,csharp,java" >}}
325300

326-
{{% /choosable %}}
327301
{{% choosable language typescript %}}
328302

329303
```typescript
@@ -443,27 +417,8 @@ Component resources can define their own output properties. Outputs in a compone
443417

444418
For example, this code registers an S3 bucket's computed domain name, which won't be known until the bucket is created:
445419

446-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
447-
448-
{{% choosable language javascript %}}
449-
450-
```javascript
451-
class MyComponent extends pulumi.ComponentResource {
452-
constructor(name, myComponentArgs, opts) {
453-
super("pkg:index:MyComponent", name, {}, opts);
454-
455-
this.bucket = new aws.s3.Bucket(`${name}-bucket`,
456-
{}, { parent: this });
457-
458-
// Registering Component Outputs
459-
this.registerOutputs({
460-
bucketDnsName: this.bucket.bucketDomainName
461-
});
462-
}
463-
}
464-
```
420+
{{< chooser language "typescript,python,go,csharp,java" >}}
465421

466-
{{% /choosable %}}
467422
{{% choosable language typescript %}}
468423

469424
```typescript
@@ -623,20 +578,8 @@ One option all resources have is the ability to pass an [explicit resource provi
623578

624579
To allow this, component resources accept a `providers` option that custom resources don't have. This value contains a map from the provider name to the explicit provider instance to use for the component resource. The map is used by a component resource to fetch the proper `provider` object to use for any child resources. This example overrides the globally configured AWS region and sets it to us-east-1. Note that `myk8s` is the name of the Kubernetes provider.
625580

626-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
627-
628-
{{% choosable language javascript %}}
629-
630-
```javascript
631-
let component = new MyComponent("...", {
632-
providers: {
633-
aws: useast1,
634-
kubernetes: myk8s,
635-
},
636-
});
637-
```
581+
{{< chooser language "typescript,python,go,csharp,java" >}}
638582

639-
{{% /choosable %}}
640583
{{% choosable language typescript %}}
641584

642585
```typescript

content/docs/iac/concepts/config.md

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,8 @@ For potentially-secret config, use {{< pulumi-config-getsecret >}} or {{< pulumi
108108

109109
Configuration methods operate on a particular namespace, which by default is the name of the current project. Passing an empty constructor to {{< pulumi-config >}}, as in the following example, sets it up to read values set without an explicit namespace (e.g., `pulumi config set name Joe`):
110110

111-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
111+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
112112

113-
{{% choosable language javascript %}}
114-
115-
```javascript
116-
let config = new pulumi.Config();
117-
let name = config.require("name");
118-
let lucky = config.getNumber("lucky") || 42;
119-
let secret = config.requireSecret("secret");
120-
```
121-
122-
{{% /choosable %}}
123113
{{% choosable language typescript %}}
124114

125115
```typescript
@@ -205,16 +195,8 @@ config:
205195

206196
To access a namespaced configuration value, such as one set for a provider library like `aws`, you must pass the library's name to the constructor. For example, to retrieve the configured value of `aws:region`:
207197

208-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
209-
210-
{{% choosable language javascript %}}
198+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
211199

212-
```javascript
213-
let awsConfig = new pulumi.Config("aws");
214-
let awsRegion = awsConfig.require("region");
215-
```
216-
217-
{{% /choosable %}}
218200
{{% choosable language typescript %}}
219201

220202
```typescript
@@ -268,7 +250,7 @@ variables:
268250
269251
Similarly, if you are writing code that will be imported into a broader project, such as your own library of [Pulumi components](/docs/concepts/resources/components/), you should instead pass your library's name to the {{< pulumi-config >}} constructor to limit the scope of the query to values prefixed with the name of your library:
270252
271-
{{< chooser language "javascript,typescript,python,go,csharp,java" >}}
253+
{{< chooser language "typescript,python,go,csharp,java" >}}
272254
273255
{{% choosable language typescript %}}
274256
@@ -286,22 +268,6 @@ class MyComponent extends pulumi.ComponentResource {
286268

287269
{{% /choosable %}}
288270

289-
{{% choosable language javascript %}}
290-
291-
```javascript
292-
class MyComponent extends pulumi.ComponentResource {
293-
constructor(name, args, opts) {
294-
super("mylib:index:MyComponent", name, args, opts);
295-
296-
// Read settings from the 'mylib' namespace (e.g., 'mylib:name').
297-
const config = new pulumi.Config("mylib");
298-
const name = config.require("name");
299-
}
300-
}
301-
```
302-
303-
{{% /choosable %}}
304-
305271
{{% choosable language python %}}
306272

307273
```python
@@ -415,17 +381,8 @@ For structured config, `true` and `false` values are persisted as boolean values
415381

416382
The `data` config can be accessed in your Pulumi program using:
417383

418-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
419-
420-
{{% choosable language javascript %}}
421-
422-
```javascript
423-
let config = new pulumi.Config();
424-
let data = config.requireObject("data");
425-
console.log(`Active: ${data.active}`);
426-
```
384+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
427385

428-
{{% /choosable %}}
429386
{{% choosable language typescript %}}
430387

431388
```typescript

content/docs/iac/concepts/functions/function-serialization.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,8 @@ Pulumi makes this easy by enabling you to create libraries and components that a
3737

3838
The following example shows how you can create an AWS Lambda function or an Azure function by providing a JavaScript callback that serves as its implementation.
3939

40-
{{< chooser language "javascript,typescript" >}}
40+
{{< chooser language "typescript" >}}
4141

42-
{{% choosable language javascript %}}
43-
44-
```javascript
45-
let bucket = new aws.s3.Bucket("mybucket");
46-
bucket.onObjectCreated("onObject", async (ev) => {
47-
// This is the code that will be run when the Lambda is invoked (any time an object is added to the bucket).
48-
console.log(JSON.stringify(ev));
49-
});
50-
```
51-
52-
{{% /choosable %}}
5342
{{% choosable language typescript %}}
5443

5544
```typescript

content/docs/iac/concepts/how-pulumi-works.md

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,8 @@ Like the language runtime itself, the SDKs are available as regular packages. Fo
5858

5959
Let's walk through a simple example. Suppose we have the following Pulumi program, which creates two S3 buckets:
6060

61-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
61+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
6262

63-
{{% choosable language javascript %}}
64-
65-
```javascript
66-
"use strict";
67-
const aws = require("@pulumi/aws");
68-
69-
const mediaBucket = new aws.s3.Bucket("media-bucket");
70-
const contentBucket = new aws.s3.Bucket("content-bucket");
71-
```
72-
73-
{{% /choosable %}}
7463
{{% choosable language typescript %}}
7564

7665
```typescript
@@ -188,21 +177,8 @@ Note the extra suffixes on the end of these bucket names. This is due to a proce
188177

189178
Now, let's make a change to one of resources and run `pulumi up` again. Since Pulumi operates on a desired state model, it will use the last deployed state to compute the minimal set of changes needed to update your deployed infrastructure. For example, imagine that we wanted to add tags to the S3 `media-bucket`. We change our program to express this new desired state:
190179

191-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
192-
193-
{{% choosable language javascript %}}
194-
195-
```javascript
196-
"use strict";
197-
const aws = require("@pulumi/aws");
198-
199-
const mediaBucket = new aws.s3.Bucket("media-bucket", {
200-
tags: {"owner": "media-team"},
201-
});
202-
const contentBucket = new aws.s3.Bucket("content-bucket");
203-
```
180+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
204181

205-
{{% /choosable %}}
206182
{{% choosable language typescript %}}
207183

208184
```typescript
@@ -325,20 +301,8 @@ The engine also receives a resource registration request for "content-bucket".
325301

326302
Now, suppose we rename `content-bucket` to `app-bucket`.
327303

328-
{{< chooser language "javascript,typescript,python,go,csharp,java,yaml" >}}
329-
330-
{{% choosable language javascript %}}
331-
332-
```javascript
333-
"use strict";
334-
const aws = require("@pulumi/aws");
335-
const mediaBucket = new aws.s3.Bucket("media-bucket", {
336-
tags: {"owner": "media-team"},
337-
});
338-
const appBucket = new aws.s3.Bucket("app-bucket");
339-
```
304+
{{< chooser language "typescript,python,go,csharp,java,yaml" >}}
340305

341-
{{% /choosable %}}
342306
{{% choosable language typescript %}}
343307

344308
```typescript

0 commit comments

Comments
 (0)