-
Notifications
You must be signed in to change notification settings - Fork 394
upgrade react scripts #507
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
Changes from 12 commits
fbb2db2
6e2ba27
303b0e2
0e85897
d4b338c
26be7bf
7b05911
798033e
a5da2e8
e05030e
a594482
b8b6047
19c65c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GENERATE_SOURCEMAP=false | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const webpack = require("webpack"); | ||
|
||
module.exports = function override(config) { | ||
// https://github.com/lingui/js-lingui/issues/1195 | ||
// Adding loader to use for .po files to webpack | ||
const loaders = config.module.rules.find((rule) => Array.isArray(rule.oneOf)); | ||
loaders.oneOf.splice(loaders.length - 1, 0, { | ||
test: /\.po/, | ||
use: [ | ||
{ | ||
loader: "@lingui/loader", | ||
}, | ||
], | ||
}); | ||
|
||
config.resolve.fallback = { | ||
os: false, | ||
http: false, | ||
https: false, | ||
stream: false, | ||
crypto: false, | ||
}; | ||
config.plugins = (config.plugins || []).concat([ | ||
new webpack.ProvidePlugin({ | ||
Buffer: ["buffer", "Buffer"], | ||
}), | ||
]); | ||
return config; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,7 @@ function getFeeLabel(type: FeeType) { | |
deposit: t`Deposit Fee`, | ||
execution: t`Execution Fee`, | ||
}; | ||
|
||
return i18n._(labels[type]); | ||
return i18n._(/*i18n*/ labels[type]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mm, is /i18n/ some kind of magic comment for lingui? Or can it be deleted? Btw, probably this syntax is not needed as getFeeLabel is called inside component during render so language should update correctly with simple return?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I tested it and works well. I have removed it now. |
||
} | ||
|
||
function getExecutionFeeStr(chainId, executionFee, executionFeeUsd) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { defineMessage } from "@lingui/macro"; | ||
import { t } from "@lingui/macro"; | ||
import "./Footer.css"; | ||
import twitterIcon from "img/ic_twitter.svg"; | ||
import discordIcon from "img/ic_discord.svg"; | ||
import telegramIcon from "img/ic_telegram.svg"; | ||
import githubIcon from "img/ic_github.svg"; | ||
import substackIcon from "img/ic_substack.svg"; | ||
import { MessageDescriptor } from "@lingui/core"; | ||
|
||
type Link = { | ||
text: MessageDescriptor; | ||
text: string; | ||
link: string; | ||
external?: boolean; | ||
isAppLink?: boolean; | ||
|
@@ -22,13 +21,13 @@ type SocialLink = { | |
|
||
export const FOOTER_LINKS: { home: Link[]; app: Link[] } = { | ||
home: [ | ||
{ text: defineMessage({ message: "Terms and Conditions" }), link: "/terms-and-conditions" }, | ||
{ text: defineMessage({ message: "Referral Terms" }), link: "/referral-terms" }, | ||
{ text: defineMessage({ message: "Media Kit" }), link: "https://gmxio.gitbook.io/gmx/media-kit", external: true }, | ||
{ text: t`Terms and Conditions`, link: "/terms-and-conditions" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but here FOOTER_LINKS should be inside getFooterLinks function? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved it. Thanks for noticing. |
||
{ text: t`Referral Terms`, link: "/referral-terms" }, | ||
{ text: t`Media Kit`, link: "https://gmxio.gitbook.io/gmx/media-kit", external: true }, | ||
// { text: "Jobs", link: "/jobs", isAppLink: true }, | ||
], | ||
app: [ | ||
{ text: defineMessage({ message: "Media Kit" }), link: "https://gmxio.gitbook.io/gmx/media-kit", external: true }, | ||
{ text: t`Media Kit`, link: "https://gmxio.gitbook.io/gmx/media-kit", external: true }, | ||
// { text: "Jobs", link: "/jobs" }, | ||
], | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it mean local server and/or test stands won't have source maps?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is set for production.
From docs:
When set to false, source maps are not generated for a production build. This solves out of memory (OOM) issues on some smaller machines.
https://create-react-app.dev/docs/advanced-configuration/
Active PR for the issue: facebook/create-react-app#11752