v0.15.3 #395
bitspittle
announced in
Announcements
v0.15.3
#395
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This release brings some extra functionality to Kobweb's export feature.
Planning to upgrade? Review instructions in the README.
Export
export
block has moved fromkobweb.export
tokobweb.app.export
, a long overdue migration.kobweb.app.export.filter
to filter some routes out of being exported, which can save a lot of time in case you have some routes that don't need to be cached for SEO purposes.kobweb.app.export.enableTraces
to collect snapshots of your pages' progress which you can use to visualize what was happening when they were being visited at export time.kobweb.app.export.timeout
property, for exampletimeout.set(1.minute)
.Backend
ApiContext
andInitApiContext
classes now expose a property which tells you if your server is running in dev or prod mode; for example,ctx.env.isDev
.Frontend
size(width, height)
,minSize(width, height)
, andmaxSize(width, height)
modifiers.CSS*NumericValue
types for all relevant CSS units.CSSLengthValue
,CSSPercentageValue
, etc.. Kobweb now provides numeric versions, e.g.CSSLengthNumericValue
,CSSPercentageNumericValue
, etc.Notes
The
export
block has movedThe export feature is about as old as features in this framework get. As a result, it's no surprise that the
export
block location is outdated!The new location lives under the
app
block (since only application modules should be influencing it):It's trivial to move, but Gradle / IntelliJ unfortunately doesn't surface deprecation warnings directly (i.e. it would have been nice if the
export
name was crossed out in the IDE if in the old location), so instead you will get a warning at export time.Filtering routes
Here's a quick example where we filter out exporting all admin pages from our site, since those will always require auth anyway and shouldn't be cached for SEO purposes. The
filter
scope includes aroute
property you can use to test the current route being exported:Enabling export traces
Let's say you have a page on your site that is taking 10 seconds to export, when all your other pages only take 1. What is happening?
Thanks to a feature provided by Playwright (the framework by Microsoft we use for taking browser snapshots), enabling traces is easy:
// site/build.gradle.kts kobweb { app { export { enableTraces() } } }
You can look at the docs for
enableTraces
to see how to configure it, but by default, when traces are enabled, Kobweb will droptrace.zip
files under your.kobweb/export-traces
folder, one per page exported.You can then drag and drop those files into the page at https://playwright.dev/docs/trace-viewer to investigate its details.
Between trace snapshots and server logs, you should be able to diagnose what's going on.
Full Changelog: v0.15.2...v0.15.3
This discussion was created from the release v0.15.3.
Beta Was this translation helpful? Give feedback.
All reactions