* Fix logviewer urls to work from push-health view
* Show full revision on header of push health view
* Disable Artifacts tab in push health task view when a task has no artifacts
* Unset selectedTaskId and selectedJobName from query params when closing details view of push health
* Show artifacts if any exist, not 20 or more
* Move push health Usage link to Help menu
* Add Push Health link in Failure Summary tab
* Make Push Health more obvious
* Lint fixes
* Try to fix failing test
* lint fixes
* Revert bad changes to tests
* Fix long revision on push health header
* Finish backing out unwanted changes to Revision
* Fix push health test
* Fix linting issues
* Fix push health tests
* Fix linting issues
* Use bootstrap classes for spacing instead of custom css
* Make it more clear when a task has no artifacts
* Lint fixes
* Add Push Health link to top nav bar
* Remove 'Health' drop down
* Remove unsupported 'caret' attribute from button
* Update default push health visibility
* Fix failing test
* Fix another test
* More fixes
* Fix another test
* Fix another test
* Fix another test
* Fix another test
* Bug 1623951 - convert hash urls to standard urls
* add single entry point and config changes
* create catchall in urls to serve index.html
* add lazy-load of assets on route change
* add connected-react-router for use with redux
* add react helmet for favicon
* refactor tests and add tests for backwards-compatibility of urls
* fix pagination and back navigation in Perfherder alerts
* add single entry point and create catchall to serve index for all routes
* update all Apps and routes; use react helmet for favicons
* add helper to convert old urls for backwards compatibility
* lazy load assets upon route navigation
* update all hash change logic in job-view
* add connectedRouter to access history object in redux
* refactor tests
* Create function for detecting filter changes on URL
* Prevent models from caching the current repo name
This is necessary so that we can change repos without having to reload the entire page.
We will stop reloading the page on repo change in a later PR.
* Don't use Redux when not necessary for "selectedJob"
I was using Redux to pass the selectedJob value down a single level
in a few cases. So just pass it instead of invoking the reducer.
* Two small tune-up tweaks.
The "withPushes" was totally unnecessary on PushJobs
And Push can be a PureComponent.
This introduces Redux back into Treeherder. While redux is often considered
unnecessary for simple apps in favor of Context, Treeherder is not simple.
Using Redux here allows us to abstract out certain functionality into
libraries that can be self-contained. And it does a better job of managing
the functions needed to modify the state in these areas. This is the first
context I am converting and will likely have minimal (if any) noticeable
performance gain. But converting SelectedJob and Pusehs should end up having
a larger impact.
Since it's more reliable (and strict) at code formatting than ESLint.
We use it via an ESLint plugin, and so disable the style-related AirBnB
preset rules, leaving the AirBnB guide to handle only correctness and
best practices rules.
It's highly encouraged to use an IDE integration or Git commit hook
to run Prettier (or `yarn lint --fix`) automatically. See:
* https://prettier.io/docs/en/editors.html
* https://prettier.io/docs/en/precommit.html
We may consider enabling a git commit hook out of the box (using eg
Husky) in the future, however they have previously been known to
interfere with partial-staging workflows, so would need to test the
fixes they have made for them thoroughly first.
In future PRs we may also want to start formatting JSON/CSS/Markdown
using Prettier too.
Imports must now be grouped like so (with newlines between each):
```
// "external" modules
import _ from 'lodash';
import chalk from 'chalk';
// modules from a "parent" directory
import foo from '../foo';
import qux from '../../foo/qux';
// "sibling" modules from the same or a sibling's directory
import bar from './bar';
import baz from './bar/baz';
```
The `import/order` rule has auto-fix support, so any errors can be
resolved using `yarn lint --fix`.
See:
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
Neutrino controls our frontend linting, transpilation, source-maps,
testing, dev-server and optimisation of production builds.
Highlights of the upgrade are:
* Major version updates to the individual tools within (such as webpack,
Babel and ESLint), significantly improving performance, fixing
transpilation/minification correctness bugs, adding support for newer
ECMAScript features, and increasing linter coverage.
* Hot reloading in the dev server now works for all entry-points and not
just the jobs view, shortening the feedback cycle.
* Reduced bundle size due to webpack 4's tree shaking, scope hoisting,
automatic shared/vendor code chunk splitting (no need for the manually
maintained 'vendor' list).
* CSS is now extracted out of JS, which improves performance, reduces
bundle size and prevents the initial white flash of un-styled content.
* Support for dynamic imports/code splitting (needed for bug 1502192).
* Support for Jest via a new Jest preset (unblocks bug 1364045).
* Support for public class field declarations (unblocks bug 1480166).
* Improved source-maps (increases the quality of production exception
trace-backs and fixes several debugger breakpoint bugs).
* Reduced amount of custom configuration required for our fairly complex
frontend needs, reducing maintenance burden and allowing for easier
future Neutrino upgrades.
In addition this PR:
* Fixes the WhiteNoise `immutable_file_test()` regex, so that it now
correctly enables browser caching of images, fonts and source maps.
* Enables webpack-dev-server's overlay feature, which displays any
compilation errors in the browser, saving having to switch back
to the console (this can be enabled for warnings too if desired).
* Enables webpack-dev-server's automatic browser-opening feature,
which saves having to manually navigate to `localhost:5000` after
running `yarn start`.
* Switches Karma tests to run Firefox in headless mode, reducing the
workflow disruption when running `yarn test`.
* Uses the new webpack `performance` option to enable maximum asset
file size thresholds, to help prevent bundle-size regressions.
* Rewrites the `package.json` script commands so that they now work
correctly on Windows, even when setting environment variables.
Performance comparison:
* Local `yarn build`:
- Cached: 2m34s -> 23s
- Uncached: 2m34s -> 58s
* Local `yarn start`:
- Cached: 34.5s -> 13.6s
- Uncached: 34.5s -> 31.3s
* Local `yarn test`
- Cached: 61.5s -> 19.8s
- Uncached: 61.5s -> 22.0s
* Local `yarn lint`
- Cached: 3.8s -> 1.8s
- Uncached: 13.7s -> 13.4s
* Travis end-to-end time:
9 minutes -> 6 minutes
* Heroku deploy end-to-end time:
14 minutes -> 9 minutes