Skip to content

Commit 3f8dd33

Browse files
authored
docs #3758
1 parent 9a9152b commit 3f8dd33

File tree

3 files changed

+46
-27
lines changed

3 files changed

+46
-27
lines changed

CONTRIBUTING.md

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,6 @@ As a simple example, let's say I wanted to add a new icon for CloudWatch log str
374374
getIcon('aws-cloudwatch-log-stream')
375375
```
376376

377-
### Beta artifacts
378-
379-
The Toolkit codebase contains logic in `src/dev/beta.ts` to support development during private betas. Creating a beta artifact requires a _stable_ URL to source Toolkit builds from. This URL should be added to `src/dev/config.ts`. Subsequent Toolkit artifacts will have their version set to `1.999.0` with a commit hash. Builds will automatically query the URL to check for a new build once a day and on every reload.
380-
381377
### VSCode Marketplace
382378

383379
The [marketplace page](https://marketplace.visualstudio.com/itemdetails?itemName=AmazonWebServices.aws-toolkit-vscode)
@@ -392,21 +388,9 @@ Note therefore:
392388
2. `HEAD` implies that the URL depends on the current _default branch_ (i.e.
393389
`master`). Changes to other branches won't affect the marketplace page.
394390

395-
## Using new vscode APIs
396-
397-
The minimum required vscode version specified in [package.json](https://github.com/aws/aws-toolkit-vscode/blob/07119655109bb06105a3f53bbcd86b812b32cdbe/package.json#L16)
398-
is decided by the version of vscode running in Cloud9 and other vscode-compatible targets.
399-
400-
But you can still use the latest vscode APIs, by checking the current running vscode version. For example, to use a vscode 1.64 API:
401-
402-
1. Check the vscode version: `semver.gte(vscode.version, '1.64.0')`
403-
2. Disable the feature if is too old. That could mean just skipping the code entirely, or showing a different UI.
404-
405-
Full example: https://github.com/aws/aws-toolkit-vscode/blob/7cb97a2ef0a765862d21842693967070b0dcdd49/src/shared/credentials/defaultCredentialSelectionDataProvider.ts#L54-L76
406-
407-
## Importing icons from other open source repos
391+
### Importing icons from other projects
408392

409-
If you are contribuing visual assets from other open source repos, the source repo must have a compatible license (such as MIT), and we need to document the source of the images. Follow these steps:
393+
If you are contribuing visual assets from other open source repos, the source repo must have a compatible license (such as MIT), and we need to document the source of the images. Follow these steps ([example: #227](https://github.com/aws/aws-toolkit-vscode/pull/227)):
410394

411395
1. Use a separate location in this repo for every repo/organization where images are sourced from. See `resources/icons/vscode` as an example.
412396
1. Copy the source repo's licence into this destination location's LICENSE.txt file
@@ -422,7 +406,39 @@ If you are contribuing visual assets from other open source repos, the source re
422406

423407
1. Add an entry [here](docs/icons.md#third-party) summarizing the new destination location, where the assets were sourced from, and a brief rationale.
424408

425-
[PR #227](https://github.com/aws/aws-toolkit-vscode/pull/227) shows an example.
409+
## Using new vscode APIs
410+
411+
The minimum required vscode version specified in [package.json](https://github.com/aws/aws-toolkit-vscode/blob/07119655109bb06105a3f53bbcd86b812b32cdbe/package.json#L16)
412+
is decided by the version of vscode running in Cloud9 and other vscode-compatible targets.
413+
414+
But you can still use the latest vscode APIs, by checking the current running vscode version. For example, to use a vscode 1.64 API:
415+
416+
1. Check the vscode version: `semver.gte(vscode.version, '1.64.0')`
417+
2. Disable the feature if is too old. That could mean just skipping the code entirely, or showing a different UI.
418+
419+
Full example: https://github.com/aws/aws-toolkit-vscode/blob/7cb97a2ef0a765862d21842693967070b0dcdd49/src/shared/credentials/defaultCredentialSelectionDataProvider.ts#L54-L76
420+
421+
## Preview Releases and Experiments
422+
423+
There are several ways to make pre-production changes available on a "preview" or "experimental" basis:
424+
425+
- **Experimental features:** settings defined in [aws.experiments](https://github.com/aws/aws-toolkit-vscode/blob/4dcee33931693380739eaa5d44e92fa4545a9666/package.json#L228-L241)
426+
are available in the vscode settings UI so that customers **can discover and enable them.**
427+
This mechanism is intended for non-production features which are ready for
428+
early access / preview feedback from interested customers.
429+
- **Developer-only features:** the `aws.dev.forceDevMode` setting can be used as
430+
a condition to enable features only for users who have
431+
`"aws.dev.forceDevMode": true` in their settings. These features are intended
432+
to be part of the mainline branch, but are _not_ presented to customers in the
433+
VSCode settings UI. Example: [EC2 commands were gated on `aws.isDevMode`](https://github.com/aws/aws-toolkit-vscode/blob/4dcee33931693380739eaa5d44e92fa4545a9666/package.json#L1115-L1126)
434+
so the functionality could be merged to mainline while it was under development.
435+
- **Beta artifacts:** For a "private beta" launch, `src/dev/beta.ts` contains
436+
logic to check a hardcoded, stable URL serving the latest `.vsix` build for
437+
the private beta. The hardcoded URL defined in [`dev/config.ts:betaUrl`](https://github.com/aws/aws-toolkit-vscode/blob/d9c27234c0732b021d07e184a865213d6efde8ec/src/dev/config.ts#L9)
438+
also forces the Toolkit to declare version `1.999.0` (since "private beta"
439+
has no semver and would conflict with the VSCode marketplace version,
440+
causing unwanted auto-updating by VSCode). Beta builds of the Toolkit
441+
automatically query the URL once per session per day.
426442

427443
## Code of Conduct
428444

src/shared/utilities/asyncCollection.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ const asyncCollection = Symbol('asyncCollection')
6868
/**
6969
* Converts an async generator function to an {@link AsyncCollection}
7070
*
71-
* Generation is "lazy", i.e. the generator is not called until a resolving operation:
72-
* * Iterating over them using `for await (...)`
73-
* * Iterating over them using `.next()`
71+
* Generation is "lazy", i.e. the generator is not called until a _resolving operation_:
72+
* * Iterating using `for await (...)`
73+
* * Iterating using `.next()`
7474
* * Calling one of the conversion functions `toMap` or `promise`
7575
*
7676
* Collections are *immutable* in the sense that any transformation will not consume the underlying generator
77-
* function. That is, any 'final' operation uses its own contextually bound generator function separate from
77+
* function. That is, any "final" operation uses its own contextually bound generator function separate from
7878
* any predecessor collections.
7979
*/
8080
export function toCollection<T>(generator: () => AsyncGenerator<T, T | undefined | void>): AsyncCollection<T> {

src/shared/utilities/collectionUtils.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,13 @@ export function isAsyncIterable(obj: any): obj is AsyncIterable<unknown> {
312312
* based off a 'mark' (the paginated token field) and a `prop` which is an
313313
* Accumulable property on the response interface.
314314
*
315-
* @param requester Asynchronous function to make the API requests with
316-
* @param request Initial request to apply to the API calls
317-
* @param mark A property name of the paginated token field shared by the input/output shapes
318-
* @param prop A property name of an 'Accumulable' field in the output shape
315+
* Note: aws-sdk-js-v3 provides service-specific paginateXX() functions:
316+
* https://aws.amazon.com/blogs/developer/pagination-using-async-iterators-in-modular-aws-sdk-for-javascript/
317+
*
318+
* @param requester Asynchronous function to make the API requests with.
319+
* @param request Initial request to apply to the API calls.
320+
* @param mark Property name (ex: "nextToken") of the paginated token field shared by the input/output shapes.
321+
* @param prop Property name (ex: "items") of an "Accumulable" field in the output shape.
319322
* @returns An {@link AsyncCollection} resolving to the type described by the `prop` field
320323
*/
321324
export function pageableToCollection<

0 commit comments

Comments
 (0)