Skip to content
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

Update limitation for js #3982

Merged
merged 10 commits into from
Jan 31, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ APIs that generate random numbers, random UUIDs, or the current date are _non-de

For example, instead of this:

{{< tabs ".NET" Java >}}
{{< tabs ".NET" Java JavaScript >}}

{{% codetab %}}

Expand All @@ -186,11 +186,22 @@ string randomString = GetRandomString();

{{% /codetab %}}

{{% codetab %}}

```javascript
// DON'T DO THIS!
const currentTime = new Date();
const newIdentifier = uuidv4();
const randomString = getRandomString();
```

{{% /codetab %}}

{{< /tabs >}}

Do this:

{{< tabs ".NET" Java >}}
{{< tabs ".NET" Java JavaScript >}}

{{% codetab %}}

Expand All @@ -214,6 +225,16 @@ String randomString = context.callActivity(GetRandomString.class.getName(), Stri

{{% /codetab %}}

{{% codetab %}}

```javascript
// Do this!!
const currentTime = context.getCurrentUtcDateTime();
const randomString = yield context.callActivity(getRandomString);
```

{{% /codetab %}}

{{< /tabs >}}


Expand All @@ -224,7 +245,7 @@ Instead, workflows should interact with external state _indirectly_ using workfl

For example, instead of this:

{{< tabs ".NET" Java >}}
{{< tabs ".NET" Java JavaScript >}}

{{% codetab %}}

Expand All @@ -247,11 +268,29 @@ HttpResponse<String> response = HttpClient.newBuilder().build().send(request, Ht

{{% /codetab %}}

```javascript
kaibocai marked this conversation as resolved.
Show resolved Hide resolved
// DON'T DO THIS!
// Accessing an Environment Variable (Node.js)
const configuration = process.env.MY_CONFIGURATION;

fetch('https://postman-echo.com/get')
.then(response => response.text())
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});

```

{{% /codetab %}}

{{< /tabs >}}

Do this:

{{< tabs ".NET" Java >}}
{{< tabs ".NET" Java JavaScript >}}

{{% codetab %}}

Expand All @@ -273,6 +312,16 @@ String data = ctx.callActivity(MakeHttpCall.class, "https://example.com/api/data

{{% /codetab %}}

{{% codetab %}}

```javascript
// Do this!!
const configuation = workflowInput.getConfiguration(); // imaginary workflow input argument
const data = yield ctx.callActivity(makeHttpCall, "https://example.com/api/data");
```

{{% /codetab %}}

{{< /tabs >}}


Expand Down
27 changes: 25 additions & 2 deletions daprdocs/content/en/getting-started/install-dapr-selfhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Dapr initialization includes:
1. Running a **Dapr placement service container instance** for local actor support.

{{% alert title="Docker" color="primary" %}}
The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{<ref self-hosted-no-docker.md>}})), the next steps in this guide assume the recommended Docker development environment.
The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{< ref self-hosted-no-docker.md >}})), the next steps in this guide assume the recommended Docker development environment.

You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{<ref dapr-init.md>}}).
You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{< ref dapr-init.md >}}).
{{% /alert %}}

### Step 1: Open an elevated terminal
Expand Down Expand Up @@ -54,12 +54,35 @@ Run Windows Terminal or command prompt as administrator.

### Step 2: Run the init CLI command

{{< tabs "Linux/MacOS" "Windows">}}

{{% codetab %}}

Install the latest Dapr runtime binaries:

```bash
dapr init
```

**If you are installing on Mac OS Silicon with Docker,** you may need to perform the following workaround to enable `dapr init` to talk to Docker without using Kubernetes.
1. Navigate to **Docker Desktop** > **Settings** > **Advanced**.
1. Select the **Enable default Docker socket** checkbox.

{{% /codetab %}}

{{% codetab %}}

Install the latest Dapr runtime binaries:

```bash
dapr init
```

{{% /codetab %}}

{{< /tabs >}}


### Step 3: Verify Dapr version

```bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
cd pub_sub/python/sdk
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./checkout
pip3 install -r requirements.txt
cd ..
cd ./order-processor
pip3 install -r requirements.txt
cd ..
cd ./order-processor-fastapi
pip3 install -r requirements.txt
cd ..
```

### Step 3: Run the publisher and subscriber

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down Expand Up @@ -215,6 +229,17 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
cd pub_sub/javascript/sdk
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
npm install
cd ..
cd ./checkout
npm install
cd ..
```

### Step 3: Run the publisher and subscriber

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down Expand Up @@ -352,6 +377,18 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
cd pub_sub/csharp/sdk
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
dotnet restore
dotnet build
cd ../checkout
dotnet restore
dotnet build
cd ..
```

### Step 3: Run the publisher and subscriber

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down Expand Up @@ -497,6 +534,17 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
cd pub_sub/java/sdk
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
mvn clean install
cd ..
cd ./checkout
mvn clean install
cd ..
```

### Step 3: Run the publisher and subscriber

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down Expand Up @@ -647,6 +695,16 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory:
cd pub_sub/go/sdk
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
go build .
cd ../checkout
go build .
cd ..
```

### Step 3: Run the publisher and subscriber

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
cd service_invocation/python/http
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
pip3 install -r requirements.txt
cd ../checkout
pip3 install -r requirements.txt
cd ..
```

### Step 3: Run the `order-processor` and `checkout` services

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down Expand Up @@ -184,6 +194,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
cd service_invocation/javascript/http
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
npm install
cd ../checkout
npm install
cd ..
```

### Step 3: Run the `order-processor` and `checkout` services

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down Expand Up @@ -314,6 +334,18 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
cd service_invocation/csharp/http
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
dotnet restore
dotnet build
cd ../checkout
dotnet restore
dotnet build
cd ..
```

### Step 3: Run the `order-processor` and `checkout` services

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down Expand Up @@ -448,6 +480,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
cd service_invocation/java/http
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
mvn clean install
cd ../checkout
mvn clean install
cd ..
```

### Step 3: Run the `order-processor` and `checkout` services

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down Expand Up @@ -577,6 +619,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire
cd service_invocation/go/http
```

Install the dependencies for the `order-processor` and `checkout` apps:

```bash
cd ./order-processor
go build .
cd ../checkout
go build .
cd ..
```

### Step 3: Run the `order-processor` and `checkout` services

With the following command, simultaneously run the following services alongside their own Dapr sidecars:
Expand Down
Loading
Loading