From dcb24f887efc3d0dbf291c75da05b19221bfdee4 Mon Sep 17 00:00:00 2001 From: Aylur Date: Sat, 6 Jan 2024 14:55:52 +0100 Subject: [PATCH] mark connections and binds deprecated --- CHANGELOG.md | 17 +++++++++++++++++ meson.build | 2 +- nix/default.nix | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- src/widgets/widget.ts | 24 ++++++++++++++++-------- 6 files changed, 39 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52547df5..e2db9f93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Unreleased ## Features + +- add: Overlay.overlay Box.child +- add: params to Utils.fetch + +## Fixes + +- notifications: warn on non 8 bits image + +# 1.6.3 + +## Features + - feat: Service.bind and Variable.bind - feat: AgsWidget.register - export Widget.createCtor utility @@ -12,11 +24,13 @@ - feat: PowerProfile Service ## Breaking Changes + - update: Hyprland.active.monitor to be an object # 1.5.5 ## Features + - feat: support print from client with --run-js - feat: support shebang with --run-file - add: Utils.monitorFile @@ -29,6 +43,7 @@ # 1.5.4 ## Features + - add: notificationForceTimeout option - add: bluetooth device-added, device-removed signal - add: cursor property @@ -39,8 +54,10 @@ - add: --run-file ## Breaking Changes + - feat: Window.exclusivity - deprecate: --run-promise cli flag ## Fixes + - overlay pass-through #168 diff --git a/meson.build b/meson.build index 8b26ff0a..296bf207 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('ags', 'c', - version: '1.6.3', + version: '1.6.4', meson_version: '>= 0.62.0', license: ['GPL-3.0-or-later'], default_options: [ 'warning_level=2', 'werror=false', ], diff --git a/nix/default.nix b/nix/default.nix index e625eaaa..594170c3 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -34,7 +34,7 @@ let in stdenv.mkDerivation { pname = "ags"; - version = "1.6.3"; + version = "1.6.4"; src = buildNpmPackage { name = "ags"; @@ -42,7 +42,7 @@ stdenv.mkDerivation { dontBuild = true; - npmDepsHash = "sha256-Uwikl4gvlSsQpuI/6WdkFrlfzspHixom7d4E66+1V7w="; + npmDepsHash = "sha256-3r9sdTsSsi5TP7UDdRFlZw94FeZpPz4HG22aeKzdmLQ="; installPhase = '' mkdir $out diff --git a/package-lock.json b/package-lock.json index c59b9cbb..8505cbb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ags", - "version": "1.6.3", + "version": "1.6.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ags", - "version": "1.6.3", + "version": "1.6.4", "license": "GPL", "dependencies": { "typescript": "^5.1.0" diff --git a/package.json b/package.json index 411692ab..597431a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ags", - "version": "1.6.3", + "version": "1.6.4", "description": "description", "main": "src/main.ts", "repository": "", diff --git a/src/widgets/widget.ts b/src/widgets/widget.ts index 68e98c30..f2cda2cc 100644 --- a/src/widgets/widget.ts +++ b/src/widgets/widget.ts @@ -8,6 +8,16 @@ import { interval } from '../utils.js'; import { Variable } from '../variable.js'; import { App } from '../app.js'; +let warned = false; +function deprecated() { + if (warned) + return; + + console.warn(Error('Using "connections" and "binds" props are DEPRECATED\n' + + 'Use .hook() .bind() .poll() .on() instead, refer to the wiki to see examples')); + warned = true; +} + const ALIGN = { 'fill': Gtk.Align.FILL, 'start': Gtk.Align.START, @@ -54,14 +64,14 @@ export type Cursor = | 'zoom-in' | 'zoom-out' -export type Property = [prop: string, value: unknown]; +type Property = [prop: string, value: unknown]; -export type Connection = +type Connection = | [GObject.Object, (self: Self, ...args: unknown[]) => unknown, string?] | [string, (self: Self, ...args: unknown[]) => unknown] | [number, (self: Self, ...args: unknown[]) => unknown]; -export type Bind = [ +type Bind = [ prop: string, obj: GObject.Object, objProp?: string, @@ -78,11 +88,6 @@ export type BaseProps = { vpack?: Align cursor?: Cursor attribute?: any - - // FIXME: deprecated - connections?: Connection[] - properties?: Property[] - binds?: Bind[], }> AgsWidget.register = register; @@ -294,6 +299,7 @@ export default function AgsWidget< if (!connections) return; + deprecated(); connections.forEach(([s, callback, event]) => { if (s === undefined || callback === undefined) return console.error(Error('missing arguments to connections')); @@ -318,6 +324,7 @@ export default function AgsWidget< if (!binds) return; + deprecated(); binds.forEach(([prop, obj, objProp = 'value', transform = out => out]) => { // @ts-expect-error this.bind(prop, obj, objProp, transform); @@ -329,6 +336,7 @@ export default function AgsWidget< if (!properties) return; + console.warn(Error('"properties" is deprecated use "attribute" instead')); properties.forEach(([key, value]) => { (this as unknown as { [key: string]: unknown })[`_${key}`] = value; });