-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance imrovements: webpack config(uglify & chunks), code refactor
- Loading branch information
Showing
84 changed files
with
2,979 additions
and
2,441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
module.exports = { | ||
plugins: ["styled-jsx/babel"], | ||
compact: true, | ||
plugins: [ | ||
"styled-jsx/babel", | ||
"@babel/plugin-syntax-dynamic-import", | ||
[ | ||
"babel-plugin-styled-components", | ||
{ | ||
minify: true, | ||
transpileTemplateLiterals: false, | ||
}, | ||
], | ||
], | ||
presets: ["@babel/preset-typescript", "@babel/react"], | ||
}; | ||
env: { | ||
production: { | ||
plugins: ["transform-remove-console"], | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from "react" | ||
import { Web3OnboardProvider } from "@web3-onboard/react" | ||
import { Provider } from "react-redux" | ||
import web3Onboard from "shared/utils/web3Onboard" | ||
import { PostHogProvider } from "posthog-js/react" | ||
import { BrowserRouter as Router } from "react-router-dom" | ||
import GlobalStyles from "ui/GlobalStyles" | ||
import { POSTHOG_API_KEY, POSTHOG_API_OPTIONS } from "config/posthog" | ||
import Dapp from "ui/DApp/Dapp" | ||
import reduxStore from "./redux-state" | ||
|
||
export default function App() { | ||
return ( | ||
<> | ||
<GlobalStyles /> | ||
<PostHogProvider apiKey={POSTHOG_API_KEY} options={POSTHOG_API_OPTIONS}> | ||
<Provider store={reduxStore}> | ||
<Web3OnboardProvider web3Onboard={web3Onboard}> | ||
<Router> | ||
<Dapp /> | ||
</Router> | ||
</Web3OnboardProvider> | ||
</Provider> | ||
</PostHogProvider> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { PostHogConfig } from "posthog-js" | ||
|
||
export const { POSTHOG_API_KEY } = process.env | ||
|
||
export const POSTHOG_API_OPTIONS: Partial<PostHogConfig> = { | ||
persistence: "localStorage", | ||
autocapture: false, | ||
capture_pageview: false, | ||
disable_session_recording: true, | ||
sanitize_properties(properties) { | ||
return { | ||
...properties, | ||
// The extension has set an expectation that the lib is set to | ||
// the analytics env. | ||
$lib: process.env.ANALYTICS_ENV, | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,17 @@ | ||
import React from "react" | ||
import ReactDOM from "react-dom/client" | ||
import { Web3OnboardProvider } from "@web3-onboard/react" | ||
import { Provider } from "react-redux" | ||
import web3Onboard from "shared/utils/web3Onboard" | ||
import { PostHogProvider } from "posthog-js/react" | ||
import { BrowserRouter as Router } from "react-router-dom" | ||
import DApp from "ui/DApps" | ||
import reduxStore from "./redux-state" | ||
|
||
function DAppProviders() { | ||
return ( | ||
<Provider store={reduxStore}> | ||
<Web3OnboardProvider web3Onboard={web3Onboard}> | ||
<PostHogProvider | ||
apiKey={process.env.POSTHOG_API_KEY} | ||
options={{ | ||
persistence: "localStorage", | ||
autocapture: false, | ||
capture_pageview: false, | ||
disable_session_recording: true, | ||
sanitize_properties(properties) { | ||
return { | ||
...properties, | ||
// The extension has set an expectation that the lib is set to | ||
// the analytics env. | ||
$lib: process.env.ANALYTICS_ENV, | ||
} | ||
}, | ||
}} | ||
> | ||
<Router> | ||
<DApp /> | ||
</Router> | ||
</PostHogProvider> | ||
</Web3OnboardProvider> | ||
</Provider> | ||
) | ||
} | ||
import { createRoot } from "react-dom/client" | ||
import App from "./App" | ||
|
||
const root = document.getElementById("root") | ||
|
||
if (root) { | ||
if (process.env.SKIP_REACT_STRICT_MODE === "true") { | ||
ReactDOM.createRoot(root).render(<DAppProviders />) | ||
} else { | ||
ReactDOM.createRoot(root).render( | ||
if (process.env.REACT_STRICT_MODE === "true") { | ||
createRoot(root).render( | ||
<React.StrictMode> | ||
<DAppProviders /> | ||
<App /> | ||
</React.StrictMode> | ||
) | ||
} else { | ||
createRoot(root).render(<App />) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.