Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3 #685

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

v3 #685

wants to merge 18 commits into from

Conversation

Aylur
Copy link
Owner

@Aylur Aylur commented Mar 8, 2025

There are two main goals with this:

  • target regular gtk applications that use gjs
  • having to maintain less code by removing the gjs and lua lib from the astal repo
    • gjs lib is split into two:
      • core lib is aylur/gjsx which targets gtk3 gtk4 and gnome shell extensions
      • ags lib that has a few more utils and reexports gjsx
    • lua lib will be maintained by tokyob0t
    • I have no plans to work on a python lib anymore but there is a wip by 0x6e6174

What this means for you is a few things:

  • fundamental distinction between class and function components
  • no more astalify wrappers, JSX expressions handle everything
    • in cases where you need the type of the widget the jsx function can be used directly
    • you can still use the old v1 syntax by simply wrapping widgets in a jsx function call (its a one liner)
  • few syntax changes, e.g
    • onSignal -> $signal
    • onNotifyProperty -> $$property
    • setup -> $
    • cssClasses -> class (in gtk4, its just an alias, cssClasses can still be used)
    • className -> class (gtk3)
  • Variable API is gone and replaced by State Poll Watch
  • new For component which takes care of list rendering (idea taken from Solidjs)
  • dynamic rendering is a bit less intuitive with the With component but its a lot more performant
  • children property can be typechecked with TypeScript
  • and a few more smaller changes

For the cli a few QOL changes

  • --gtk4 flag is no longer required, gtk version is inferred from code
  • bundling embeds js code into a bash script, which means its no longer needed to manually use LD_PRELOAD
  • nix: remove ags.lib.bundle, since it is very easy to write a derivation

TODO:

  • update docs
  • port examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant