diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index ce39d4bac96..17aec65532b 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -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 %}} @@ -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 %}} @@ -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 >}} @@ -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 %}} @@ -247,11 +268,31 @@ HttpResponse response = HttpClient.newBuilder().build().send(request, Ht {{% /codetab %}} +{{% codetab %}} + +```javascript +// 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 %}} @@ -273,6 +314,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 >}} diff --git a/daprdocs/content/en/getting-started/install-dapr-selfhost.md b/daprdocs/content/en/getting-started/install-dapr-selfhost.md index 135c1458746..55168bb1898 100644 --- a/daprdocs/content/en/getting-started/install-dapr-selfhost.md +++ b/daprdocs/content/en/getting-started/install-dapr-selfhost.md @@ -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]({{}})), 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]({{}}). +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 @@ -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 diff --git a/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md index 108225377e6..3b459afebfd 100644 --- a/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: diff --git a/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md index d75e1a7a6e3..0164e35fddf 100644 --- a/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: diff --git a/daprdocs/content/en/getting-started/quickstarts/statemanagement-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/statemanagement-quickstart.md index 26d63ae9826..bfa8427da8c 100644 --- a/daprdocs/content/en/getting-started/quickstarts/statemanagement-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/statemanagement-quickstart.md @@ -48,6 +48,12 @@ In a terminal window, navigate to the `order-processor` directory. cd state_management/python/sdk/order-processor ``` +Install the dependencies: + +```bash +pip3 install -r requirements.txt +``` + Run the `order-processor` service alongside a Dapr sidecar using [Multi-App Run]({{< ref multi-app-dapr-run >}}). ```bash @@ -163,6 +169,14 @@ Clone the [sample provided in the Quickstarts repo](https://github.com/dapr/quic git clone https://github.com/dapr/quickstarts.git ``` +Install the dependencies for the `order-processor` app: + +```bash +cd ./order-processor +npm install +cd .. +``` + ### Step 2: Manipulate service state In a terminal window, navigate to the `order-processor` directory. @@ -171,6 +185,12 @@ In a terminal window, navigate to the `order-processor` directory. cd state_management/javascript/sdk/order-processor ``` +Install the dependencies: + +```bash +npm install +``` + Run the `order-processor` service alongside a Dapr sidecar. ```bash @@ -297,6 +317,13 @@ In a terminal window, navigate to the `order-processor` directory. cd state_management/csharp/sdk/order-processor ``` +Install the dependencies: + +```bash +dotnet restore +dotnet build +``` + Run the `order-processor` service alongside a Dapr sidecar. ```bash @@ -557,6 +584,12 @@ In a terminal window, navigate to the `order-processor` directory. cd state_management/go/sdk/order-processor ``` +Install the dependencies: + +```bash +go build . +``` + Run the `order-processor` service alongside a Dapr sidecar. ```bash