Releases: Aylur/ags
v3.1.2
v3.1.1
v3.1.0
3.1.0
Update Gnim to 1.9. See Gnim#21.
Changes
Accessor
New Accessor getter function syntax.
let a: Accessor<T>
let aReactive: T = a() // will track `a` as a dependency in reactive scopes
let aNonReactive: T = a.peek() // simply reads the value without tracking itThe .get() syntax has been renamed to .peek() to reflect its use-case
better. Note that .get() still works, its simply marked as deprecated.
createComputed
Array dependency and get syntax is deprecated and replaced with the new
Accessor syntax.
// deprecated
createComputed([dep1, dep2], (v1, v2) => v1 + v2)
createComputed((get) => get(dep1) + get(dep2))
// replaced by
createComputed(() => dep1() + dep2())Note that they are simply marked as deprecated and still work, but newly written
code should use the new syntax.
New Features
createBinding nested properties
createBinding now supports passing multiple keys which behaves as a "path" to
the property
interface Nested extends GObject.Object {
value: string
}
interface MyObject extends GObject.Object {
nested: null | Nested
}
const value: Accessor<string | null> = createBinding(object, "nested", "value")If any part of the path is nullable the resulting Accessor's value will also be
nullable.
createState custom equals
It is now possible to specify a custom equals function to customize when to
emit change notifications
const [value, setValue] = createState(0, {
equals: (prev, next) => prev > next,
})createEffect
Previously, users had to use .subscribe() on each dependency and manually
cleanup with onCleanup. Now you can do it in one function without worrying
about cleanups.
let a: Accessor<T>
let b: Accessor<T>
// immediately runs the function, and re-runs whenever a or b changes
createEffect(() => {
console.log("a changed", a())
console.log("b changed", b())
})You can use .peek() to not track accessors.
// will only run once
createEffect(() => {
console.log("a:", a.peek())
})An effect with no dependencies is identical to onMount
createMemo
Its signature is identical to createComputed, but instead of invalidating its
value and only computing upon access, createMemo will eagerly recompute and
will only notify when the value actually changed.
let a: Accessor<number>
let b: Accessor<number>
const memo: Accessor<number> = createMemo(() => a() * b())v3.0.0
v3
The previous JSX runtime implementation relied on GTK3's cascading destroy signal for resource management, which changed in GTK4 and could no longer be relied upon.
The JSX runtime has been reimagined with inspiration from modern web frameworks. It has been migrated to Gnim.
See the Migration Guide.
Changes and Features
-
astalifyhas been completely replaced by JSX, subclasses now work without wrappers -
The
VariableAPI has been replaced byAccessorand its constructor functions:createStatecreateBindingcreateComputed
-
The
childrenprop is now properly type-annotated for TypeScript -
childrencan no longer take reactive values directly: use<For>and<With>instead -
<For>and<With>components for dynamic rendering -
scoping mechanism and lifecycle hooks:
onCleanuponMountcreateRootgetScope
-
GObject decorators have been updated to stage 3
-
new type-safe DBus decorators similar to GObject decorators
-
Signal handler type annotations are now automatically generated
-
The
--gtk4flag is no longer required, as it is inferred from the codebase -
The
-aflag for theruncommand has been removed and replaced with rest arguments -
The
bundlecommand now embeds JS code into a Bash script, removing the need to manually useLD_PRELOAD -
The
initcommand now defaults to GTK4
v2.3.0
v2.2.1
Fixes
- fix path resolutions when running
ags runwith default.config/agsargument - feat:
--rootflag which can be used in meson and other build tools wherecdis not an option
Full Changelog: v2.2.0...v2.2.1
v2.2.0
What's Changed
--srcand--tsconfigflag of therunandbundlecommands are deprecated, use--defineinstead- type resolution of the
astalpackage has been moved topackage.json - templates have been updated to use a
package.json - gtk4 support
- gtk4 template
Full Changelog: v2.0.1...v2.2.0
v2.0.1
Hotifx for ags init --directory flag
Full Changelog: v2.0.0...v2.0.1
v2.0.0
After a lot of work, here is the release of AGS v2.
The core functionality of AGS has been reimplemented from scratch in Vala and C and was named Astal.
Services are now standalone libraries and can be cherry picked. Most of them also include a cli tool
to make them even more versatile. For example they could be paired with Eww.
I was debating whether to keep this project alive or move everything into Astal, but as Astal
was starting to get feature complete I realized what made AGS easy to use was missing. Namely
Astal in TypeScript/JavaScript requires a build step and it was not very convenient to just get started with.
Turns out there are quite a few things to consider when bundling and setting up a project especially when someone is not familiar with the mess of js tooling. So I repurposed AGS to act as a scaffolding tool for Astal projects written in TS/JS, while features are
done in Astal, bundling is outsourced to AGS.
Astal vs AGS v1
New features are:
- TypeScript support ootb
- JSX
- widget fixes
- EventBox
hover, andhover-lostsignals will now correctly work even when they are at the edge of a window. - Setting the size or the icon if an Icon widget will no longer flicker.
- EventBox
- no more globals like
App,ServiceandUtils - no more
Service.importorresource:///com/github/aylur/ags, simply import fromastalorgi://LibName
Serviceis no longer a thing, for "custom services" just simply subclassGObject.Object- instead of
Service.registeryou can now use decorators - the cli client no longer uses dbus, which should be it a lot more faster
- the cli client is a lot more powerful
- there is no need for setting variables and functions global to then access them on cli
- you can define a
requestHandlerwhich handles messages coming from the cli
AGS v2 bundler
This project is simply meant to be an esbuild distribution.
Currently it has a few plugins builtin:
- importing
.csswill inline it in as a string - importing
.scsswill transpile them and inline it as a string - importing
.blpwill compile them and inline the xml as a string - importing something with
inline:prefix will inline the file's contents as a string
Since Astal is a library it lost App.configDir.
The goal of these plugins is to be able to bundle everything into a single
executable and avoiding having to refer to files outside the script.
In cases where you still have to refer to the source dir, AGS defines a global SRC variable.
You can:
Setup a starter project with ags init
Generate types when adding new libs with ags types
Bundle the script with ags bundle
And run a project without bundling with ags run
Checkout the Astal website and the new AGS website
Special thanks to
- kotontrion for writing some of the libraries and overall helping around
- tokyoB0t for polishing the Lua lib and Lua docs
- Xoores for being a subscriber on ko-fi from the beginning
- and everyone else who contributed
I've never really said thanks for donators before, so I'd also like to thank now everyone who donated
- awsumatt
- Jas Singh
- eXia
- johndoe42
- kotontrion
- Rubén L
- Francois Rigaut
- Keule2
- The_Branch_Manager
- Keil Miller Jr
- Grosheth
- Iain
- Harija
- magic
and especially:
- JNC
- Chris Phillips
Also thanks to everyone that picked up Astal while being developed and reported bugs either on Discord or Github.
v1.8.2
Features
- Calendar.detail
- SpinButton.range
- SpinButton.increments
- Network.frequency
- recursive Utils.monitorFile
- add: Network.vpn
- add write and writeAsync to Utils.subprocess (#388)
Fixes
- compiles with typescript >= 5.0.4
- DrawingArea.draw-fn
- hyprland: active client empty on window close
- dispose signal on Variable
- skip unnecessary value setting in Utils.derive and Utils.merge
- properly log errors from Variables
- adjust Hyprland socket (#398)
Breaking Changes
- Stream.is_muted corresponds to actual mute state
- Utils.exec returns stderr on error
New Contributors
- @A7R7 made their first contribution in #335
- @h-banii made their first contribution in #332
- @webflo-dev made their first contribution in #355
- @Robin-Sch made their first contribution in #357
- @NicolaiVdS made their first contribution in #345
- @topaxi made their first contribution in #358
- @PixisVI made their first contribution in #341
- @amitds1997 made their first contribution in #384
- @teutonicjoe made their first contribution in #380
Full Changelog: v1.8.0...v1.8.2