Skip to content

Commit

Permalink
Remove lustre_http and improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ghivert committed Dec 1, 2024
1 parent 10a63c8 commit 9fe39bd
Show file tree
Hide file tree
Showing 12 changed files with 336 additions and 230 deletions.
2 changes: 1 addition & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"backend:db:reset": "yarn backend:db:drop && yarn backend:db:init"
},
"dependencies": {
"@chouqueth/gleam": "^1.3.2"
"@chouqueth/gleam": "^1.6.2"
}
}
5 changes: 3 additions & 2 deletions apps/frontend/gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ typescript_declarations = true
[dependencies]
birl = ">= 1.7.1 and < 2.0.0"
bright = ">= 0.1.0 and < 1.0.0"
gleam_javascript = "~> 0.8"
gleam_javascript = ">= 0.13.0 and < 1.0.0"
gleam_json = ">= 1.0.1 and < 2.0.0"
gleam_regexp = ">= 1.0.0 and < 2.0.0"
gleam_stdlib = "~> 0.34 or ~> 1.0"
lustre = ">= 4.6.1 and < 5.0.0"
lustre_http = "~> 0.5"
modem = ">= 2.0.0 and < 3.0.0"
sketch = ">= 3.0.0 and < 4.0.0"
sketch_magic = {path = "../../packages/sketch_magic"}
vitools = {path = "../../packages/vitools"}
grille_pain = ">= 1.1.0 and < 2.0.0"
gleam_fetch = ">= 0.4.0 and < 1.0.0"
gleam_http = ">= 3.7.1 and < 4.0.0"

