From 194db070579f095b60580fcc0185f1130c528a51 Mon Sep 17 00:00:00 2001 From: felixlinker Date: Wed, 5 Dec 2018 20:31:46 +0000 Subject: [PATCH 01/29] Hotfix pip parsing in control code --- src/app/pages/OutfittingPage.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/pages/OutfittingPage.jsx b/src/app/pages/OutfittingPage.jsx index ae042559..94c786b3 100644 --- a/src/app/pages/OutfittingPage.jsx +++ b/src/app/pages/OutfittingPage.jsx @@ -224,9 +224,12 @@ export default class OutfittingPage extends Page { const control = LZString.decompressFromBase64( Utils.fromUrlSafe(parts[4]) ).split('/'); - sys = parseFloat(control[0]) || sys; - eng = parseFloat(control[1]) || eng; - wep = parseFloat(control[2]) || wep; + sys = parseFloat(control[0]); + eng = parseFloat(control[1]); + wep = parseFloat(control[2]); + if (sys + eng + wep > 6) { + sys = eng = wep = 2; + } boost = control[3] == 1 ? true : false; fuel = parseFloat(control[4]) || fuel; cargo = parseInt(control[5]) || cargo; From aca90d70773010fe8aa6901933cbaf2ca1f6ebad Mon Sep 17 00:00:00 2001 From: Willyb321 Date: Tue, 18 Dec 2018 08:25:30 +1100 Subject: [PATCH 02/29] prep for pulse wave analysers --- src/app/components/AvailableModulesMenu.jsx | 3 ++- src/app/components/HardpointSlot.jsx | 3 +++ src/app/i18n/en.json | 1 + src/app/shipyard/Constants.js | 1 + src/app/shipyard/Module.js | 27 +++++++++++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index abc7b4c7..d558c22d 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -56,6 +56,7 @@ const GRPCAT = { 'nl': 'ordnance', 'sc': 'scanners', 'ss': 'scanners', + 'pwa': 'scanners', // Utilities 'cs': 'scanners', 'kw': 'scanners', @@ -97,7 +98,7 @@ const CATEGORIES = { 'sb': ['sb'], 'hs': ['hs'], 'defence': ['ch', 'po', 'ec'], - 'scanners': ['sc', 'ss', 'cs', 'kw', 'ws'], // Overloaded with internal scanners + 'scanners': ['sc', 'ss', 'cs', 'kw', 'ws', 'pwa'], // Overloaded with internal scanners // Experimental 'experimental': ['axmc', 'axmr', 'rfl', 'tbrfl', 'tbsc', 'tbem', 'xs', 'sfn', 'rcpl', 'dtl', 'rsl', 'mahr',], diff --git a/src/app/components/HardpointSlot.jsx b/src/app/components/HardpointSlot.jsx index 4626aef0..9935cf87 100644 --- a/src/app/components/HardpointSlot.jsx +++ b/src/app/components/HardpointSlot.jsx @@ -126,6 +126,9 @@ export default class HardpointSlot extends Slot { className={'l'}>{translate('shotspeed')}: {formats.int(m.getShotSpeed())}{u.mps} : null} {m.getPiercing() ?
{translate('piercing')}: {formats.int(m.getPiercing())}
: null} {m.getJitter() ?
{translate('jitter')}: {formats.f2(m.getJitter())}°
: null} + {m.getScanAngle() ?
{translate('scan angle')}: {formats.f2(m.getScanAngle())}°
: null} + {m.getScanRange() ?
{translate('scan range')}: {formats.int(m.getScanRange())}{u.m}
: null} + {m.getMaxAngle() ?
{translate('max angle')}: {formats.f2(m.getMaxAngle())}°
: null} {showModuleResistances && m.getExplosiveResistance() ?
{translate('explres')}: {formats.pct(m.getExplosiveResistance())}
: null} {showModuleResistances && m.getKineticResistance() ?
Date: Wed, 19 Dec 2018 08:21:13 +1100 Subject: [PATCH 03/29] mining tools in their own section, prep for scl --- src/app/components/AvailableModulesMenu.jsx | 6 ++++-- src/app/i18n/en.json | 1 + src/app/shipyard/Constants.js | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index d558c22d..aca49b8c 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -98,12 +98,14 @@ const CATEGORIES = { 'sb': ['sb'], 'hs': ['hs'], 'defence': ['ch', 'po', 'ec'], - 'scanners': ['sc', 'ss', 'cs', 'kw', 'ws', 'pwa'], // Overloaded with internal scanners + 'scanners': ['sc', 'ss', 'cs', 'kw', 'ws'], // Overloaded with internal scanners // Experimental 'experimental': ['axmc', 'axmr', 'rfl', 'tbrfl', 'tbsc', 'tbem', 'xs', 'sfn', 'rcpl', 'dtl', 'rsl', 'mahr',], // Guardian - 'guardian': ['gpp', 'gpd', 'gpc', 'ggc', 'gsrp', 'gfsb', 'ghrp', 'gmrp', 'gsc'] + 'guardian': ['gpp', 'gpd', 'gpc', 'ggc', 'gsrp', 'gfsb', 'ghrp', 'gmrp', 'gsc'], + + 'mining': ['scl', 'pwa'], }; /** diff --git a/src/app/i18n/en.json b/src/app/i18n/en.json index 91677d8d..523592dd 100644 --- a/src/app/i18n/en.json +++ b/src/app/i18n/en.json @@ -133,6 +133,7 @@ "ghrp": "Guardian Hull Reinforcement Package", "gmrp": "Guardian Module Reinforcement Package", "pwa": "Pulse Wave Analyser", + "scl": "Seismic Charge Launcher", "tbsc": "Shock Cannon", "gsc": "Guardian Shard Cannon", "psg": "Prismatic Shield Generator", diff --git a/src/app/shipyard/Constants.js b/src/app/shipyard/Constants.js index a5e56ab7..0afd368d 100755 --- a/src/app/shipyard/Constants.js +++ b/src/app/shipyard/Constants.js @@ -95,6 +95,7 @@ export const ModuleGroupToName = { tbem: 'Enzyme Missile Rack', tbrfl: 'Remote Release Flechette Launcher', pwa: 'Pulse Wave Analyser', + scl: 'Seismic Charge Launcher', }; let GrpNameToCodeMap = {}; From 600df162aa15ec15cb34202f655ec638492d2b3a Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sat, 22 Dec 2018 06:45:52 +1100 Subject: [PATCH 04/29] Prep for sub surface displacement missile --- src/app/components/AvailableModulesMenu.jsx | 10 +++++++--- src/app/i18n/en.json | 1 + src/app/shipyard/Constants.js | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index aca49b8c..6a8d1de2 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -56,7 +56,6 @@ const GRPCAT = { 'nl': 'ordnance', 'sc': 'scanners', 'ss': 'scanners', - 'pwa': 'scanners', // Utilities 'cs': 'scanners', 'kw': 'scanners', @@ -74,7 +73,12 @@ const GRPCAT = { 'gfsb': 'guardian', 'gmrp': 'guardian', 'gsc': 'guardian', - 'ghrp': 'guardian' + 'ghrp': 'guardian', + + // Mining + 'scl': 'mining', + 'pwa': 'mining', + 'sdm': 'mining' }; // Order here is the order in which items will be shown in the modules menu const CATEGORIES = { @@ -105,7 +109,7 @@ const CATEGORIES = { // Guardian 'guardian': ['gpp', 'gpd', 'gpc', 'ggc', 'gsrp', 'gfsb', 'ghrp', 'gmrp', 'gsc'], - 'mining': ['scl', 'pwa'], + 'mining': ['scl', 'pwa', 'sdm'], }; /** diff --git a/src/app/i18n/en.json b/src/app/i18n/en.json index 523592dd..3badba14 100644 --- a/src/app/i18n/en.json +++ b/src/app/i18n/en.json @@ -134,6 +134,7 @@ "gmrp": "Guardian Module Reinforcement Package", "pwa": "Pulse Wave Analyser", "scl": "Seismic Charge Launcher", + "sdm": "Sub-Surface Displacement Missile", "tbsc": "Shock Cannon", "gsc": "Guardian Shard Cannon", "psg": "Prismatic Shield Generator", diff --git a/src/app/shipyard/Constants.js b/src/app/shipyard/Constants.js index 0afd368d..8b6b06fc 100755 --- a/src/app/shipyard/Constants.js +++ b/src/app/shipyard/Constants.js @@ -96,6 +96,7 @@ export const ModuleGroupToName = { tbrfl: 'Remote Release Flechette Launcher', pwa: 'Pulse Wave Analyser', scl: 'Seismic Charge Launcher', + sdm: 'Sub-Surface Displacement Missile', }; let GrpNameToCodeMap = {}; From 0cfb0b6878b51ddc595cd98e6defc2e1f14b3358 Mon Sep 17 00:00:00 2001 From: monopoint Date: Fri, 21 Dec 2018 21:14:43 +0100 Subject: [PATCH 05/29] Fix background highlight on sort in shipyard (#447) * Fix background highlight on sort in shipyard * removed docs line --- src/app/pages/ShipyardPage.jsx | 19 +------------------ src/less/table.less | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/app/pages/ShipyardPage.jsx b/src/app/pages/ShipyardPage.jsx index 7ead18ae..fe4dea73 100644 --- a/src/app/pages/ShipyardPage.jsx +++ b/src/app/pages/ShipyardPage.jsx @@ -169,10 +169,9 @@ export default class ShipyardPage extends Page { * @param {Object} u Localized unit map * @param {Function} fInt Localized integer formatter * @param {Function} fRound Localized round formatter - * @param {Boolean} highlight Should this row be highlighted * @return {React.Component} Table Row */ - _shipRowElement(s, translate, u, fInt, fRound, highlight) { + _shipRowElement(s, translate, u, fInt, fRound) { let noTouch = this.context.noTouch; return ( @@ -181,7 +180,6 @@ export default class ShipyardPage extends Page { style={{ height: '1.5em' }} className={cn({ highlighted: noTouch && this.state.shipId === s.id, - alt: highlight })} onMouseEnter={noTouch && this._highlightShip.bind(this, s.id)} > @@ -286,27 +284,13 @@ export default class ShipyardPage extends Page { let shipRows = new Array(shipSummaries.length); let detailRows = new Array(shipSummaries.length); - let lastShipSortValue = null; - let backgroundHighlight = false; - for (let s of shipSummaries) { - let shipSortValue = s[shipPredicate]; - if (shipPredicateIndex != undefined) { - shipSortValue = shipSortValue[shipPredicateIndex]; - } - - if (shipSortValue != lastShipSortValue) { - backgroundHighlight = !backgroundHighlight; - lastShipSortValue = shipSortValue; - } - detailRows[i] = this._shipRowElement( s, translate, units, fInt, formats.f1, - backgroundHighlight ); shipRows[i] = ( diff --git a/src/less/table.less b/src/less/table.less index 1cce0319..4b4c0071 100755 --- a/src/less/table.less +++ b/src/less/table.less @@ -55,7 +55,7 @@ tbody tr { background-color: @warning-bg; } - &.alt { + &:nth-child(odd){ background-color: @alt-primary-bg; } } From e03e249d2fb27ccc8b6c91d878fa02a0d4c36257 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sat, 22 Dec 2018 07:19:53 +1100 Subject: [PATCH 06/29] probably fix .dockerignore --- .docker/.dockerignore | 2 -- .dockerignore | 77 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) delete mode 100644 .docker/.dockerignore create mode 100644 .dockerignore diff --git a/.docker/.dockerignore b/.docker/.dockerignore deleted file mode 100644 index 93f13619..00000000 --- a/.docker/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -npm-debug.log diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..c43179e2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,77 @@ +node_modules +npm-debug.log +### Node template +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless + From e9b6d7160636a3e018f65556991b6cf05e8916a5 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sat, 22 Dec 2018 07:48:35 +1100 Subject: [PATCH 07/29] dynamically import pages, should make things a bit faster --- package.json | 1 + src/app/Coriolis.jsx | 120 +++++++++++++++++++++++++++-------------- webpack.config.dev.js | 13 ++--- webpack.config.prod.js | 19 ++++--- 4 files changed, 101 insertions(+), 52 deletions(-) diff --git a/package.json b/package.json index 28dbe455..a507a9ff 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,7 @@ "webpack-notifier": "^1.6.0", "workbox-webpack-plugin": "^3.6.1" }, + "sideEffects": false, "dependencies": { "@babel/polyfill": "^7.0.0", "browserify-zlib-next": "^1.0.1", diff --git a/src/app/Coriolis.jsx b/src/app/Coriolis.jsx index 0595b41c..d812497f 100644 --- a/src/app/Coriolis.jsx +++ b/src/app/Coriolis.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import Router from './Router'; -import { register } from 'register-service-worker' +import { register } from 'register-service-worker'; import { EventEmitter } from 'fbemitter'; import { getLanguage } from './i18n/Language'; import Persist from './stores/Persist'; @@ -15,11 +15,7 @@ import ModalImport from './components/ModalImport'; import ModalPermalink from './components/ModalPermalink'; import * as CompanionApiUtils from './utils/CompanionApiUtils'; import * as JournalUtils from './utils/JournalUtils'; -import AboutPage from './pages/AboutPage'; import NotFoundPage from './pages/NotFoundPage'; -import OutfittingPage from './pages/OutfittingPage'; -import ComparisonPage from './pages/ComparisonPage'; -import ShipyardPage from './pages/ShipyardPage'; import ErrorDetails from './pages/ErrorDetails'; const zlib = require('pako'); @@ -72,17 +68,57 @@ export default class Coriolis extends React.Component { route: {}, sizeRatio: Persist.getSizeRatio() }; - this._getAnnouncements() - Router('', (r) => this._setPage(ShipyardPage, r)); + this._getAnnouncements(); + Router('', (r) => { + return import(/* webpackChunkName: "shipyard" */ './pages/ShipyardPage') + .then(ShipyardPage => { + return this._setPage(ShipyardPage.default, r); + }) + }); Router('/import?', (r) => this._importBuild(r)); Router('/import/:data', (r) => this._importBuild(r)); - Router('/outfit/?', (r) => this._setPage(OutfittingPage, r)); - Router('/outfit/:ship/?', (r) => this._setPage(OutfittingPage, r)); - Router('/outfit/:ship/:code?', (r) => this._setPage(OutfittingPage, r)); - Router('/compare/:name?', (r) => this._setPage(ComparisonPage, r)); - Router('/comparison?', (r) => this._setPage(ComparisonPage, r)); - Router('/comparison/:code', (r) => this._setPage(ComparisonPage, r)); - Router('/about', (r) => this._setPage(AboutPage, r)); + Router('/outfit/?', (r) => { + return import(/* webpackChunkName: "outfit" */ './pages/OutfittingPage') + .then(OutfittingPage => { + return this._setPage(OutfittingPage.default, r); + }) + }); + Router('/outfit/:ship/?', (r) => { + return import(/* webpackChunkName: "outfit" */ './pages/OutfittingPage') + .then(OutfittingPage => { + return this._setPage(OutfittingPage.default, r); + }) + }); + Router('/outfit/:ship/:code?', (r) => { + return import(/* webpackChunkName: "outfit" */ './pages/OutfittingPage') + .then(OutfittingPage => { + return this._setPage(OutfittingPage.default, r); + }) + }); + Router('/compare/:name?', (r) => { + return import(/* webpackChunkName: "compare" */ './pages/ComparisonPage') + .then(ComparisonPage => { + return this._setPage(ComparisonPage.default, r); + }) + }); + Router('/comparison?', (r) => { + return import(/* webpackChunkName: "compare" */ './pages/ComparisonPage') + .then(ComparisonPage => { + return this._setPage(ComparisonPage.default, r); + }) + }); + Router('/comparison/:code', (r) => { + return import(/* webpackChunkName: "compare" */ './pages/ComparisonPage') + .then(ComparisonPage => { + return this._setPage(ComparisonPage.default, r); + }) + }); + Router('/about', (r) => { + return import(/* webpackChunkName: "about" */ './pages/AboutPage') + .then(AboutPage => { + return this._setPage(AboutPage.default, r); + }) + }); Router('*', (r) => this._setPage(null, r)); } @@ -105,7 +141,10 @@ export default class Coriolis extends React.Component { } r.params.ship = ship.id; r.params.code = ship.toString(); - this._setPage(OutfittingPage, r); + return import(/* webpackChunkName: "outfit" */ './pages/OutfittingPage') + .then(AboutPage => { + return this._setPage(AboutPage.default, r); + }) } catch (err) { this._onError('Failed to import ship', r.path, 0, 0, err); } @@ -113,10 +152,10 @@ export default class Coriolis extends React.Component { _getAnnouncements() { return request.get('https://orbis.zone/api/announcement') - .query({showInCoriolis: true}) - .then(announces => { - this.setState({ announcements: announces.body }) - }) + .query({ showInCoriolis: true }) + .then(announces => { + this.setState({ announcements: announces.body }); + }); } /** @@ -351,27 +390,27 @@ export default class Coriolis extends React.Component { const self = this; if (process.env.NODE_ENV === 'production') { register('/service-worker.js', { - ready (registration) { - console.log('Service worker is active.') + ready(registration) { + console.log('Service worker is active.'); }, - registered (registration) { - console.log('Service worker has been registered.') + registered(registration) { + console.log('Service worker has been registered.'); }, - cached (registration) { - console.log('Content has been cached for offline use.') + cached(registration) { + console.log('Content has been cached for offline use.'); }, - updatefound (registration) { - console.log('New content is downloading.') + updatefound(registration) { + console.log('New content is downloading.'); }, - updated (registration) { + updated(registration) { self.setState({ appCacheUpdate: true }); - console.log('New content is available; please refresh.') + console.log('New content is available; please refresh.'); }, - offline () { - console.log('No internet connection found. App is running in offline mode.') + offline() { + console.log('No internet connection found. App is running in offline mode.'); }, - error (error) { - console.error('Error during service worker registration:', error) + error(error) { + console.error('Error during service worker registration:', error); } }); } @@ -394,21 +433,24 @@ export default class Coriolis extends React.Component { let currentMenu = this.state.currentMenu; return
-
-
{this.state.announcements.map(a => )}
+ className={this.state.noTouch ? 'no-touch' : null}> +
+
{this.state.announcements.map(a => )}
{this.state.error ? this.state.error : this.state.page ? React.createElement(this.state.page, { currentMenu }) : - } + } {this.state.modal} {this.state.tooltip} diff --git a/webpack.config.dev.js b/webpack.config.dev.js index ff4bc29b..44b8a02b 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -14,7 +14,7 @@ module.exports = { }, mode: 'development', entry: { - main: './src/app/index.js' + main: './src/app/index.js', }, resolve: { // When requiring, you don't need to add these extensions @@ -22,13 +22,11 @@ module.exports = { }, optimization: { minimize: false, - splitChunks: { - chunks: 'all' - } + usedExports: true }, output: { path: path.join(__dirname, 'build'), - filename: 'app.js', + chunkFilename: '[name].bundle.js', publicPath: '/' }, plugins: [ @@ -56,7 +54,10 @@ module.exports = { module: { rules: [ { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' }) }, - { test: /\.less$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader!less-loader' }) }, + { + test: /\.less$/, + loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader!less-loader' }) + }, { test: /\.(js|jsx)$/, loaders: ['babel-loader'], include: path.join(__dirname, 'src') }, { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' }, { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' }, diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 55fb4b63..8589ff5e 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -11,26 +11,28 @@ const buildDate = new Date(); module.exports = { devtool: 'source-map', entry: { - main: ['./src/app/index.js'] + main: './src/app/index.js' }, resolve: { extensions: ['.js', '.jsx', '.json', '.less'] }, output: { path: path.join(__dirname, 'build'), - filename: '[name].[hash].js', + chunkFilename: '[name].bundle.js', publicPath: '/', globalObject: 'this' }, mode: 'production', optimization: { minimize: true, - splitChunks: { - chunks: 'all' - } + usedExports: true }, plugins: [ - new CopyWebpackPlugin(['src/.htaccess', { from: 'src/schemas', to: 'schemas' }, {from: 'src/images/logo/*', flatten: true, to: ''}, 'src/iframe.html', 'src/xdLocalStoragePostMessageApi.min.js']), + new CopyWebpackPlugin(['src/.htaccess', { from: 'src/schemas', to: 'schemas' }, { + from: 'src/images/logo/*', + flatten: true, + to: '' + }, 'src/iframe.html', 'src/xdLocalStoragePostMessageApi.min.js']), // new webpack.optimize.CommonsChunkPlugin({ // name: 'lib', // filename: 'lib.[chunkhash:6].js' @@ -66,7 +68,10 @@ module.exports = { module: { rules: [ { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' }) }, - { test: /\.less$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader!less-loader' }) }, + { + test: /\.less$/, + loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader!less-loader' }) + }, { test: /\.(js|jsx)$/, loader: 'babel-loader?cacheDirectory=true', include: path.join(__dirname, 'src') }, { test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' }, { test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' }, From e1c115747ccec121262c33a7800ee13396518c8b Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sat, 22 Dec 2018 08:03:35 +1100 Subject: [PATCH 08/29] nginx compression --- nginx.conf | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index a9938f1e..af53edec 100644 --- a/nginx.conf +++ b/nginx.conf @@ -28,13 +28,79 @@ http { text/cache-manifest appcache; } + # ---------------------------------------------------------------------- + # | Compression | + # ---------------------------------------------------------------------- + + # https://nginx.org/en/docs/http/ngx_http_gzip_module.html + + # Enable gzip compression. + # Default: off gzip on; - gzip_vary on; + + # Compression level (1-9). + # 5 is a perfect compromise between size and CPU usage, offering about + # 75% reduction for most ASCII files (almost identical to level 9). + # Default: 1 + gzip_comp_level 5; + + # Don't compress anything that's already small and unlikely to shrink much + # if at all (the default is 20 bytes, which is bad as that usually leads to + # larger files after gzipping). + # Default: 20 + gzip_min_length 256; + + # Compress data even for clients that are connecting to us via proxies, + # identified by the "Via" header (required for CloudFront). + # Default: off gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - gzip_http_version 1.1; - gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + + # Tell proxies to cache both the gzipped and regular version of a resource + # whenever the client's Accept-Encoding capabilities header varies; + # Avoids the issue where a non-gzip capable client (which is extremely rare + # today) would display gibberish if their proxy gave them the gzipped version. + # Default: off + gzip_vary on; + + # Compress all output labeled with one of the following MIME-types. + # text/html is always compressed by gzip module. + # Default: text/html + gzip_types + application/atom+xml + application/javascript + application/json + application/ld+json + application/manifest+json + application/rss+xml + application/geo+json + application/vnd.ms-fontobject + application/x-font-ttf + application/x-web-app-manifest+json + application/xhtml+xml + application/xml + application/rdf+xml + font/collection + font/opentype + font/otf + font/ttf + image/bmp + image/svg+xml + image/x-icon + text/cache-manifest + text/css + text/javascript + text/plain + text/vcard + text/vnd.rim.location.xloc + text/vtt + text/x-component + text/x-cross-domain-policy; + + # This should be turned on if you are going to have pre-compressed copies (.gz) of + # static files available. If not it should be left off as it will cause extra I/O + # for the check. It is best if you enable this in a location{} block for + # a specific directory, or on an individual server{} level. + # gzip_static on; server { listen 3301; From d8a8e224f478b8bdd437b426198736ef9e50fb63 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sat, 22 Dec 2018 08:07:20 +1100 Subject: [PATCH 09/29] enable brotli --- .docker/Dockerfile | 2 +- nginx.conf | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 7c6523c0..69174221 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -27,7 +27,7 @@ RUN npm run build ### STAGE 2: Production Environment ### -FROM nginx:1.13.12-alpine as web +FROM fholzer/nginx-brotli:1.13.12 as web COPY coriolis/.docker/nginx.conf /etc/nginx/nginx.conf COPY --from=builder /src/app/coriolis/build /usr/share/nginx/html WORKDIR /usr/share/nginx/html diff --git a/nginx.conf b/nginx.conf index af53edec..06c52e92 100644 --- a/nginx.conf +++ b/nginx.conf @@ -33,7 +33,10 @@ http { # ---------------------------------------------------------------------- # https://nginx.org/en/docs/http/ngx_http_gzip_module.html - + brotli on; + brotli_static on; + brotli_types *; + brotli_min_length 256; # Enable gzip compression. # Default: off gzip on; From d916c67fe02911a5e4bfe0b29607269ace8164a2 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sat, 22 Dec 2018 08:13:06 +1100 Subject: [PATCH 10/29] f --- .docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 69174221..ac89583d 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -27,7 +27,7 @@ RUN npm run build ### STAGE 2: Production Environment ### -FROM fholzer/nginx-brotli:1.13.12 as web +FROM fholzer/nginx-brotli as web COPY coriolis/.docker/nginx.conf /etc/nginx/nginx.conf COPY --from=builder /src/app/coriolis/build /usr/share/nginx/html WORKDIR /usr/share/nginx/html From fdf16cd9597a268c2aaaca765915162943e11c11 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sat, 22 Dec 2018 08:25:10 +1100 Subject: [PATCH 11/29] maybe --- nginx.conf | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/nginx.conf b/nginx.conf index 06c52e92..535e2e4b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -68,36 +68,7 @@ http { # Compress all output labeled with one of the following MIME-types. # text/html is always compressed by gzip module. # Default: text/html - gzip_types - application/atom+xml - application/javascript - application/json - application/ld+json - application/manifest+json - application/rss+xml - application/geo+json - application/vnd.ms-fontobject - application/x-font-ttf - application/x-web-app-manifest+json - application/xhtml+xml - application/xml - application/rdf+xml - font/collection - font/opentype - font/otf - font/ttf - image/bmp - image/svg+xml - image/x-icon - text/cache-manifest - text/css - text/javascript - text/plain - text/vcard - text/vnd.rim.location.xloc - text/vtt - text/x-component - text/x-cross-domain-policy; + gzip_types *; # This should be turned on if you are going to have pre-compressed copies (.gz) of # static files available. If not it should be left off as it will cause extra I/O @@ -112,7 +83,6 @@ http { index index.html; location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ { - expires -1; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Credentials true; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; From 68fd13e8dc4339c7f84a21e34099de2e60eb4a4e Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sat, 22 Dec 2018 08:25:53 +1100 Subject: [PATCH 12/29] /shrgu --- nginx.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 535e2e4b..c5089e52 100644 --- a/nginx.conf +++ b/nginx.conf @@ -34,9 +34,8 @@ http { # https://nginx.org/en/docs/http/ngx_http_gzip_module.html brotli on; - brotli_static on; + # brotli_static on; brotli_types *; - brotli_min_length 256; # Enable gzip compression. # Default: off gzip on; From 3894915740dd3df1d9e085a93a4992f43173f3cb Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sun, 23 Dec 2018 06:39:32 +1100 Subject: [PATCH 13/29] fix nginx conf --- .docker/nginx.conf | 78 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 13 deletions(-) diff --git a/.docker/nginx.conf b/.docker/nginx.conf index 17639330..f6019e21 100644 --- a/.docker/nginx.conf +++ b/.docker/nginx.conf @@ -10,17 +10,59 @@ events { http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - sendfile on; - client_body_temp_path /tmp/client_body; - fastcgi_temp_path /tmp/fastcgi_temp; - proxy_temp_path /tmp/proxy_temp; - scgi_temp_path /tmp/scgi_temp; - uwsgi_temp_path /tmp/uwsgi_temp; - access_log /tmp/access.log; - error_log /tmp/error.log; + include /etc/nginx/mime.types; + default_type application/octet-stream; + sendfile on; + client_body_temp_path /tmp/client_body; + fastcgi_temp_path /tmp/fastcgi_temp; + proxy_temp_path /tmp/proxy_temp; + scgi_temp_path /tmp/scgi_temp; + uwsgi_temp_path /tmp/uwsgi_temp; + access_log /tmp/access.log; + error_log /tmp/error.log; + # https://nginx.org/en/docs/http/ngx_http_gzip_module.html + brotli on; + # brotli_static on; + brotli_types *; + # Enable gzip compression. + # Default: off + gzip on; + + # Compression level (1-9). + # 5 is a perfect compromise between size and CPU usage, offering about + # 75% reduction for most ASCII files (almost identical to level 9). + # Default: 1 + gzip_comp_level 5; + + # Don't compress anything that's already small and unlikely to shrink much + # if at all (the default is 20 bytes, which is bad as that usually leads to + # larger files after gzipping). + # Default: 20 + gzip_min_length 256; + + # Compress data even for clients that are connecting to us via proxies, + # identified by the "Via" header (required for CloudFront). + # Default: off + gzip_proxied any; + + # Tell proxies to cache both the gzipped and regular version of a resource + # whenever the client's Accept-Encoding capabilities header varies; + # Avoids the issue where a non-gzip capable client (which is extremely rare + # today) would display gibberish if their proxy gave them the gzipped version. + # Default: off + gzip_vary on; + + # Compress all output labeled with one of the following MIME-types. + # text/html is always compressed by gzip module. + # Default: text/html + gzip_types *; + + # This should be turned on if you are going to have pre-compressed copies (.gz) of + # static files available. If not it should be left off as it will cause extra I/O + # for the check. It is best if you enable this in a location{} block for + # a specific directory, or on an individual server{} level. + # gzip_static on; keepalive_timeout 3000; server { listen 80; @@ -31,15 +73,25 @@ http { autoindex on; location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ { - expires -1; add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Credentials true; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; access_log off; } - location / { - try_files $uri $uri/ /index.html =404; + location /service-worker.js { + expires -1; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Credentials true; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + access_log off; } + location / { + try_files $uri $uri/ /index.html =404; + } + location /iframe.html { + try_files $uri $uri/ /iframe.html =404; + } } } From 001fed67b70eec519668b1633cab82c8bdc7bdaa Mon Sep 17 00:00:00 2001 From: William Blythe Date: Sun, 23 Dec 2018 06:51:50 +1100 Subject: [PATCH 14/29] change order of compression --- .docker/nginx.conf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.docker/nginx.conf b/.docker/nginx.conf index f6019e21..a1f254db 100644 --- a/.docker/nginx.conf +++ b/.docker/nginx.conf @@ -22,9 +22,6 @@ http { error_log /tmp/error.log; # https://nginx.org/en/docs/http/ngx_http_gzip_module.html - brotli on; - # brotli_static on; - brotli_types *; # Enable gzip compression. # Default: off gzip on; @@ -57,7 +54,9 @@ http { # text/html is always compressed by gzip module. # Default: text/html gzip_types *; - + brotli on; + # brotli_static on; + brotli_types *; # This should be turned on if you are going to have pre-compressed copies (.gz) of # static files available. If not it should be left off as it will cause extra I/O # for the check. It is best if you enable this in a location{} block for From 03020743b38732e776cc44bea0f3efec0b7f28c2 Mon Sep 17 00:00:00 2001 From: Willyb321 Date: Sun, 23 Dec 2018 07:51:42 +1100 Subject: [PATCH 15/29] some docker adjustments, fix brotli comprpession --- .docker/nginx.conf | 96 ----------- .docker/Dockerfile => Dockerfile | 13 +- .../docker-compose.yml => docker-compose.yml | 0 nginx.conf | 161 +++++++++--------- webpack.config.prod.js | 18 +- 5 files changed, 94 insertions(+), 194 deletions(-) delete mode 100644 .docker/nginx.conf rename .docker/Dockerfile => Dockerfile (75%) rename .docker/docker-compose.yml => docker-compose.yml (100%) diff --git a/.docker/nginx.conf b/.docker/nginx.conf deleted file mode 100644 index a1f254db..00000000 --- a/.docker/nginx.conf +++ /dev/null @@ -1,96 +0,0 @@ -worker_processes 1; -user nobody nobody; -error_log /tmp/error.log; -pid /tmp/nginx.pid; - -events { - - worker_connections 1024; -} - -http { - - include /etc/nginx/mime.types; - default_type application/octet-stream; - sendfile on; - client_body_temp_path /tmp/client_body; - fastcgi_temp_path /tmp/fastcgi_temp; - proxy_temp_path /tmp/proxy_temp; - scgi_temp_path /tmp/scgi_temp; - uwsgi_temp_path /tmp/uwsgi_temp; - access_log /tmp/access.log; - error_log /tmp/error.log; - - # https://nginx.org/en/docs/http/ngx_http_gzip_module.html - # Enable gzip compression. - # Default: off - gzip on; - - # Compression level (1-9). - # 5 is a perfect compromise between size and CPU usage, offering about - # 75% reduction for most ASCII files (almost identical to level 9). - # Default: 1 - gzip_comp_level 5; - - # Don't compress anything that's already small and unlikely to shrink much - # if at all (the default is 20 bytes, which is bad as that usually leads to - # larger files after gzipping). - # Default: 20 - gzip_min_length 256; - - # Compress data even for clients that are connecting to us via proxies, - # identified by the "Via" header (required for CloudFront). - # Default: off - gzip_proxied any; - - # Tell proxies to cache both the gzipped and regular version of a resource - # whenever the client's Accept-Encoding capabilities header varies; - # Avoids the issue where a non-gzip capable client (which is extremely rare - # today) would display gibberish if their proxy gave them the gzipped version. - # Default: off - gzip_vary on; - - # Compress all output labeled with one of the following MIME-types. - # text/html is always compressed by gzip module. - # Default: text/html - gzip_types *; - brotli on; - # brotli_static on; - brotli_types *; - # This should be turned on if you are going to have pre-compressed copies (.gz) of - # static files available. If not it should be left off as it will cause extra I/O - # for the check. It is best if you enable this in a location{} block for - # a specific directory, or on an individual server{} level. - # gzip_static on; - keepalive_timeout 3000; - server { - listen 80; - listen [::]:80; - index index.html; - server_name localhost; - root /usr/share/nginx/html; - autoindex on; - - location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ { - add_header Access-Control-Allow-Origin *; - add_header Access-Control-Allow-Credentials true; - add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; - add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; - access_log off; - } - location /service-worker.js { - expires -1; - add_header Access-Control-Allow-Origin *; - add_header Access-Control-Allow-Credentials true; - add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; - add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; - access_log off; - } - location / { - try_files $uri $uri/ /index.html =404; - } - location /iframe.html { - try_files $uri $uri/ /iframe.html =404; - } - } -} diff --git a/.docker/Dockerfile b/Dockerfile similarity index 75% rename from .docker/Dockerfile rename to Dockerfile index ac89583d..3c44bd3f 100644 --- a/.docker/Dockerfile +++ b/Dockerfile @@ -6,29 +6,28 @@ WORKDIR /src/app RUN mkdir -p /src/app/coriolis RUN mkdir -p /src/app/coriolis-data -COPY ./coriolis/ /src/app/coriolis -COPY ./coriolis-data/ /src/app/coriolis-data +RUN apk add --update git -RUN apk update -RUN apk add git +COPY . /src/app/coriolis RUN npm i -g npm # Set up coriolis-data WORKDIR /src/app/coriolis-data -RUN git fetch --all +RUN git clone https://github.com/EDCD/coriolis-data.git . +RUN git checkout ${BRANCH} RUN npm install --no-package-lock RUN npm start +# Set up coriolis WORKDIR /src/app/coriolis -RUN git fetch --all RUN npm install --no-package-lock RUN npm run build ### STAGE 2: Production Environment ### FROM fholzer/nginx-brotli as web -COPY coriolis/.docker/nginx.conf /etc/nginx/nginx.conf +COPY nginx.conf /etc/nginx/nginx.conf COPY --from=builder /src/app/coriolis/build /usr/share/nginx/html WORKDIR /usr/share/nginx/html EXPOSE 80 diff --git a/.docker/docker-compose.yml b/docker-compose.yml similarity index 100% rename from .docker/docker-compose.yml rename to docker-compose.yml diff --git a/nginx.conf b/nginx.conf index c5089e52..874aefa0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,99 +1,96 @@ -worker_processes 2; -error_log ./nginx.error.log; -worker_rlimit_nofile 8192; -pid nginx.pid; +worker_processes 1; +user nobody nobody; +error_log /tmp/error.log; +pid /tmp/nginx.pid; events { - worker_connections 1024; - multi_accept on; + + worker_connections 1024; } http { - access_log off; - charset UTF-8; + include /etc/nginx/mime.types; + default_type application/octet-stream; + sendfile on; + client_body_temp_path /tmp/client_body; + fastcgi_temp_path /tmp/fastcgi_temp; + proxy_temp_path /tmp/proxy_temp; + scgi_temp_path /tmp/scgi_temp; + uwsgi_temp_path /tmp/uwsgi_temp; + access_log /tmp/access.log; + error_log /tmp/error.log; - types { - text/html html htm shtml; - text/css css; - text/xml xml rss; - image/gif gif; - image/jpeg jpeg jpg; - application/x-javascript js; - text/plain txt; - image/png png; - image/svg+xml svg; - image/x-icon ico; - application/pdf pdf; - text/cache-manifest appcache; - } + # https://nginx.org/en/docs/http/ngx_http_gzip_module.html + # Enable gzip compression. + # Default: off + gzip off; - # ---------------------------------------------------------------------- - # | Compression | - # ---------------------------------------------------------------------- + # Compression level (1-9). + # 5 is a perfect compromise between size and CPU usage, offering about + # 75% reduction for most ASCII files (almost identical to level 9). + # Default: 1 + gzip_comp_level 5; - # https://nginx.org/en/docs/http/ngx_http_gzip_module.html - brotli on; - # brotli_static on; - brotli_types *; - # Enable gzip compression. - # Default: off - gzip on; + # Don't compress anything that's already small and unlikely to shrink much + # if at all (the default is 20 bytes, which is bad as that usually leads to + # larger files after gzipping). + # Default: 20 + gzip_min_length 256; - # Compression level (1-9). - # 5 is a perfect compromise between size and CPU usage, offering about - # 75% reduction for most ASCII files (almost identical to level 9). - # Default: 1 - gzip_comp_level 5; + # Compress data even for clients that are connecting to us via proxies, + # identified by the "Via" header (required for CloudFront). + # Default: off + gzip_proxied any; - # Don't compress anything that's already small and unlikely to shrink much - # if at all (the default is 20 bytes, which is bad as that usually leads to - # larger files after gzipping). - # Default: 20 - gzip_min_length 256; + # Tell proxies to cache both the gzipped and regular version of a resource + # whenever the client's Accept-Encoding capabilities header varies; + # Avoids the issue where a non-gzip capable client (which is extremely rare + # today) would display gibberish if their proxy gave them the gzipped version. + # Default: off + gzip_vary on; - # Compress data even for clients that are connecting to us via proxies, - # identified by the "Via" header (required for CloudFront). - # Default: off - gzip_proxied any; + # Compress all output labeled with one of the following MIME-types. + # text/html is always compressed by gzip module. + # Default: text/html + gzip_types *; + brotli on; + # brotli_static on; + brotli_types *; + # This should be turned on if you are going to have pre-compressed copies (.gz) of + # static files available. If not it should be left off as it will cause extra I/O + # for the check. It is best if you enable this in a location{} block for + # a specific directory, or on an individual server{} level. + # gzip_static on; + keepalive_timeout 3000; + server { + listen 80; + listen [::]:80; + index index.html; + server_name localhost; + root /usr/share/nginx/html; + autoindex on; - # Tell proxies to cache both the gzipped and regular version of a resource - # whenever the client's Accept-Encoding capabilities header varies; - # Avoids the issue where a non-gzip capable client (which is extremely rare - # today) would display gibberish if their proxy gave them the gzipped version. - # Default: off - gzip_vary on; - - # Compress all output labeled with one of the following MIME-types. - # text/html is always compressed by gzip module. - # Default: text/html - gzip_types *; - - # This should be turned on if you are going to have pre-compressed copies (.gz) of - # static files available. If not it should be left off as it will cause extra I/O - # for the check. It is best if you enable this in a location{} block for - # a specific directory, or on an individual server{} level. - # gzip_static on; - - server { - listen 3301; - server_name localhost; - root ./build/; - index index.html; - - location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ { - add_header Access-Control-Allow-Origin *; + location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ { + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Credentials true; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + access_log off; + } + location /service-worker.js { + expires -1; + add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Credentials true; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; - access_log off; - } - - location / { - try_files $uri $uri/ /index.html =404; - } - location /iframe.html { - try_files $uri $uri/ /iframe.html =404; - } - } + access_log off; + } + location / { + try_files $uri $uri/ /index.html =404; + } + location /iframe.html { + try_files $uri $uri/ /iframe.html =404; + } + } } diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 8589ff5e..97b3b85c 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -50,15 +50,15 @@ module.exports = { disable: false, allChunks: true }), - new BugsnagBuildReporterPlugin({ - apiKey: 'ba9fae819372850fb660755341fa6ef5', - appVersion: `${pkgJson.version}-${buildDate.toISOString()}` - }, { /* opts */ }), - new BugsnagSourceMapUploaderPlugin({ - apiKey: 'ba9fae819372850fb660755341fa6ef5', - overwrite: true, - appVersion: `${pkgJson.version}-${buildDate.toISOString()}` - }), + // new BugsnagBuildReporterPlugin({ + // apiKey: 'ba9fae819372850fb660755341fa6ef5', + // appVersion: `${pkgJson.version}-${buildDate.toISOString()}` + // }, { /* opts */ }), + // new BugsnagSourceMapUploaderPlugin({ + // apiKey: 'ba9fae819372850fb660755341fa6ef5', + // overwrite: true, + // appVersion: `${pkgJson.version}-${buildDate.toISOString()}` + // }), new InjectManifest({ swSrc: './src/sw.js', importWorkboxFrom: 'cdn', From ee3c50e27d9a7dcea7c97a26fe61b32fc375857b Mon Sep 17 00:00:00 2001 From: William Blythe Date: Tue, 25 Dec 2018 08:53:05 +1100 Subject: [PATCH 16/29] add christmas snow Credit: https://codepen.io/keithclark/pen/yBcsr --- src/index.ejs | 1 + src/less/app.less | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/index.ejs b/src/index.ejs index 784b8414..ae0c4f87 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -66,6 +66,7 @@ +
diff --git a/src/less/app.less b/src/less/app.less index 566a9825..bcf9c9da 100755 --- a/src/less/app.less +++ b/src/less/app.less @@ -25,6 +25,51 @@ @import 'defence'; @import 'offence'; +// Christmas Start + +html { + height: 100%; + background: linear-gradient(#123 30%, #667); + overflow: hidden; +} + +.snow, .snow:before, .snow:after { + position: absolute; + top: -600px; + left: 0; + bottom: 0; + right: 0; + background-image: radial-gradient(5px 5px at 227px 385px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 388px 387px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 11px 408px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 545px 477px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 43px 589px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 220px 6px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 436px 94px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 297px 106px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 290px 61px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 228px 436px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 474px 16px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 378px 280px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 74px 393px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 394px 405px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 408px 358px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 468px 576px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 455px 318px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 486px 482px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 471px 20px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 266px 567px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 71px 270px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 432px 26px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 374px 93px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 57px 86px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 426px 41px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 81px 32px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 332px 187px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 523px 200px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 64px 66px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 445px 263px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 591px 190px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 509px 46px, rgba(255, 255, 255, 0.9) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 283px 515px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 233px 178px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 453px 103px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)); + background-size: 600px 600px; + animation: snow 3s linear infinite; + content: ""; +} + +.snow:after { + margin-left: -200px; + opacity: .4; + animation-duration: 6s; + animation-direction: reverse; + filter: blur(3px); +} + +.snow:before { + animation-duration: 9s; + animation-direction: reverse; + margin-left: -300px; + opacity: .65; + filter: blur(1.5px); +} + +@keyframes snow { + to { + transform: translateY(600px); + } +} + +// Christmas End + + html, body { height: 100%; width: 100%; From 954921c231de748f06945944a75a189e50bfadbe Mon Sep 17 00:00:00 2001 From: William Blythe Date: Tue, 25 Dec 2018 09:06:00 +1100 Subject: [PATCH 17/29] probably fix scrolling --- src/less/app.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/less/app.less b/src/less/app.less index bcf9c9da..11606106 100755 --- a/src/less/app.less +++ b/src/less/app.less @@ -38,6 +38,7 @@ html { top: -600px; left: 0; bottom: 0; + pointer-events: none; right: 0; background-image: radial-gradient(5px 5px at 227px 385px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 388px 387px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 11px 408px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 545px 477px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 43px 589px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 220px 6px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 436px 94px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 297px 106px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 290px 61px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 228px 436px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 474px 16px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 378px 280px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 74px 393px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 394px 405px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 408px 358px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 468px 576px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 455px 318px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 486px 482px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 471px 20px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 266px 567px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 71px 270px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 432px 26px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 374px 93px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 57px 86px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 426px 41px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 81px 32px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 332px 187px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 523px 200px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 64px 66px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 445px 263px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 591px 190px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 509px 46px, rgba(255, 255, 255, 0.9) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 283px 515px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 233px 178px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 453px 103px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)); background-size: 600px 600px; From 2703c2aa2319bc7a0b25715d0d120a80a6eebf2f Mon Sep 17 00:00:00 2001 From: William Blythe Date: Tue, 25 Dec 2018 09:35:01 +1100 Subject: [PATCH 18/29] move mining laser to new mining group --- src/app/components/AvailableModulesMenu.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index 6a8d1de2..a9737618 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -95,7 +95,7 @@ const CATEGORIES = { 'structural reinforcement': ['hr', 'mrp'], 'dc': ['dc'], // Hardpoints - 'lasers': ['pl', 'ul', 'bl', 'ml'], + 'lasers': ['pl', 'ul', 'bl'], 'projectiles': ['mc', 'c', 'fc', 'pa', 'rg'], 'ordnance': ['mr', 'tp', 'nl'], // Utilities @@ -109,7 +109,7 @@ const CATEGORIES = { // Guardian 'guardian': ['gpp', 'gpd', 'gpc', 'ggc', 'gsrp', 'gfsb', 'ghrp', 'gmrp', 'gsc'], - 'mining': ['scl', 'pwa', 'sdm'], + 'mining': ['ml', 'scl', 'pwa', 'sdm'], }; /** From f85a03a9ae7cf2666f1f980dbc99932878f549aa Mon Sep 17 00:00:00 2001 From: William Blythe Date: Wed, 26 Dec 2018 08:29:45 +1100 Subject: [PATCH 19/29] remove christmas theme its 8:30am in sydney ok --- src/index.ejs | 1 - src/less/app.less | 46 ---------------------------------------------- 2 files changed, 47 deletions(-) diff --git a/src/index.ejs b/src/index.ejs index ae0c4f87..784b8414 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -66,7 +66,6 @@ -
diff --git a/src/less/app.less b/src/less/app.less index 11606106..566a9825 100755 --- a/src/less/app.less +++ b/src/less/app.less @@ -25,52 +25,6 @@ @import 'defence'; @import 'offence'; -// Christmas Start - -html { - height: 100%; - background: linear-gradient(#123 30%, #667); - overflow: hidden; -} - -.snow, .snow:before, .snow:after { - position: absolute; - top: -600px; - left: 0; - bottom: 0; - pointer-events: none; - right: 0; - background-image: radial-gradient(5px 5px at 227px 385px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 388px 387px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 11px 408px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 545px 477px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 43px 589px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 220px 6px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 436px 94px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 297px 106px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 290px 61px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 228px 436px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 474px 16px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 378px 280px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 74px 393px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 394px 405px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 408px 358px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 468px 576px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 455px 318px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 486px 482px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 471px 20px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 266px 567px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 71px 270px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 432px 26px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 374px 93px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 57px 86px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 426px 41px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(4px 4px at 81px 32px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 332px 187px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 523px 200px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 64px 66px, white 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 445px 263px, rgba(255, 255, 255, 0.6) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 591px 190px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(6px 6px at 509px 46px, rgba(255, 255, 255, 0.9) 50%, rgba(0, 0, 0, 0)), radial-gradient(5px 5px at 283px 515px, rgba(255, 255, 255, 0.8) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 233px 178px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)), radial-gradient(3px 3px at 453px 103px, rgba(255, 255, 255, 0.7) 50%, rgba(0, 0, 0, 0)); - background-size: 600px 600px; - animation: snow 3s linear infinite; - content: ""; -} - -.snow:after { - margin-left: -200px; - opacity: .4; - animation-duration: 6s; - animation-direction: reverse; - filter: blur(3px); -} - -.snow:before { - animation-duration: 9s; - animation-direction: reverse; - margin-left: -300px; - opacity: .65; - filter: blur(1.5px); -} - -@keyframes snow { - to { - transform: translateY(600px); - } -} - -// Christmas End - - html, body { height: 100%; width: 100%; From 2936364934dd575b3cca1a4107f0003fac66aa89 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Wed, 26 Dec 2018 08:50:00 +1100 Subject: [PATCH 20/29] prep for abl --- src/app/components/AvailableModulesMenu.jsx | 2 +- src/app/i18n/en.json | 1 + src/app/shipyard/Constants.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index a9737618..d26f3865 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -109,7 +109,7 @@ const CATEGORIES = { // Guardian 'guardian': ['gpp', 'gpd', 'gpc', 'ggc', 'gsrp', 'gfsb', 'ghrp', 'gmrp', 'gsc'], - 'mining': ['ml', 'scl', 'pwa', 'sdm'], + 'mining': ['ml', 'scl', 'pwa', 'sdm', 'abl'], }; /** diff --git a/src/app/i18n/en.json b/src/app/i18n/en.json index 3badba14..a5a7d71b 100644 --- a/src/app/i18n/en.json +++ b/src/app/i18n/en.json @@ -133,6 +133,7 @@ "ghrp": "Guardian Hull Reinforcement Package", "gmrp": "Guardian Module Reinforcement Package", "pwa": "Pulse Wave Analyser", + "abl": "Abrasion Blaster", "scl": "Seismic Charge Launcher", "sdm": "Sub-Surface Displacement Missile", "tbsc": "Shock Cannon", diff --git a/src/app/shipyard/Constants.js b/src/app/shipyard/Constants.js index 8b6b06fc..60dd67d2 100755 --- a/src/app/shipyard/Constants.js +++ b/src/app/shipyard/Constants.js @@ -95,6 +95,7 @@ export const ModuleGroupToName = { tbem: 'Enzyme Missile Rack', tbrfl: 'Remote Release Flechette Launcher', pwa: 'Pulse Wave Analyser', + abl: 'Abrasion Blaster', scl: 'Seismic Charge Launcher', sdm: 'Sub-Surface Displacement Missile', }; From 98782da200ffc6f136fb47c525d6897d7c3e30da Mon Sep 17 00:00:00 2001 From: William Blythe Date: Wed, 26 Dec 2018 09:07:05 +1100 Subject: [PATCH 21/29] make shipyardpage not dynamic import --- src/app/Coriolis.jsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/Coriolis.jsx b/src/app/Coriolis.jsx index d812497f..2fd3e790 100644 --- a/src/app/Coriolis.jsx +++ b/src/app/Coriolis.jsx @@ -16,6 +16,7 @@ import ModalPermalink from './components/ModalPermalink'; import * as CompanionApiUtils from './utils/CompanionApiUtils'; import * as JournalUtils from './utils/JournalUtils'; import NotFoundPage from './pages/NotFoundPage'; +import ShipyardPage from './pages/ShipyardPage'; import ErrorDetails from './pages/ErrorDetails'; const zlib = require('pako'); @@ -69,12 +70,7 @@ export default class Coriolis extends React.Component { sizeRatio: Persist.getSizeRatio() }; this._getAnnouncements(); - Router('', (r) => { - return import(/* webpackChunkName: "shipyard" */ './pages/ShipyardPage') - .then(ShipyardPage => { - return this._setPage(ShipyardPage.default, r); - }) - }); + Router('', (r) => this._setPage(ShipyardPage, r)); Router('/import?', (r) => this._importBuild(r)); Router('/import/:data', (r) => this._importBuild(r)); Router('/outfit/?', (r) => { From 7752d5c9db90c1808ab7c315abf284f8a0d26678 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Wed, 26 Dec 2018 09:23:44 +1100 Subject: [PATCH 22/29] Fix #445 --- .esdoc.json | 6 +++--- package.json | 2 +- src/app/shipyard/Serializer.js | 4 ++-- src/schemas/ship-loadout/1.json | 2 +- src/schemas/ship-loadout/2.json | 2 +- src/schemas/ship-loadout/3.json | 2 +- src/schemas/ship-loadout/4.json | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.esdoc.json b/.esdoc.json index 4d236594..99f1efa6 100644 --- a/.esdoc.json +++ b/.esdoc.json @@ -35,7 +35,7 @@ "title": "Coriolis", "description": "Coriolis Shipyard for Elite Dangerous", "repository": "https://github.com/EDCD/coriolis", - "site": "https://coriolis.edcd.io", + "site": "https://coriolis.io", "author": "https://github.com/edcd", "image": "./src/images/logo/192x192.png" } @@ -81,7 +81,7 @@ "title": "Coriolis", "description": "Coriolis Shipyard for Elite Dangerous", "repository": "https://github.com/EDCD/coriolis", - "site": "https://coriolis.edcd.io", + "site": "https://coriolis.io", "author": "https://github.com/edcd", "image": "./src/images/logo/192x192.png" } @@ -100,4 +100,4 @@ } } ] -} \ No newline at end of file +} diff --git a/package.json b/package.json index a507a9ff..f937daee 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "type": "git", "url": "https://github.com/EDCD/coriolis" }, - "homepage": "https://coriolis.edcd.io", + "homepage": "https://coriolis.io", "bugs": "https://github.com/EDCD/coriolis/issues", "private": true, "engine": "node >= 4.8.1", diff --git a/src/app/shipyard/Serializer.js b/src/app/shipyard/Serializer.js index 566d5c30..d7b7836f 100644 --- a/src/app/shipyard/Serializer.js +++ b/src/app/shipyard/Serializer.js @@ -85,12 +85,12 @@ export function toDetailedBuild(buildName, ship) { code = ship.toString(); let data = { - $schema: 'https://coriolis.edcd.io/schemas/ship-loadout/4.json#', + $schema: 'https://coriolis.io/schemas/ship-loadout/4.json#', name: buildName, ship: ship.name, references: [{ name: 'Coriolis.io', - url: 'https://coriolis.edcd.io' + outfitURL(ship.id, code, buildName), + url: 'https://coriolis.io' + outfitURL(ship.id, code, buildName), code, shipId: ship.id }], diff --git a/src/schemas/ship-loadout/1.json b/src/schemas/ship-loadout/1.json index 375b233c..497e1f49 100644 --- a/src/schemas/ship-loadout/1.json +++ b/src/schemas/ship-loadout/1.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "id": "https://coriolis.edcd.io/schemas/ship-loadout/1.json#", + "id": "https://coriolis.io/schemas/ship-loadout/1.json#", "title": "Ship Loadout", "type": "object", "description": "The details for a specific ship build/loadout. DEPRECATED in favor of Version 3", diff --git a/src/schemas/ship-loadout/2.json b/src/schemas/ship-loadout/2.json index e24d1651..981ff460 100644 --- a/src/schemas/ship-loadout/2.json +++ b/src/schemas/ship-loadout/2.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "id": "https://coriolis.edcd.io/schemas/ship-loadout/2.json#", + "id": "https://coriolis.io/schemas/ship-loadout/2.json#", "title": "Ship Loadout", "type": "object", "description": "The details for a specific ship build/loadout. DEPRECATED in favor of Version 3", diff --git a/src/schemas/ship-loadout/3.json b/src/schemas/ship-loadout/3.json index 516d14db..15a919b8 100644 --- a/src/schemas/ship-loadout/3.json +++ b/src/schemas/ship-loadout/3.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "id": "https://coriolis.edcd.io/schemas/ship-loadout/3.json#", + "id": "https://coriolis.io/schemas/ship-loadout/3.json#", "title": "Ship Loadout", "type": "object", "description": "The details for a specific ship build/loadout", diff --git a/src/schemas/ship-loadout/4.json b/src/schemas/ship-loadout/4.json index 7dcc1987..6766d3ac 100644 --- a/src/schemas/ship-loadout/4.json +++ b/src/schemas/ship-loadout/4.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "id": "https://coriolis.edcd.io/schemas/ship-loadout/4.json#", + "id": "https://coriolis.io/schemas/ship-loadout/4.json#", "title": "Ship Loadout", "type": "object", "description": "The details for a specific ship build/loadout", From a073692632156194a8ce4b3f8c582796e5efffb8 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Thu, 27 Dec 2018 08:18:38 +1100 Subject: [PATCH 23/29] add probe radius --- src/app/i18n/en.json | 1 + src/app/shipyard/StatsFormatting.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/i18n/en.json b/src/app/i18n/en.json index a5a7d71b..1d45fcb9 100644 --- a/src/app/i18n/en.json +++ b/src/app/i18n/en.json @@ -238,6 +238,7 @@ "rof": "Rate of fire", "angle": "Scan angle", "scanrate": "Scan rate", + "proberadius": "Probe Radius", "scantime": "Scan time", "shield": "Shield", "armour": "Armour", diff --git a/src/app/shipyard/StatsFormatting.js b/src/app/shipyard/StatsFormatting.js index 8effaa36..3cbb66fd 100644 --- a/src/app/shipyard/StatsFormatting.js +++ b/src/app/shipyard/StatsFormatting.js @@ -78,5 +78,6 @@ export const STATS_FORMATTING = { 'thermres': { 'format': 'pct' }, 'wepcap': { 'format': 'round1', 'unit': 'MJ' }, 'weprate': { 'format': 'round1', 'unit': 'MW' }, - 'jumpboost': { 'format': 'round1', 'unit': 'LY' } + 'jumpboost': { 'format': 'round1', 'unit': 'LY' }, + 'proberadius': { 'format': 'pct1', 'unit': 'pct' }, }; From 593f069806e608cfd20ff8f172521957deaf7708 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Mon, 31 Dec 2018 08:18:36 +1100 Subject: [PATCH 24/29] Fix title being page not found even after page has loaded --- src/app/pages/Page.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/pages/Page.jsx b/src/app/pages/Page.jsx index 57f17ae2..37174da9 100644 --- a/src/app/pages/Page.jsx +++ b/src/app/pages/Page.jsx @@ -70,6 +70,13 @@ export default class Page extends React.Component { document.title = this.state.title || 'Coriolis'; } + /** + * Update the window title upon mount + */ + componentDidMount() { + document.title = this.state.title || 'Coriolis'; + } + /** * Updates the title upon change * @param {Object} newProps Incoming properties From 48092d439597215d88d87a8a4bb165ece4c81f80 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Wed, 2 Jan 2019 12:13:27 +1100 Subject: [PATCH 25/29] trycatch announcements check --- src/app/Coriolis.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/Coriolis.jsx b/src/app/Coriolis.jsx index 2fd3e790..730e7548 100644 --- a/src/app/Coriolis.jsx +++ b/src/app/Coriolis.jsx @@ -146,12 +146,14 @@ export default class Coriolis extends React.Component { } } - _getAnnouncements() { - return request.get('https://orbis.zone/api/announcement') - .query({ showInCoriolis: true }) - .then(announces => { - this.setState({ announcements: announces.body }); - }); + async _getAnnouncements() { + try { + const announces = await request.get('https://orbis.zone/api/announcement') + .query({ showInCoriolis: true }); + this.setState({ announcements: announces.body }); + } catch (err) { + console.error(err) + } } /** From a181791500a4da9863e053eaec965c2826f47bb0 Mon Sep 17 00:00:00 2001 From: Willyb321 Date: Thu, 3 Jan 2019 08:45:20 +1100 Subject: [PATCH 26/29] We don't run ads now. --- src/app/pages/AboutPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/AboutPage.jsx b/src/app/pages/AboutPage.jsx index 656ac95e..9b0977f2 100644 --- a/src/app/pages/AboutPage.jsx +++ b/src/app/pages/AboutPage.jsx @@ -103,7 +103,7 @@ export default class AboutPage extends Page { patreon.com/coriolis_elite , which will be used to keep Coriolis up to date and the servers - running. I also run ads, which are also used for development and hosting. + running.

Date: Thu, 3 Jan 2019 08:54:22 +1100 Subject: [PATCH 27/29] Remove dynamic import for pages Closes #441 --- src/app/Coriolis.jsx | 57 +++++++++----------------------------------- 1 file changed, 11 insertions(+), 46 deletions(-) diff --git a/src/app/Coriolis.jsx b/src/app/Coriolis.jsx index 730e7548..8b544b1f 100644 --- a/src/app/Coriolis.jsx +++ b/src/app/Coriolis.jsx @@ -15,7 +15,10 @@ import ModalImport from './components/ModalImport'; import ModalPermalink from './components/ModalPermalink'; import * as CompanionApiUtils from './utils/CompanionApiUtils'; import * as JournalUtils from './utils/JournalUtils'; +import AboutPage from './pages/AboutPage'; import NotFoundPage from './pages/NotFoundPage'; +import OutfittingPage from './pages/OutfittingPage'; +import ComparisonPage from './pages/ComparisonPage'; import ShipyardPage from './pages/ShipyardPage'; import ErrorDetails from './pages/ErrorDetails'; @@ -73,48 +76,13 @@ export default class Coriolis extends React.Component { Router('', (r) => this._setPage(ShipyardPage, r)); Router('/import?', (r) => this._importBuild(r)); Router('/import/:data', (r) => this._importBuild(r)); - Router('/outfit/?', (r) => { - return import(/* webpackChunkName: "outfit" */ './pages/OutfittingPage') - .then(OutfittingPage => { - return this._setPage(OutfittingPage.default, r); - }) - }); - Router('/outfit/:ship/?', (r) => { - return import(/* webpackChunkName: "outfit" */ './pages/OutfittingPage') - .then(OutfittingPage => { - return this._setPage(OutfittingPage.default, r); - }) - }); - Router('/outfit/:ship/:code?', (r) => { - return import(/* webpackChunkName: "outfit" */ './pages/OutfittingPage') - .then(OutfittingPage => { - return this._setPage(OutfittingPage.default, r); - }) - }); - Router('/compare/:name?', (r) => { - return import(/* webpackChunkName: "compare" */ './pages/ComparisonPage') - .then(ComparisonPage => { - return this._setPage(ComparisonPage.default, r); - }) - }); - Router('/comparison?', (r) => { - return import(/* webpackChunkName: "compare" */ './pages/ComparisonPage') - .then(ComparisonPage => { - return this._setPage(ComparisonPage.default, r); - }) - }); - Router('/comparison/:code', (r) => { - return import(/* webpackChunkName: "compare" */ './pages/ComparisonPage') - .then(ComparisonPage => { - return this._setPage(ComparisonPage.default, r); - }) - }); - Router('/about', (r) => { - return import(/* webpackChunkName: "about" */ './pages/AboutPage') - .then(AboutPage => { - return this._setPage(AboutPage.default, r); - }) - }); + Router('/outfit/?', (r) => this._setPage(OutfittingPage, r)); + Router('/outfit/:ship/?', (r) => this._setPage(OutfittingPage, r)); + Router('/outfit/:ship/:code?', (r) => this._setPage(OutfittingPage, r)); + Router('/compare/:name?', (r) => this._setPage(ComparisonPage, r)); + Router('/comparison?', (r) => this._setPage(ComparisonPage, r)); + Router('/comparison/:code', (r) => this._setPage(ComparisonPage, r)); + Router('/about', (r) => this._setPage(AboutPage, r)); Router('*', (r) => this._setPage(null, r)); } @@ -137,10 +105,7 @@ export default class Coriolis extends React.Component { } r.params.ship = ship.id; r.params.code = ship.toString(); - return import(/* webpackChunkName: "outfit" */ './pages/OutfittingPage') - .then(AboutPage => { - return this._setPage(AboutPage.default, r); - }) + this._setPage(OutfittingPage, r) } catch (err) { this._onError('Failed to import ship', r.path, 0, 0, err); } From b400db8216dd47ac1e9f02547ac417d86244eaf1 Mon Sep 17 00:00:00 2001 From: William Blythe Date: Fri, 4 Jan 2019 08:01:02 +1100 Subject: [PATCH 28/29] only cache if not 404 --- src/sw.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sw.js b/src/sw.js index 5eb5d3e0..9a724691 100644 --- a/src/sw.js +++ b/src/sw.js @@ -8,7 +8,13 @@ if (workbox) { workbox.routing.registerRoute( new RegExp('/(.*?)'), - workbox.strategies.staleWhileRevalidate() + workbox.strategies.staleWhileRevalidate({ + plugins: [ + new workbox.cacheableResponse.Plugin({ + statuses: [0, 200] + }) + ] + }) ); workbox.routing.registerRoute( From 4b854b8305742f670f372410c9fbfc608aa25b05 Mon Sep 17 00:00:00 2001 From: Willyb321 Date: Fri, 4 Jan 2019 09:28:21 +1100 Subject: [PATCH 29/29] Search tweaks --- src/app/components/AvailableModulesMenu.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index d26f3865..f712c938 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -228,7 +228,16 @@ export default class AvailableModulesMenu extends TranslatedComponent { } list.push(buildGroup(grp, modules[grp])); for (const i of modules[grp]) { - fuzzy.push({ grp, m: i, name: `${i.class}${i.rating} ${translate(grp)} ${i.mount ? i.mount : ''}` }); + let mount = ''; + if (i.mount === 'F') { + mount = 'Fixed'; + } else if (i.mount === 'G') { + mount = 'Gimballed'; + } else if (i.mount === 'T') { + mount = 'Turreted'; + } + const fuzz = { grp, m: i, name: `${i.class}${i.rating}${mount ? ' ' + mount : ''} ${translate(grp)}` }; + fuzzy.push(fuzz); } } } @@ -370,10 +379,14 @@ export default class AvailableModulesMenu extends TranslatedComponent { * mounted module and the hovered modules */ _showSearch() { + if (this.props.modules instanceof Array) { + return; + } return (