Skip to content

Commit 78d003e

Browse files
michaelklishinmergify[bot]
authored andcommitted
CONTRIBUTING.md: explain how to use BrowserSync
when working on management UI. References #8008. (cherry picked from commit b6b93de) (cherry picked from commit de1c4f5) (cherry picked from commit 2d5ec44)
1 parent 2395e54 commit 78d003e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,40 @@ of their opinion on [RabbitMQ mailing list](https://groups.google.com/forum/#!fo
2222

2323
See [this guide on how to use Bazel and BuildBuddy for RabbitMQ core development](https://github.com/rabbitmq/contribute/wiki/Bazel-and-BuildBuddy).
2424

25+
26+
## Working on Management UI with BrowserSync
27+
28+
When working on management UI code, besides starting the node with
29+
30+
``` shell
31+
bazel run broker RABBITMQ_ENABLED_PLUGINS=rabbitmq_management
32+
```
33+
34+
(or any other set of plugins), it is highly recommended to use [BrowserSync](https://browsersync.io/#install)
35+
to shorten the edit/feedback cycle for JS files, CSS, and so on.
36+
37+
First, install BrowserSync using NPM:
38+
39+
``` shell
40+
npm install -g browser-sync
41+
```
42+
43+
Assuming a node running locally with HTTP API on port `15672`, start
44+
a BrowserSync proxy like so:
45+
46+
``` shell
47+
cd deps/rabbitmq_management/priv/www
48+
49+
browser-sync start --proxy localhost:15672 --serverStatic . --files .
50+
```
51+
52+
BrowserSync will automatically open a browser window for you to use. The window
53+
will automatically refresh when one of the static (templates, JS, CSS) files change.
54+
55+
All HTTP requests that BrowserSync does not know how to handle will be proxied to
56+
the HTTP API at `localhost:15672`.
57+
58+
2559
## Formatting the RabbitMQ CLI
2660

2761
The RabbitMQ CLI uses the standard [Elixir code formatter](https://hexdocs.pm/mix/main/Mix.Tasks.Format.html). To ensure correct code formatting of the CLI:

0 commit comments

Comments
 (0)