Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reporting improvements and a few other changes #328

Merged
merged 54 commits into from
Jun 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
94a1e84
chore: remove deprecated SASS div operator
UncleClapton May 21, 2021
ba59750
chore: update deps
UncleClapton May 21, 2021
cfcfcc8
refactor(ApiErrorBox): add improved error information
UncleClapton May 21, 2021
3e66b0f
refactor(fonts-scss): extract monospace fonts into a variable
UncleClapton May 21, 2021
545362a
feat(pre-scss): add more dark-mode friendly pre block styling
UncleClapton May 21, 2021
e3cba9d
refactor(terms-dialog-scss): remove redundant css
UncleClapton May 21, 2021
304ffae
refactor(useForm-hook): ensure initialState never changes by always r…
UncleClapton May 24, 2021
1824cd4
refactor: remove unnecessary Object.freeze() calls
UncleClapton May 24, 2021
07b0365
refactor: clean import statements in several files
UncleClapton May 24, 2021
9c22ef0
chore: add yarn install as a task in dev script
UncleClapton May 25, 2021
376280a
feat(ApiErrorBox): add title to error messages
UncleClapton Jun 1, 2021
5e6d215
feat(CurrencyFieldset): add fieldset for inputting currencies
UncleClapton Jun 2, 2021
c68dbc9
feat(DonationForm): add rewritten donation form
UncleClapton Jun 2, 2021
3da29d7
refactor(MessageBox): use small tag for footer text
UncleClapton Jun 3, 2021
c6f40f2
refactor(CurrencyFieldset): move component to form since it's a local…
UncleClapton Jun 4, 2021
fb85559
feat(DonationForm): finalize donation form code
UncleClapton Jun 4, 2021
4d7d16e
refactor(donate-page): use new donation form
UncleClapton Jun 4, 2021
42e4ac9
chore: redirect /donate/cancel back to donation form for now
UncleClapton Jun 4, 2021
08af9e4
fix(DonationForm): don't require stripe object since it won't exist o…
UncleClapton Jun 4, 2021
e85e95f
chore: remove old unused donate form
UncleClapton Jun 4, 2021
19176a8
refactor(RatCard): update label with better wording
UncleClapton Jun 4, 2021
530301b
chore: restructure and fill out package.json entries
UncleClapton Jun 7, 2021
ebc7760
chore: update deps
UncleClapton Jun 7, 2021
a405ed1
chore: update eslint config
UncleClapton Jun 9, 2021
ab1c2d5
refactor: comply with new eslint rules
UncleClapton Jun 9, 2021
ac7c099
fix: properly define donate redirect
UncleClapton Jun 9, 2021
f2b6c77
chore: add eslint-plugin-next
UncleClapton Jun 9, 2021
b53dd35
refactor: streamline appUrl usage
UncleClapton Jun 9, 2021
8e3178c
refactor: relocate avatars under api route
UncleClapton Jun 9, 2021
5027e7a
fix(document): add proper google font headers
UncleClapton Jun 9, 2021
027ee48
refactor: simplify public config, make api namespaces consistent
UncleClapton Jun 9, 2021
2cad6dc
refactor: rewrite version pages, separate api route to a proper location
UncleClapton Jun 9, 2021
b8fa801
refactor: use next/image for images
UncleClapton Jun 9, 2021
0a971fa
fix: correct breaking builds by giving APP_URL a default value.
UncleClapton Jun 11, 2021
d1cc439
chore: improve launch configs yet again
UncleClapton Jun 12, 2021
b9a1235
chore: add improved overrides for workers
UncleClapton Jun 12, 2021
1a80815
refactor(server): rework env file to provide easier defaults
UncleClapton Jun 12, 2021
63bb87e
refactor(image-loader-worker): remove unnecessary rule disable
UncleClapton Jun 12, 2021
b7e7ffc
chore: update deps
UncleClapton Jun 12, 2021
0f8ddc8
chore: update eslint configs
UncleClapton Jun 12, 2021
5bebdae
refactor(DonationErrorBox): use proper function name (whoops)
UncleClapton Jun 13, 2021
b15c93d
chore: update deps, add workaround for issue with SVGs in next@11.0.0
UncleClapton Jun 17, 2021
7c55feb
refactor(NewPasswordFieldset): Use import() code splitting instead of…
UncleClapton Jun 18, 2021
1c0ea14
refactor(AuthenticatedPage): rename module to match export name
UncleClapton Jun 18, 2021
9cd9391
refacot(useField-hook): remove unused arg from func call
UncleClapton Jun 18, 2021
7c1e8c1
chore: remove old workaround
UncleClapton Jun 18, 2021
92f1fe6
refactor(App): calculate page className at loadtime instead of every …
UncleClapton Jun 18, 2021
35aadee
fix(authorize-page): hide page when the user is redirected
UncleClapton Jun 18, 2021
78d5c03
fix(App): prevent 'undefined' from appearing in page className
UncleClapton Jun 18, 2021
dd90c0b
chore: comply with new lint rules
UncleClapton Jun 19, 2021
ed87743
refactor(server): move most redirects to next config.
UncleClapton Jun 19, 2021
23d73d5
chore: update deps
UncleClapton Jun 19, 2021
b77cc64
docs(CHANGELOG.md): add changes for #328
UncleClapton Jun 19, 2021
5e18b5d
chore: disable ESLint for next builds as this impedes our CI flow
UncleClapton Jun 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ module.exports = {
},
extends: [
'@fuelrats/eslint-config',
'@fuelrats/eslint-config/plugins/fuelrats',
'@fuelrats/eslint-config-react',
'plugin:@next/next/recommended',
],
rules: {
'jsx-a11y/no-noninteractive-element-interactions': ['off'], // We intend to enable this once we refactor certain key components.
'jsdoc/require-jsdoc': ['off'], // we'll get to it someday...
'react/jsx-uses-react': ['off'],
'react/react-in-jsx-scope': ['off'],
'import/order': ['error', {
...importRules.rules['import/order'][1],
'newlines-between': 'always',
}],
'@next/next/link-passhref': ['off'], // This rule is broken so just ignore it for now.
},
settings: {
'import/ignore': [
Expand All @@ -38,11 +37,25 @@ module.exports = {
},
overrides: [
{
files: ['src/pages/api/**/*.js'],
files: ['src/pages/api/**/*.js', 'src/server/**/*.mjs'],
env: {
browser: false,
node: true,
},
},
{
files: ['*.worker.js'],
env: {
browser: false,
commonjs: false,
worker: true,
},
},
{
files: ['src/pages/**/*.js'],
rules: {
'@fuelrats/default-export-matches-module-name': ['off'], // Disabled in pages dir as it becomes difficult to stick to module names
},
},
],
}
16 changes: 14 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
},
{
"name": "Next: Attach Chrome",
"type": "chrome",
"type": "pwa-chrome",
"request": "attach",
"port": 9222,
"url": "${config:develop.attachurl}",
"webRoot": "${workspaceFolder}"
}
{
"name": "Next: Attach Edge",
"type": "pwa-msedge",
"request": "attach",
"port": 9222,
"url": "${config:develop.attachurl}",
Expand All @@ -21,8 +29,12 @@
],
"compounds": [
{
"name": "Next: Attach",
"name": "Next: Attach All",
"configurations": ["Next: Attach Server", "Next: Attach Chrome"]
},
{
"name": "Next: Attach All (Edge)",
"configurations": ["Next: Attach Server", "Next: Attach Edge"]
}
]
}
17 changes: 13 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,25 @@ For detailed rules of this file, see [Changelog Rules](#changelog-rules)
*

### ⚡ Changed
*
* Error readout for unknown API Errors has been improved. - [#328][]
* Reworded `Owns Odyssey` to `Using Odyssey` on rat cards to better convey the toggle's meaning. - [#328][]
* Canceled donations will now return you to the donation form. - [#328][]
* Optimized image loading and accessibility for images site-wide. - [#328][]
* Further optimized font loading. - [#328][]
* Moved raw version information to an API route (`/api/version`), and reworked version page to draw information from that route. - [#328][]
* Other smaller changes to sreamline development. - [#328][]

### 🐛 Fixed
*

### 🐛 Fixed
* Resolved form submitting issues that occured when password evaluation fails to load. - [#328][]
* Fixed authorization page displaying an `Invalid Authorize Request` error when redirecting users after login. - [#328][]

### ⚙ Tasks
*
* Update lint configs
* Add `@next/eslint-plugin-next` into linting config.


[#328]: https://github.com/fuelRats/fuelrats.com/pull/328
[Unreleased]: https://github.com/FuelRats/fuelrats.com/compare/v2.13.0...HEAD


Expand Down
82 changes: 69 additions & 13 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/* eslint-env node */
const crypto = require('crypto')
const path = require('path')
const url = require('url')
const { DefinePlugin } = require('webpack')


Expand All @@ -12,7 +13,8 @@ const { DefinePlugin } = require('webpack')

// Constants
const {
APP_URL,
PORT = 3000,
APP_URL = `https://localhost:${PORT}`,
FR_API_URL,
FR_CLIENT_IRC_URL,
FR_RAT_IRC_URL,
Expand Down Expand Up @@ -41,19 +43,26 @@ module.exports = {
distDir: path.join('dist', 'next'),
generateBuildId,
images: {
domains: ['static-cdn.jtvnw.net'],
disableStaticImages: true,
domains: [
url.parse(APP_URL).hostname, // Ensure the public hostname is always allowed.
'wordpress.fuelrats.com',
'static-cdn.jtvnw.net',
],
},
eslint: {
// Ignore ESLint in builds as our CI Takes care of this for us.
ignoreDuringBuilds: true,
},
publicRuntimeConfig: {
local: {
publicUrl: APP_URL,
},
appUrl: APP_URL,
irc: {
client: FR_CLIENT_IRC_URL ?? 'https://qms.fuelrats.dev',
rat: FR_RAT_IRC_URL ?? 'https://kiwi.fuelrats.com',
},
apis: {
fuelRats: {
local: `${APP_URL}/api/fr`,
url: `${APP_URL}/api/fr`,
server: FR_API_URL ?? 'https://dev.api.fuelrats.com',
socket: FR_SOCKET_URL ?? 'wss://dev.api.fuelrats.com',
},
Expand All @@ -66,8 +75,60 @@ module.exports = {
},
},
},
future: {
webpack5: true,
redirects: () => {
return [
{
// Temporary workaround so canceled donations return to donate screen
source: '/donate/cancel',
destination: '/donate',
permanent: false,
},
{
// Profile page requires a tab name in the path
source: '/profile',
destination: '/profile/overview',
permanent: true,
},
{
// Old blog used to exist at /blogs
source: '/blogs',
destination: '/blog',
permanent: true,
},
{
// get-help was used at launch of the website, but has since been changed back.
source: '/get-help',
destination: '/i-need-fuel',
permanent: true,
},
{
// Common endpoint for privacy policies
source: '/privacy',
destination: '/privacy-policy',
permanent: true,
},
{
// Lexicon is no longer local
source: '/fuel-rats-lexicon',
destination: 'https://confluence.fuelrats.com/pages/viewpage.action?pageId=3637257',
permanent: true,
basePath: false,
},
{
// statistics are no longer local
source: '/statistics',
destination: 'https://grafana.fuelrats.com',
permanent: true,
basePath: false,
},
{
// People often type this one manually into their URL bar to get to the helpdesk
source: '/help',
destination: 'https://t.fuelr.at/help',
permanent: true,
basePath: false,
},
]
},
webpack: (config, opt) => {
/* Define Plugin */
Expand All @@ -86,11 +147,6 @@ module.exports = {
// Workaround to fix dev warning: https://github.com/vercel/next.js/issues/19865
config.output.hotUpdateMainFilename = 'static/webpack/[fullhash].[runtime].hot-update.json'

// Workaround to fix production builds with workers: https://github.com/vercel/next.js/issues/22813
config.output.chunkFilename = opt.isServer
? `${opt.dev ? '[name]' : '[name].[fullhash]'}.js`
: `static/chunks/${opt.dev ? '[name]' : '[name].[fullhash]'}.js`

/* SVGR */
config.module.rules.push({
exclude: /node_modules/u,
Expand Down
Loading