The short version
-
go-app is now WebGo's own
apppackage. Change one import and your code keeps working. -
Elements take your style rules directly:
app.Div().Style(theme.Card). -
serve.Handleris gone.app.Handlerdoes the job and builds your stylesheets by itself. - New builds reach open tabs on their own.
- A batch of fixes, one of them for security. Please update.
Hey everyone,
For its first month, WebGo was a layer on top of go-app. That got us a long way, but every time we wanted to change how the engine itself behaved, we hit the same wall: the engine wasn't ours to change. Update 0.1.0 takes that wall down. go-app's core now lives inside WebGo as the
app
package, with its MIT notice right where it belongs, and this whole update was about making the two feel like one thing.
Here's what that means for you.
One import
Everything comes from one module now. Components, routing, state and actions keep their names and their behaviour. Only the address changes.
import
"github.com/Toms223/WebGo/app"
Coming from go-app, or from 0.0.5? The migration guide walks through every change, and most apps are done in a few minutes.
Styles go straight onto your elements
This is the one we've wanted since typed CSS showed up in 0.0.5. You used to copy a class name out of a rule and hand that string to an element. Now you hand over the rule itself.
app
.
Div
(
)
.
Style
(
theme
.
Card
,
theme
.
Compact
)
The compiler also knows which elements can be styled at all. Put a style rule on a
<meta>
tag and the build stops right there, instead of you wondering later why nothing happened. When you really do need inline CSS,
RawStyle
is still around.
go-app now lives inside WebGo. One import, one handler, styles that go straight onto your elements, and updates that land on their own.
One handler
serve.Handler
used to wrap go-app's handler just to add stylesheets. Now there's only
app.Handler
, and it takes your styles directly. It builds them the first time it needs them, so forgetting
Build()
no longer ships a page without its CSS. We still recommend calling it at startup: it's the quickest way to catch a missing file before your users do.
handler
:=
&
app
.
Handler
{
Name
:
"My app"
,
Styles
:
theme
.
Styles
(
)
,
}
http
.
Handle
(
"/"
,
handler
)
Updates that actually arrive
If you've ever shipped a fix, opened a tab you'd left open, and found yesterday's build staring back at you, this one's for you. The app now looks for a new version when the page opens, when you come back online, when you switch back to its tab, and once a minute while it's open. When the new version is ready, the page reloads once and you're on it.
Got a form where a surprise reload would hurt? Set
DisableAutoUpdate
and you decide when to switch.
Versions and updates
has the details.
Fixes we picked up on the way
Moving the engine in meant reading every line of it, and we found a few things worth fixing while we were there.
- Attribute values in server-rendered pages are escaped properly now. Before, a value with a quote in it could break out of its attribute. If you put user text into attributes, update today.
-
Setting
app.NotFoundfinally works, on the server and in the browser, with a real 404. - Apps served under a sub-path, like a GitHub Pages project site, serve their files correctly from a live server too.
- Your own icon is your favicon. No more surprise go-app logo.
- Showing the install prompt no longer throws an error on Safari.
- Static sites now include library stylesheets.
- Server output is identical from run to run, so snapshot tests stop flaking.
The docs grew up
There's a whole new Core section: components, routing, state and actions, concurrency, deployment, testing and migrating. A lot of it started from go-app's own documentation, rewritten in our voice and checked line by line against the code. Where a picture says it better than a paragraph, there's a diagram now. Components is a good place to start.
A word on the license
WebGo is now released under the GPL-3.0. In short: if you build on WebGo and ship it, your project stays open source too. The go-app code inside keeps its MIT license, and the NOTICE file credits it.
Get it
go get github.com/Toms223/WebGo@v0.1.0
That's it for this one. Grab it, break it, tell us what broke. See you next update.
End of issue 0.1.0
03