-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
163 lines (144 loc) · 4.95 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WTH Stack</title>
<style>
body {
background-color: #222;
color: #eee;
font-family: Iosevka, monospace;
line-height: 1.4;
font-size: 1.1em;
width: 100%;
display: flex;
justify-content: center;
margin: 0;
}
.container {
max-width: 800px;
margin: 1em;
}
a,
a:hover,
a:visited,
a:active {
color: #84B4FF;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
header {
padding-bottom: 1em;
margin-bottom: 2em;
text-align: center;
border-bottom: 1px solid #444;
}
header h1 {
margin-bottom: 0;
}
header h3 {
margin-top: 0;
color: #AAA;
}
footer {
color: #777;
border-top: 1px solid #444;
text-align: center;
margin: 2em 0;
padding-top: 2em;
}
</style>
<script defer data-domain="wthstack.com" src="https://plausible.io/js/script.js"></script>
<script data-goatcounter="https://wthstack.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
</head>
<body>
<div class="container">
<header>
<h1>WTH Stack</h1>
<h3>Server-Side Render Your Desktop Apps</h3>
</header>
<main>
<p>
Introducing a new desktop application stack for web developers who love HTML and CSS, but hate
JavaScript! The WTH stack allows you to write a fully-featured desktop application using Go.
With the WTH stack, you can bring your
<a href="https://htmx.org/essays/hypermedia-driven-applications/">hypermedia-driven applications</a>
to the desktop. The WTH stack embraces the concept of
<a href="https://htmx.org/essays/hateoas/">HATEOAS</a>
and server-side-rendered UIs.
</p>
<h2>The WTH Stack</h2>
<p>
There are three components to the WTH Stack:
</p>
<ul>
<li>
<b>
<a href="https://wails.io/" target="_blank">Wails</a> —
a Go library for building cross-platform applications.
</b>
This acts as the web renderer host and includes a built-in HTTP server which is used to serve
the application's UI.
</li>
<li>
<b>
<a href="https://templ.guide" target="_blank">Templ</a> —
a templating language based on Go for HTML and CSS.
</b>
This powerful Go-based templating engine allows you to write server-generated HTML and CSS.
</li>
<li>
<b>
<a href="https://htmx.org/" target="_blank">HTMX</a> —
a small JavaScript library for declaratively adding interactivity to HTML elements.
</b>
This library extends HTML to be a complete hypertext. It allows you to declaratively annotate
your HTML elements with attributes to trigger HTTP requests and update the DOM with the HTML
from the response.
</li>
</ul>
<h2>What the Hell is This?</h2>
<p>
Currently, the best option for building HTML/CSS-based desktop applications is Electron with
React, but that requires that you write JavaScript. Using JavaScript to render HTML client-side
is slow, and thus the industry has been moving towards server-side rendering (SSR).
Unfortunately, this move has left desktop applications behind because there's no server to
handle rendering.
</p>
<p>
The WTH stack solves this problem by handling the HTTP requests made by your application using
Wails. Wails allows you to provide a standard Go backend which your application UI can interact
with as if it were over HTTP.
</p>
<p>
One major advantage of the WTH stack is that it allows backend-focused developers to build
desktop applications using tools and techniques they are already familiar with. It also
centralizes the application's state, logic, and rendering in a single place (the backend) which
makes the frontend a true <i>view</i> layer (in the
<a href="https://en.wikipedia.org/wiki/Model-view-controller" target="_blank">MVC</a>
sense).
</p>
<h2>Isn't This Kinda Cursed?</h2>
<p>
Yes.
</p>
<h2>How Do I Get Started?</h2>
<p>
There is a Wails template for this stack already:
<a href="https://github.com/PylotLight/wails-htmx-templ-template">
PylotLight/wails-htmx-templ-template</a>, however you may find that it has a lot of
complexity (Tailwind, Chi, etc.) that you don't need. It's very easy to rip that stuff out.
</p>
</main>
<footer>
<small>
© 2024
<a href="https://nevarro.space">Nevarro LLC</a>. All rights reserved.
<a href="https://github.com/nevarro-space/wthstack.com/">Source code</a>.
</small>
</footer>
</div>
</body>
</html>