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

WIP - Investigate large build size #76

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
echo Building ${GITHUB_REF}...

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '15.x'
node-version: '18.11'

- name: Cache Node Modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
Expand All @@ -32,7 +32,7 @@ jobs:
${{ runner.os }}-

- name: Cache Elm Stuff
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-elm-stuff
with:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"description": "The Compound Web3 Front-end",
"main": "index.js",
"scripts": {
"build": "node --unhandled-rejections=strict --max-old-space-size=8192 scripts/build.js",
"start": "node --unhandled-rejections=strict scripts/start.js dapp",
"build": "node --unhandled-rejections=strict --max-old-space-size=8192 --openssl-legacy-provider scripts/build.js",
"start": "node --unhandled-rejections=strict --openssl-legacy-provider scripts/start.js dapp",
"package": "elm-package",
"make": "elm-make",
"repl": "elm-repl",
"reactor": "elm-reactor",
"watch-css": "npx dart-sass --watch -I. -Inode_modules src/scss:src/css-build",
"build-css": "npx dart-sass -I. -Inode_modules src/scss:src/css-build",
"deploy-gcloud": "bash scripts/deploy-gcloud.sh",
"deploy-ipfs": "node --experimental-repl-await scripts/ipfs.js",
"deploy-ipfs": "node --experimental-repl-await --trace-warnings scripts/ipfs.js",
"i18n": "node --unhandled-rejections=strict config/tx-cli.js -a 'src/strings/always_english_strings.json' -p 'src/strings/strings.<lang>.json' -s en -l es zh fr ko -o src/elm/Strings/Translations.elm -m Strings.Translations -t",
"watch-i18n": "node --unhandled-rejections=strict config/tx-cli.js -a 'src/strings/always_english_strings.json' -p 'src/strings/strings.<lang>.json' -s en -l es zh fr ko -o src/elm/Strings/Translations.elm -m Strings.Translations -t -w",
"release": "node --unhandled-rejections=strict scripts/release.js",
Expand Down Expand Up @@ -65,7 +65,7 @@
"react-dev-utils": "^10.2.1",
"react-error-overlay": "^6.0.7",
"regenerator-runtime": "^0.13.5",
"solc": "^0.8.19",
"solc": "^0.8.21",
"string-replace-loader": "^2.1.1",
"style-loader": "^1.2.1",
"sw-precache-webpack-plugin": "^1.0.0",
Expand Down
34 changes: 3 additions & 31 deletions src/elm/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ type Msg
| Tick Time.Posix
| SetTimeZone Time.Zone
| VoteMsg Vote.InternalMsg
| CheckVersion Time.Posix
| CheckedVersion (Result Http.Error Float)
| RefreshGasPrice (Result Http.Error CompoundApi.GasService.Models.API_GasPriceResponse)


Expand Down Expand Up @@ -292,7 +290,6 @@ init { path, configurations, configAbiFiles, dataProviders, apiBaseUrlMap, userA
, Cmd.map WrappedPreferencesMsg initPreferencesCmd
, Cmd.map WrappedBNTransactionMsg initBNTransactionCmd
, Task.perform Tick Time.now
, Task.perform CheckVersion Time.now
, Task.perform SetTimeZone Time.here
]
)
Expand Down Expand Up @@ -326,7 +323,6 @@ newBlockCmd apiBaseUrlMap maybeNetwork blockNumber previousBlockNumber ({ dataPr

_ ->
[]

in
Cmd.batch <|
pageCmds
Expand Down Expand Up @@ -391,6 +387,7 @@ handleUpdatesFromEthConnectedWallet maybeConfig connectedEthWalletMsg model =
refreshBlockCmd =
if model.network /= Just newNetwork then
newBlockCmd model.apiBaseUrlMap (Just newNetwork) blockNumber Nothing model

else
Cmd.none
in
Expand Down Expand Up @@ -763,34 +760,9 @@ update msg ({ page, configs, apiBaseUrlMap, account, transactionState, bnTransac
, Cmd.map voteTranslator loadDelegateeCmd
)

CheckVersion time ->
let
versionUrl =
".__v.json"

versionDecoder =
Json.Decode.field "version" Json.Decode.float
in
( model, Http.send CheckedVersion (Http.get versionUrl versionDecoder) )

SetTimeZone timeZone ->
( { model | currentTimeZone = timeZone }, Cmd.none )

CheckedVersion (Ok latestVersion) ->
case model.appVersion of
Just currentVersion ->
if latestVersion /= currentVersion then
( model, Browser.Navigation.reload )

else
( model, Cmd.none )

Nothing ->
( { model | appVersion = Just latestVersion }, Cmd.none )

CheckedVersion (Err e) ->
( model, Cmd.none )

SetBlockNumber blockNumber ->
( { model | blockNumber = Just blockNumber }, newBlockCmd apiBaseUrlMap model.network blockNumber model.blockNumber model )

Expand Down Expand Up @@ -1117,10 +1089,11 @@ update msg ({ page, configs, apiBaseUrlMap, account, transactionState, bnTransac


view : Model -> Html Msg
view ({userLanguage} as model) =
view ({ userLanguage } as model) =
Html.div [ id "main" ]
(viewFull model)


viewFull : Model -> List (Html Msg)
viewFull ({ page, liquidateModel, transactionState, compoundState, tokenState, oracleState, configs, configAbis, network, preferences, account, blockNumber, userLanguage } as model) =
let
Expand Down Expand Up @@ -1417,7 +1390,6 @@ subscriptions model =
, Sub.map voteTranslator (Vote.subscriptions model.voteModel)
, Sub.map WrappedGovernanceMsg Eth.Governance.subscriptions
, Time.every (1000.0 * 1.0 * toFloat CompoundComponents.Utils.Time.seconds) Tick
, Time.every (1000.0 * 4.0 * toFloat CompoundComponents.Utils.Time.hours) CheckVersion
, onUrlChange (Url.fromString >> UrlChange)
]

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10860,10 +10860,10 @@ sockjs@^0.3.21:
uuid "^3.4.0"
websocket-driver "^0.7.4"

solc@^0.8.17, solc@^0.8.19:
version "0.8.19"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.19.tgz#cac6541106ae3cff101c740042c7742aa56a2ed3"
integrity sha512-yqurS3wzC4LdEvmMobODXqprV4MYJcVtinuxgrp61ac8K2zz40vXA0eSAskSHPgv8dQo7Nux39i3QBsHx4pqyA==
solc@^0.8.17, solc@^0.8.21:
version "0.8.21"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.21.tgz#c3cd505c360ea2fa0eaa5ab574ef96bffb1a2766"
integrity sha512-N55ogy2dkTRwiONbj4e6wMZqUNaLZkiRcjGyeafjLYzo/tf/IvhHY5P5wpe+H3Fubh9idu071i8eOGO31s1ylg==
dependencies:
command-exists "^1.2.8"
commander "^8.1.0"
Expand Down