Skip to content

Commit

Permalink
Update developing-locust.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Baldwin committed Sep 22, 2023
1 parent 6e58043 commit 7658459
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions docs/developing-locust.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,69 @@ Or you can make sass watch for changes to the ``.sass`` files and automatically
$ make sass_watch
The CSS files that are generated by SASS should be checked into version control.


Making changes to Locust's Modern Web UI
========================================

The modern Web UI is built using React and Typescript

## Setup

### Node

Install node using nvm to easily switch between node version

- Copy and run the install line from [nvm](https://github.com/nvm-sh/nvm) (starts with curl/wget ...)

- Verify nvm was installed correctly

```bash
nvm --version
```

- Finally, install the proper Node version according to engines in the package.json

```bash
nvm install {version}
nvm alias default {version}
```

### Yarn

- Install Yarn from their official website (avoid installing through Node)
- Verify yarn was installed correctly

```bash
yarn --version
```

- Next in dashboard, install all dependencies

```bash
cd dashboard
yarn
```

## Developing

To develop the frontend, run `yarn dev`. This will start the webpack dev server and allow for viewing and editing the frontend, without needing to a run a locust web server

To develop while running a locust instance, run `yarn watch`. This will output the static website to the `dist` directory. Webpack will automatically detect any changed files and re-build as needed. Simply refresh the page to view the changes

The frontend can additionally be built using make:
```bash
make frontend_build
```

## Linting

Run `yarn lint` to detect lint failures in the frontend project. Running `yarn lint --fix` will resolve any issues that are automatically resolvable. Your IDE can aditionally be configured with ESLint to resolve these issues on save.

## Formatting

Run `yarn format` to fix any formatting issues in the frontend project. Once again your IDE can be configured to automatically format on save.

## Typechecking

We use Typescript in the frontend project. Run `yarn type-check` to find any issues.

0 comments on commit 7658459

Please sign in to comment.