v2.0.0-beta.1
Pre-release
Pre-release
Read the announcement: GTKX 2.0 beta 1: a smaller, safer foundation.
GTKX 2.0 beta 1 is a prerelease. The final GTKX 2.0 release is scheduled for December 1, 2026, after a three-month migration and hardening period.
Breaking Changes
- The GTKX 1.6 migration behaviors are now standard:
- GIR byte sequences return
Uint8Arrayinstead ofnumber[]. - Bindings returning
GObject.Valuereturn its contents asunknown. - Promisified finish methods omit an always-true leading success boolean.
- Inout records and boxed values mutate the object passed in without repeating it in the return value.
- Assets use relative
?resource,?icon, or?urlimports; GSettings schemas use query-free relative imports. The#data/import map is gone. Gtk-4.0andAdw-1are always bound.- Generated classes register independently so unused bindings can be tree-shaken.
- GIR byte sequences return
- Configuration is smaller — Remove the
futureblock fromgtkx.config.ts. Graduated flags left attrueare temporarily accepted and ignored with a warning;falseand unknown flags are configuration errors. Remove retired v2 IDs fromdeprecations.silencetoo.librariesnow names only dependencies in addition to GTK and Adwaita;libraries: "*"is removed, and explicitly listingGtk-4.0orAdw-1is an error. - Generated registration follows reachability — A side-effect-only import of a generated namespace no longer retains every class. Import a class when code depends on its registration or resolves it through
GObject.typeFromName. - JSX elements are namespace-only — The bare
@gtkx/jsxentry point is removed. Import elements from generated namespace subpaths such as@gtkx/jsx/gtkand@gtkx/jsx/adw; this keeps unrelated generated libraries out of the module graph. - GTKX is ESM-only on Node.js 26.7 or newer — Published packages expose explicit ESM entry points and reject CommonJS
require(). Applications need"type": "module", and Flatpak source builds use the Node 26 SDK extension. (#595, #596)
Removed Deprecated APIs
addEventListenerandremoveEventListeneron generated GObjects are removed; useonandoff.Gdk.RGBA.create(css)is removed; construct anRGBAand callparse, checking its result, or provide component values to the constructor.Graphene.Point.create,Graphene.Rect.create, andGraphene.Size.createare removed; use their constructors, withRect.initwhere appropriate.GObject.buildValueis removed; pass the JavaScript value directly or initialize a newGObject.Value.- The
@gtkx/gi/cairoalias is removed; import from@gtkx/cairo. - Cairo's deprecated
*ConstructorPropsaliases are removed. - Property access on
animated, such asanimated.GtkLabel, is removed; import the component and callanimated(GtkLabel). AnimatedElementsis removed; useAnimatedElementMap. (#595)
Internationalization
@gtkx/i18nnow exposes the upstreami18nextandreact-i18nextAPIs instead of maintaining parallel GTKX wrappers and overloads.- Source extraction uses
i18next-cli. Catalog-owning code uses statically recoverable calls under the exact namest,useTranslation,Trans, andTransWithoutContext; imported aliases, member calls such asi18n.t, dynamic keys, and CommonJS declarations are no longer extraction forms. - Generated declarations augment i18next's standard
CustomTypeOptionsresources throughI18nResourcesinstead of using GTKX's formerTranslationRegistry. - The
TranslationRegistryand GTKX-specificTFunctiontypes are removed; useI18nResourcesandTFunctionfromi18next. - Plurals use standard i18next options such as
defaultValue_oneanddefaultValue_other. - Localized projects require GNU gettext 0.25 or newer. (#596)
Native and Generated Binding Fixes
- Invalid allocation or copy sizes, unregistered GTypes, non-GObject or non-instantiable types, and unknown construction properties now throw JavaScript errors instead of reaching crash-prone native operations.
- GLib criticals raised during an FFI call return through that call instead of aborting the process.
- Generated bindings now classify boxed, fundamental, and plain struct records correctly.
- Plain structs with declared copy and free functions preserve ownership correctly and use their own destructor.
- Marshalling fixes cover arrays and length parameters, callbacks, enums and flags, fundamental and boxed handles, hash tables, strings, GValues, signals, constructors, and virtual methods. (native validation, record ownership, #596)
Toolchain and Release Validation
- Dependencies and build toolchains have been refreshed.
- Flatpak source deployment targets
org.freedesktop.Sdk.Extension.node26and pins pnpm 11.25. - Generated deployment metadata recognizes additional hosted Git repository URL forms. (toolchain update)
- Release end-to-end validation selects the exact package version being prepared, so prereleases are verified without requiring npm's
latesttag.
Full changelog: v1.6.0...v2.0.0-beta.1