[dev-dependencies]
gleeunit = "~> 1.0"
8 changes: 4 additions & 4 deletions apps/frontend/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ packages = [
{ name = "logging", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "logging", source = "hex", outer_checksum = "1098FBF10B54B44C2C7FDF0B01C1253CAFACDACABEFB4B0D027803246753E06D" },
{ name = "lustre", version = "4.6.3", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_json", "gleam_otp", "gleam_stdlib"], otp_app = "lustre", source = "hex", outer_checksum = "BDF833368F6C8F152F948D5B6A79866E9881CB80CB66C0685B3327E7DCBFB12F" },
{ name = "lustre_dev_tools", version = "1.6.2", build_tools = ["gleam"], requirements = ["argv", "filepath", "fs", "gleam_community_ansi", "gleam_crypto", "gleam_erlang", "gleam_http", "gleam_httpc", "gleam_json", "gleam_otp", "gleam_package_interface", "gleam_regexp", "gleam_stdlib", "glint", "glisten", "lustre", "mist", "simplifile", "spinner", "term_size", "tom", "wisp"], otp_app = "lustre_dev_tools", source = "hex", outer_checksum = "A0CBC323AA7E03EC91D785CEB644776082D76BE46F1624FB920BB92BD79853F7" },
{ name = "lustre_http", version = "0.5.2", build_tools = ["gleam"], requirements = ["gleam_fetch", "gleam_http", "gleam_javascript", "gleam_json", "gleam_stdlib", "lustre"], otp_app = "lustre_http", source = "hex", outer_checksum = "FB0478CBFA6B16DBE8ECA326DAE2EC15645E04900595EF2C4F039ABFA0512ABA" },
{ name = "marceau", version = "1.3.0", build_tools = ["gleam"], requirements = [], otp_app = "marceau", source = "hex", outer_checksum = "2D1C27504BEF45005F5DFB18591F8610FB4BFA91744878210BDC464412EC44E9" },
{ name = "mist", version = "3.0.0", build_tools = ["gleam"], requirements = ["birl", "gleam_erlang", "gleam_http", "gleam_otp", "gleam_stdlib", "glisten", "gramps", "hpack_erl", "logging"], otp_app = "mist", source = "hex", outer_checksum = "CDA1A74E768419235E16886463EC4722EFF4AB3F8D820A76EAD45D7C167D7282" },
{ name = "modem", version = "2.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib", "lustre"], otp_app = "modem", source = "hex", outer_checksum = "B446119A85DC9C31FEA0DCB204072E40356CB246C9D091CBBF2E4678CDB05A2D" },
Expand All @@ -45,7 +44,7 @@ packages = [
{ name = "simplifile", version = "2.2.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0DFABEF7DC7A9E2FF4BB27B108034E60C81BEBFCB7AB816B9E7E18ED4503ACD8" },
{ name = "sketch", version = "3.1.2", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_otp", "gleam_stdlib"], otp_app = "sketch", source = "hex", outer_checksum = "85E41BC0BE2E5D8985EF34F0D2FD7315329A463FC845570EC5D399F20F8AFA08" },
{ name = "sketch_lustre", version = "1.0.3", build_tools = ["gleam"], requirements = ["gleam_stdlib", "lustre", "plinth", "sketch"], otp_app = "sketch_lustre", source = "hex", outer_checksum = "DD5437B10D4BB8AB45A19820B17883188B8568B6ED7885D7D073A983F4984E79" },
{ name = "sketch_magic", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "lustre", "plinth", "sketch"], source = "local", path = "../../packages/sketch_magic" },
{ name = "sketch_magic", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "lustre", "sketch"], source = "local", path = "../../packages/sketch_magic" },
{ name = "snag", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "snag", source = "hex", outer_checksum = "08E9EB87C413457DB1DD66CD704C6878DACC9C93B418600F63873D0CD224E756" },
{ name = "spinner", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_community_ansi", "gleam_stdlib", "glearray", "repeatedly"], otp_app = "spinner", source = "hex", outer_checksum = "9EE43AA33BE2DA5731B8F3F170AAB59AF1A815AFA5BF615F12C1B91F3B03F157" },
{ name = "telemetry", version = "1.3.0", build_tools = ["rebar3"], requirements = [], otp_app = "telemetry", source = "hex", outer_checksum = "7015FC8919DBE63764F4B4B87A95B7C0996BD539E0D499BE6EC9D7F3875B79E6" },
Expand All @@ -59,14 +58,15 @@ packages = [
[requirements]
birl = { version = ">= 1.7.1 and < 2.0.0" }
bright = { version = ">= 0.1.0 and < 1.0.0" }
gleam_javascript = { version = "~> 0.8" }
gleam_fetch = { version = ">= 0.4.0 and < 1.0.0" }
gleam_http = { version = ">= 3.7.1 and < 4.0.0" }
gleam_javascript = { version = ">= 0.13.0 and < 1.0.0" }
gleam_json = { version = ">= 1.0.1 and < 2.0.0" }
gleam_regexp = { version = ">= 1.0.0 and < 2.0.0" }
gleam_stdlib = { version = "~> 0.34 or ~> 1.0" }
gleeunit = { version = "~> 1.0" }
grille_pain = { version = ">= 1.1.0 and < 2.0.0" }
lustre = { version = ">= 4.6.1 and < 5.0.0" }
lustre_http = { version = "~> 0.5" }
modem = { version = ">= 2.0.0 and < 3.0.0" }
sketch = { version = ">= 3.0.0 and < 4.0.0" }
sketch_magic = { path = "../../packages/sketch_magic" }
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"frontend:preview": "vite preview"
},
"dependencies": {
"@chouqueth/gleam": "^1.4.1",
"@gleam-lang/highlight.js-gleam": "^1.5.0",
"@sentry/browser": "^8.0.0",
"chart.js": "^4.4.4",
Expand All @@ -19,6 +18,7 @@
"marked-highlight": "^2.1.1"
},
"devDependencies": {
"@chouqueth/gleam": "^1.6.2",
"@sentry/vite-plugin": "^2.16.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"prettier": "^3.2.5",
Expand Down
22 changes: 10 additions & 12 deletions apps/frontend/src/data/msg.gleam
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import birl
import data/package
import data/search_result.{type SearchResults}
import frontend/discuss
import frontend/router
import gleam/dynamic.{type Dynamic}
import gleam/option
import lustre_http as http

pub type Filter {
Functions
Expand Down Expand Up @@ -37,19 +37,17 @@ pub type Analytics {
}

pub type Msg {
ApiReturnedAnalytics(Result(Analytics, http.HttpError))
ApiReturnedPackages(packages: Result(List(package.Package), http.HttpError))
ApiReturnedSearchResults(
input: String,
result: Result(SearchResults, http.HttpError),
)
ApiReturnedTrendings(result: Result(List(package.Package), http.HttpError))
BrowserChangedRoute(router.Route)
ApiReturnedAnalytics(analytics: Analytics)
ApiReturnedPackages(packages: List(package.Package))
ApiReturnedSearchResults(input: String, search_results: SearchResults)
ApiReturnedTrendings(trendings: List(package.Package))
AppRequiredDiscussToast(message: discuss.DiscussError)
BrowserChangedRoute(route: router.Route)
BrowserResizedViewport(is_mobile: Bool)
UserClickedSidebarName(String)
UserClickedSidebarName(id: String)
UserFocusedSearch(event: Dynamic)
UserInputtedSearch(String)
UserInputtedSearch(query: String)
UserPressedEscape
UserSubmittedSearch
UserToggledFilter(Filter, Bool)
UserToggledFilter(filter: Filter, value: Bool)
}
Loading

0 comments on commit 9fe39bd

Please sign in to comment.