diff options
author | Kurkó Mihály <kurkomisi@users.noreply.github.com> | 2018-03-08 16:22:21 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-03-08 16:22:21 +0800 |
commit | 704840a8ad9e75d4a00e734f901cac21c51b7eb5 (patch) | |
tree | e2b012c052986bb40053f09394aefb5c23474a5a /dashboard/README.md | |
parent | 3ec1b9a92dc09ff33f6fae2e8daa7862d4c51bb1 (diff) | |
download | dexon-704840a8ad9e75d4a00e734f901cac21c51b7eb5.tar.gz dexon-704840a8ad9e75d4a00e734f901cac21c51b7eb5.tar.zst dexon-704840a8ad9e75d4a00e734f901cac21c51b7eb5.zip |
cmd, dashboard: use webpack dev server, remove custom assets (#16263)
* cmd, dashboard: remove custom assets, webpack dev server
* dashboard: yarn commands, small fixes
Diffstat (limited to 'dashboard/README.md')
-rw-r--r-- | dashboard/README.md | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/dashboard/README.md b/dashboard/README.md index e010095ab..641c5f44b 100644 --- a/dashboard/README.md +++ b/dashboard/README.md @@ -12,28 +12,27 @@ The client's UI uses [React][React] with JSX syntax, which is validated by the [ As the dashboard depends on certain NPM packages (which are not included in the `go-ethereum` repo), these need to be installed first: ``` -$ (cd dashboard/assets && npm install) -$ (cd dashboard/assets && ./node_modules/.bin/flow-typed install) +$ (cd dashboard/assets && yarn install && yarn flow) ``` -Normally the dashboard assets are bundled into Geth via `go-bindata` to avoid external dependencies. Rebuilding Geth after each UI modification however is not feasible from a developer perspective. Instead, we can run `webpack` in watch mode to automatically rebundle the UI, and ask `geth` to use external assets to not rely on compiled resources: +Normally the dashboard assets are bundled into Geth via `go-bindata` to avoid external dependencies. Rebuilding Geth after each UI modification however is not feasible from a developer perspective. Instead, we can run `yarn dev` to watch for file system changes and refresh the browser automatically. ``` -$ (cd dashboard/assets && ./node_modules/.bin/webpack --watch) -$ geth --dashboard --dashboard.assets=dashboard/assets --vmodule=dashboard=5 +$ geth --dashboard --vmodule=dashboard=5 +$ (cd dashboard/assets && yarn dev) ``` To bundle up the final UI into Geth, run `go generate`: ``` -$ go generate ./dashboard +$ (cd dashboard && go generate) ``` ### Static type checking Since JavaScript doesn't provide type safety, [Flow][Flow] is used to check types. These are only useful during development, so at the end of the process Babel will strip them. -To take advantage of static type checking, your IDE needs to be prepared for it. In case of [Atom][Atom] a configuration guide can be found [here][Atom config]: Install the [Nuclide][Nuclide] package for Flow support, making sure it installs all of its support packages by enabling `Install Recommended Packages on Startup`, and set the path of the `flow-bin` which were installed previously by `npm`. +To take advantage of static type checking, your IDE needs to be prepared for it. In case of [Atom][Atom] a configuration guide can be found [here][Atom config]: Install the [Nuclide][Nuclide] package for Flow support, making sure it installs all of its support packages by enabling `Install Recommended Packages on Startup`, and set the path of the `flow-bin` which were installed previously by `yarn`. For more IDE support install the `linter-eslint` package too, which finds the `.eslintrc` file, and provides real-time linting. Atom warns, that these two packages are incompatible, but they seem to work well together. For third-party library errors and auto-completion [flow-typed][flow-typed] is used. @@ -41,7 +40,7 @@ For more IDE support install the `linter-eslint` package too, which finds the `. [Webpack][Webpack] offers handy tools for visualizing the bundle's dependency tree and space usage. -* Generate the bundle's profile running `webpack --profile --json > stats.json` +* Generate the bundle's profile running `yarn stats` * For the _dependency tree_ go to [Webpack Analyze][WA], and import `stats.json` * For the _space usage_ go to [Webpack Visualizer][WV], and import `stats.json` |