Skip to content

Commit b173a31

Browse files
committed
add deployment
1 parent fc92dcc commit b173a31

File tree

6 files changed

+73
-106
lines changed

6 files changed

+73
-106
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
BLOG_SRC := content/*.md style.css main.go
1+
BLOG_SRC := articles/*.md style.css main.go
22
OUTPUT_DIR := public
3+
DEPLOY_DIR := kadse@jedicke.uberspace.de:web/nobloat.org
34

45
.PHONY: build deploy dev
56

67
build: $(BLOG_SRC)
78
mkdir -p $(OUTPUT_DIR)
8-
go run main.go
9+
go run ./...
910

1011
deploy: build
11-
#rsync -av --delete $(OUTPUT_DIR)/ $(DEPLOY_DIR)/
12+
rsync -av --delete $(OUTPUT_DIR)/ $(DEPLOY_DIR)/
13+
14+
test:
15+
1216

1317
dev:
14-
go run main.go -watch
18+
go run ./... -watch
1519

1620
clean:
1721
rm -rf $(OUTPUT_DIR)

article.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
<meta name="description" content="{{.Title}}" />
66
<title>][ {{.Title}}</title>
77
<link rel="stylesheet" href="../style.css" />
8+
<script
9+
defer
10+
data-domain="nobloat.org"
11+
src="https://plausible.io/js/script.outbound-links.tagged-events.js"
12+
></script>
813
</head>
914
<body>
1015
<nav>
11-
<a href="./index.html">][ nobloat.org</a>
16+
<a href="../index.html">][ nobloat.org</a>
1217
<p>{{.Slogan}}</p>
1318
</nav>
1419
<article>{{.Content}}</article>

articles/2025-07-01-hello-blog.md

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,3 @@
1-
# Ditching GoMobile: Building Our Own Native Bridge
1+
# Hello Blog (coming soon)
22

3-
For the longest time, we used `gomobile` to bridge our Go-based core with Android and iOS. It seemed like the perfect solution—generate bindings, avoid boilerplate, and focus on logic. But as **our product matured**, `gomobile` started showing its cracks.
4-
5-
## Why We Used GoMobile in the First Place
6-
7-
- Automatic generation of Java and Objective-C bindings
8-
- Easy method export from Go
9-
- Quick prototype integration for cross-platform logic
10-
11-
But then reality hit.
12-
13-
## The Problems
14-
15-
- **Missing modern language support:** No Kotlin coroutines, no Swift async/await
16-
- **Limited threading model:** Everything ran on a single locked thread
17-
- **Opaque crashes:** Stack traces from `gomobile` were cryptic and unhelpful
18-
- **No support for streaming, async calls, or cancellation**
19-
- **Hard to debug JNI/ObjC glue code**
20-
21-
Worst of all: **gomobile was abandoned**. No meaningful updates in years, yet we were depending on it.
22-
23-
24-
25-
## What We Built Instead
26-
27-
We now use a **custom native bridge**, powered by:
28-
29-
![some test](https://picsum.photos/800)
30-
31-
-**Protobuf for typed request/response definitions**
32-
- 🧵 **Cancellable async calls** (Kotlin coroutines, Swift async/await)
33-
- 🔄 **Bidirectional communication** (platform ↔ core)
34-
- 🧩 **Manually managed JNI and Objective-C glue code**
35-
- 🔍 **Full control over threading and memory**
36-
37-
The bridge consists of:
38-
39-
1. A **Go core** that registers all callable methods
40-
2. A **native dispatcher** on each platform that routes Protobuf messages
41-
3. Typed messages and responses, fully testable
42-
4. Direct hooks into Go’s panic handler (with stacktrace propagation)
43-
44-
## The Benefits
45-
46-
- 🔥 No more silent crashes
47-
- 📱 Proper threading and cancellation
48-
- 📦 Much smaller binary size
49-
- 🛠 Full debugging capabilities
50-
- 🚀 Faster startup and method invocation
51-
52-
## Example: Calling from Kotlin
53-
54-
```kotlin
55-
val request = GetMediaRequest.newBuilder().build()
56-
val response = nativeBridge.callGo(METHOD_GET_MEDIA, request.toByteArray())
57-
```
3+
Coming soon!

index.html

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,56 @@
1212
/>
1313
<title>{{.Title}}</title>
1414
<link rel="stylesheet" href="style.css" />
15+
<script
16+
defer
17+
data-domain="nobloat.org"
18+
src="https://plausible.io/js/script.outbound-links.tagged-events.js"
19+
></script>
1520
</head>
1621
<body>
1722
<h1><a href="./index.html">{{.Title}}</a></h1>
1823
<p style="font-family: monospace; text-align: center">{{.Slogan}}</p>
19-
<h2 id="articles">Articles</h2>
20-
<ul>
21-
{{range .Posts}}
22-
<li>
23-
<small>{{ .Date.Format "Jan 2 2006" }}</small>
24-
<a href="articles/{{.Slug}}.html">{{.Title}}</a>
25-
</li>
26-
{{end}}
27-
</ul>
28-
<h2 id="projects">Projects</h2>
29-
<ul>
30-
{{range $name, $desc := .Projects}}
31-
<li>
32-
{{ md2html $name | safeHTML }} {{ md2html $desc | safeHTML }}
33-
</li>
34-
{{end}}
35-
</ul>
36-
<h2 id="links">Links</h2>
37-
<ul>
38-
{{range $name, $url := .Links}}
39-
<li><a href="{{$url}}">{{$name}}</a></li>
40-
{{end}}
41-
</ul>
24+
<section>
25+
<h2 id="articles">Articles</h2>
26+
<ul>
27+
{{range .Posts}}
28+
<li>
29+
<small>{{ .Date.Format "Jan 2 2006" }}</small>
30+
<a href="articles/{{.Slug}}.html">{{.Title}}</a>
31+
</li>
32+
{{end}}
33+
</ul>
34+
</section>
35+
<section>
36+
<h2 id="projects">Projects</h2>
37+
<ul>
38+
{{range $name, $desc := .Projects}}
39+
<li>
40+
{{ md2html $name | safeHTML }} {{ md2html $desc | safeHTML
41+
}}
42+
</li>
43+
{{end}}
44+
</ul>
45+
</section>
46+
<section>
47+
<h2 id="tools">Tools</h2>
48+
<ul>
49+
{{range $tool := .Tools}}
50+
<li>
51+
<a href="{{$tool.URL}}">{{$tool.Name}}</a>
52+
{{$tool.Description}}
53+
</li>
54+
{{end}}
55+
</ul>
56+
</section>
57+
<section>
58+
<h2 id="links">Links</h2>
59+
<ul>
60+
{{range $name, $url := .Links}}
61+
<li><a href="{{$url}}">{{$name}}</a></li>
62+
{{end}}
63+
</ul>
64+
</section>
4265
<footer>
4366
<a href="./feed.xml">RSS Feed</a> |
4467
<a href="https://github.com/nobloat">GitHub</a>

main.go

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,19 @@ type Post struct {
2626
Content template.HTML
2727
}
2828

29+
type Tool struct {
30+
Name string
31+
Description string
32+
URL string
33+
}
34+
2935
type Config struct {
3036
Title string
3137
Slogan string
3238
BaseURL string
3339
Links map[string]string
3440
Projects map[string]string
35-
}
36-
37-
var config = Config{
38-
Title: "][ nobloat.org",
39-
Slogan: "pragmatic software minimalism",
40-
BaseURL: "https://nobloat.org",
41-
Links: map[string]string{
42-
"GitHub": "https://github.com/nobloat",
43-
"nobloat.org": "https://nobloat.org",
44-
"zeitkapsl.eu": "https://zeitkapsl.eu",
45-
"hardcode.at": "https://hardcode.at",
46-
"spiessknafl.at/peter": "https://spiessknafl.at/peter",
47-
},
48-
Projects: map[string]string{
49-
"[nobloat/css](https://github.com/nobloat/css)": "modular vanilla CSS3 components",
50-
"[nobloat/bare-jvm](https://github.com/nobloat/bare-jvm)": "[baremessages](https://baremessages.org/) implementation for the JVM",
51-
"[cinemast/dbolve](https://github.com/cinemast/dbolve)": "very minimalistic database migration tool for golang projects",
52-
"[nobloat/tinyviper](https://github.com/nobloat/tinyviper)": "very minimalistic alternative to the famous [spf13/viper](https://github.com/spf13/viper) configuration library",
53-
},
41+
Tools []Tool
5442
}
5543

5644
func sanitizeAnchor(input string) string {
@@ -280,7 +268,7 @@ func generateIndex(posts []Post) {
280268
}
281269
tmpl := template.Must(template.New("index").Funcs(funcMap).Parse(string(tpl)))
282270
var buf bytes.Buffer
283-
tmpl.Execute(&buf, map[string]any{"Title": config.Title, "Posts": posts, "Links": config.Links, "Projects": config.Projects, "Slogan": config.Slogan})
271+
tmpl.Execute(&buf, map[string]any{"Title": config.Title, "Posts": posts, "Tools": config.Tools, "Links": config.Links, "Projects": config.Projects, "Slogan": config.Slogan})
284272
_ = writeIfChanged("public/index.html", buf.Bytes())
285273
}
286274

style.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ body {
4949
@media (min-width: 1920px) {
5050
body {
5151
font-size: 1.2rem;
52-
padding: 2rem 20rem;
52+
padding: 2rem 30rem;
5353
line-height: 1.5;
5454
}
5555
}
@@ -163,8 +163,9 @@ figure img {
163163
height: auto;
164164
margin: 0 auto;
165165
border: 2px solid light-dark(var(--c-lo-light), var(--c-lo-dark));
166-
box-shadow: 2px light-dark(var(--c-lo-light), var(--c-lo-dark));
166+
box-shadow: 5px light-dark(var(--c-lo-light), var(--c-lo-dark));
167167
border-radius: var(--radius);
168+
/*filter: grayscale(1);*/
168169
}
169170

170171
figcaption {

0 commit comments

Comments
 (0)