iros / mlab-vis-client

Measurement Lab Visualizations - Analyzing internet speeds worldwide.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MLab Visualizations

Build Status

This project contains the repository for the Measurement Lab visualizations web client.

To test changes, first deploy to the mlab-staging project and then submit a PR to merge them into the production repo.

Installation

npm install

Development Server

We are using webpack's DllPlugin, so we need to build our DLL vendor package before running our standard webpack watch. To do so, run this once:

npm run webpack-dll

This puts all the vendor files in their own bundle so we don't need to scan them when rebuilding our files during development.

If you see this error:

Error: Cannot find module '.../mlab-vis-client/static/dist/vendor-manifest.json'

You need to run npm run webpack-dll.

Now to start the dev server, there are two options:

Web Server + Webpack Watch in one command

npm run dev

Web Server separate from Webpack Watch

Start the web server:

npm run start-dev

Start webpack watch:

npm run webpack-watch

Caching with HardSourceWebpackPlugin

We are using HardSourceWebpackPlugin. If your webpack build is operating strangely, be sure to run a

npm run webpack-clean-cache

This plugin dramatically speeds up build times, but does require you to clean the cache occasionally (when problems arise).

If you see an error in your console similar to:

Uncaught TypeError: __webpack_require__(...) is not a function

Chances are you need to clean the cache. Run the command as described above.

Using webpack-dashboard

If you prefer to have webpack rendered in a dashboard, use two separate terminal windows. In one, run webpack with:

npm run webpack-dashboard

And in the other, run the web server with:

npm run start-dev

Note that the dashboard adds roughly 500ms to the webpack rebuild time.

Testing

npm test

Building for Production

npm run build

Production Server

npm run start
gcloud app deploy dispatch.yaml

Deploying

The site is currently configured to deploy to http://viz.measurementlab.net. To do so, run:

npm run deploy

Originally built from https://github.com/erikras/react-redux-universal-hot-example

About

Measurement Lab Visualizations - Analyzing internet speeds worldwide.

License:MIT License


Languages

Language:JavaScript 78.6%Language:CSS 21.4%