Releases: varabyte/kobweb
v0.10.5
Just a minor release, with some simple bugs I fixed while most of my attention is on a much larger Gradle plugin refactoring that will be landing soon (TM).
Frontend
- Added
Modifier.borderStyle
modifier. Modifier.content
will now auto-surround your string with quotes if they are missing.- So if you forget to write
Modifier.content("\" • \"")
Kobweb has your back my friend.
- So if you forget to write
- The Kobweb
Color
class now inherits from theCSSColorValue
interface.- This means it now plays nice with all existing CfW color APIs, no
toCssColor
necessary. - Removed all modifiers that took
Color
as an argument; instead, users should use theCSSColorValue
ones.
- This means it now plays nice with all existing CfW color APIs, no
- Added Silk-aware
main.kt
code generation for apps using Silk that don't use the@App
annotation.
v0.10.4
No code changes, but Kobweb is now built against Compose 1.2.1 / Kotlin 1.7.20.
v0.10.3
Misc. fixes, which I'm snapshotting into a release so that I can follow up shortly with another release that depends on Compose v1.2.1, which was just released recently.
Frontend
- Refactor alignment modifiers
- Introduce Kobweb's version of
AlignItems
,JustifyItems
, etc. classes, since the Compose for Web versions don't handle baseline and overflow settings. - Add missing modifier for
placeItems
- Introduce Kobweb's version of
- Rename
kobweb.core.navigation.Link
tokobweb.core.navigation.Anchor
, to avoid confusion caused with Silk's ownkobweb.silk.navigation.Link
widget.- Technically, an
Anchor
is a more robustA
tag, while aLink
is a specific anchor that renders the underlined link text we all know and love when using the web. - In most cases, users will want to use
Link
and notAnchor
.
- Technically, an
- (Possible backwards incompatibility) Refactor the
elementScope
parameter in all Silk widgets, changing them into a version that takes aref
listener (with a callback that receives anElementRefScope
)- This makes it safer to get access to the underlying raw element for a widget without exposing an unnecessary composable block.
- Before, to get a raw element that backs a widget:
After:
Widget(elementScope = { DisposableSideEffect { // use scopeElement here onDispose {} })
Widget(ref = ref { element -> ... }) // or, if you need dispose handling: // Widget(ref = disposableRef { element -> ...; onDispose { ... }})
v0.10.2
I'm planning to experiment with migrating the Kobweb Gradle plugin over to KSP shortly, so right before getting lost in that seems like a good time to slice off a release.
Frontend
- Fixed a bug with the various transition modifiers not working when specifying multiple parameters
- For example,
Modifier.transitionProperty("color", "font-size").transitionDuration(100.ms, 300.ms)
would silently break before.
- For example,
- Add a slew of transform modifiers
- For example,
Modifier.rotate
,Modifier.scale
, etc., with various input parameter configurations.
- For example,
- Add
boxSizing
andboxDecorationBreak
box modifiers.- Potential backwards incompatible change The old
Modifier.boxSizing(String)
API has been removed.- Instead, use the one that takes in multiple arguments instead.
- You can also use
styleModifier { boxSizing(String) }
in a pinch.
- Potential backwards incompatible change The old
Markdown
- There are no longer any unsupported markdown features. Everything should work now. Specifically...
<html>
blocks now generate the correct Compose code for creating simple elements.>
can now be used to create block quotes (although sites must still define their own blockquote style using css rules; the default is very bland).- Link referencing (read more about what this is here) now works.
v0.10.1
This release is essentially the same as v0.10.0, except that, when you run an export, it now produces final output that has dead code elimination applied to it. You may expect to see anywhere from a 50-75% reduction in your final site's javascript file.
Note that if you have an existing project, you must do the following steps to take advantage of this:
- Open your
.kobweb/conf.yaml
file - Under the
prod:
section, add ascript:
field set to"build/distributions/(yourproject.js)"
For example, if your project was called example
, then your final conf file might look like:
# example/.kobweb/conf.yaml
site:
title: "Example Project"
server:
files:
dev:
contentRoot: "build/processedResources/js/main/public"
script: "build/js/packages/helloworld/kotlin/example.js"
prod:
script: "build/distributions/example.js" # <--- This line is new!
siteRoot: ".kobweb/site"
port: 8080
If you create a new project, e.g. kobweb create site
, then this will already be done for you.
v0.10.0
🎉 Update Kobweb to compile against Compose for Web 1.2.0 🎉
Feature-wise, this release is identical to 0.9.15. However, it now depends on the latest stable Compose version. This also means you must use Kotlin 1.7.10 to build projects using this version of Kobweb.
v0.9.15
Frontend
- Fixed
ComponentVariant
always causing methods to recompose when passed in as an argument to one - Added a handful of missing
Modifier.background
methods, e.g.Modifier.backgroundImage
Markdown
- Fix issues with nested Markdown files not exporting correctly on Windows
- Fix issue with dollar signs in Markdown generating Kotlin code that didn't compile
v0.9.14
Frontend
- Fixed unnecessary recompositions by adding
equals
andhashcode
logic to KobwebModifier
implementations - Added an additional, more idiomatic Kotlin API for
Modifier.boxShadow
Silk
- Re-added
Text
andTextStyle
back in but with@Deprecation
annotations, after previously deleting them in 0.9.13. This means if projects upgrade from v0.9.12 (or earlier) to v0.9.14 (or later), they'll get helpful warnings instead of hard errors.- All Kobweb
Text
references should be renamed toSpanText
. This was done in v0.9.13 becauseText
kept running against the very commonText
function in the Compose Web API.
- All Kobweb
Markdown
- Fixed a bug with the Markdown plugin on Windows (caused by platform dependent slash logic), where before it didn't generate export paths correctly for nested markdown files.
- e.g.
src\jsMain\resources\markdown\a\b\c\test.md
will now export toa\b\c\test.html
, nottest.html
- Linux and Mac were fine.
- e.g.
v0.9.13
Frontend
- Backwards Incompatible Migrated Kobweb's
Text
toSpanText
- Previously, Kobweb's
Text
tried to be smart and only wrapped its text in a span if aModifier
was passed in, but this was really subtle, and probably surprising, behavior. By renaming it, we now avoid a common import overlap between Kotlin'sText
and Kobweb's version. Additionally, the name makes it clearer that this is text wrapped in a<span>
block, and that that implementation will be consistent. - If you get a compile error around
Text
in your Kobweb project, you should be able to rename it toSpanText
.
- Previously, Kobweb's
- Updated Font Awesome support from v5 to v6
- Potentially backwards incompatible Some font awesome icon names have changed as part of the migration. Please use their icon search to figure out the new names.
- Added support for clamp, min, and max CSS functions whose output can be passed into relevant
Modifier
methods.- Thanks to @Ayfri and @conradboehnke for their support on this feature!
- The site's title is now automatically added to your app globals
- So you can access it using
AppGlobals["title"]
in your code, instead of hard-coding it, in case things change down the line.
- So you can access it using
- Fixed
Modifier.role(...)
, which is now correctly implemented as an HTML attribute and not a style. - Fixed various copy/paste issues with CSS class instances (see commit cec1f7b for the changes)
v0.9.12
This patch isn't large, but it brings in a few fixes as I return back to Kobweb after a break, having been sidelined by a different project for a while.
There aren't any groundbreaking features introduced in this patch, but it does bring versions of Gradle, Compose, and Kotter dependencies up to date, as well as fixing a few issues reported by users.
Frontend
- Add default values to
padding
andmargin
for the versions that taketopBottom
andleftRight
parameters. - Fixed buggy implementation of
Modifier.thenIf
extension methods - Fixed copy/paste error in API around
JustifySelf/JustifyItem
methods. - Update Gradle, Compose, and Kotter dependencies to latest versions.
- Compatibility FYI This version of Kobweb now targets Compose 1.1.1, which, for web, has deprecated / renamed a fair bit of code. There's a chance you won't even notice. For example, all Kobweb template projects migrated without issue. However, moving your own project to Compose 1.1.1 may not be as trivial.
- See also: COMPATIBILITY.md
Gradle
- Support custom names in source sets (thanks @DVDAndroid !)