{"id":17800965,"url":"https://github.com/refi64/grex","last_synced_at":"2025-03-17T10:34:24.139Z","repository":{"id":69429205,"uuid":"392863578","full_name":"refi64/grex","owner":"refi64","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-19T02:05:53.000Z","size":443,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T01:41:25.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refi64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-05T01:02:04.000Z","updated_at":"2025-03-10T09:19:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"af3608ae-51ad-434a-888d-9e90711b7292","html_url":"https://github.com/refi64/grex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fgrex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fgrex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fgrex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fgrex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refi64","download_url":"https://codeload.github.com/refi64/grex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858590,"owners_count":20359379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T12:32:48.952Z","updated_at":"2025-03-17T10:34:24.113Z","avatar_url":"https://github.com/refi64.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grex\n\nGrex is a very rough project aiming at bringing reactive development to GTK,\ncomplete with nice extras such as hot reload. The approach is heavily inspired\nby [the \"incremental DOM\" approach used by\nAngular](https://google.github.io/incremental-dom/).\n\nPlease see the [introductory blog\npost](https://refi64.com/posts/introducing-grex.html) for more information.\n\nTODO: actual documentation here\n\n## Concepts\n\nConsider the following XML file:\n\n```xml\n\u003cHelloWindow title=\"Hello, Grex!\" default-width=\"[620]\" default-height=\"[480]\"\u003e\n  \u003cGtkBox orientation=\"horizontal\" hexpand=\"[true]\" valign=\"center\" margin-start=\"[16]\" margin-end=\"[16]\"\u003e\n    \u003cGtkBox orientation=\"horizontal\" hexpand=\"[true]\" halign=\"start\"\u003e\n      \u003cGtkLabel label=\"Show the timer\" halign=\"start\" margin-end=\"[16]\" /\u003e\n      \u003cGtkSwitch active=\"{timer-visible}\" halign=\"end\" /\u003e\n    \u003c/GtkBox\u003e\n    \u003cGtkLabel _Grex.if=\"[timer-visible]\" label=\"[elapsed] second(s) elapsed\" /\u003e\n    \u003cGtkButton label=\"Reset\" on.clicked=\"[emit reset($0)]\" /\u003e\n  \u003c/GtkBox\u003e\n\u003c/HelloWindow\u003e\n```\n\nThe entire XML document is referred to as a *template*, and the individual\nelements are *fragments*. These fragments are converted to a GTK widget tree\nduring a process known as *inflation*, with each inflated widget holding a\n*fragment host* that manages the widget's state.\n\nEach attribute \u0026 value in a fragment are its *bindings*. The values can take\nthree forms:\n\n- `attr=\"[expression]\"` - one-way binding, will set the property `attr` on the\n  fragment's widget with the result of `expression`, re-applying the value when\n  an inflation occurs\n- `attr=\"{expression}\"` - two-way binding, similar to one-way bindings, but, if\n  the widget's `attr` changes, it will be assigned to `expression`\n- `attr=\"some text [expression] some text\"` - compound binding, similar to\n  one-way bindings, but allows you to place text between and around the\n  bindings, with the binding's result now being a string\n\n### Directives\n\nA core part of Grex are *directives*. Any binding whose attribute starts with a\ncapital letter is a directive, and, instead of setting the value directly on the\ntarget, the value will be passed to the directive, which can then manipulate the\nfragment host as desired.\n\nDirectives can also be *structural*, indicated by a leading `_`. These\ndirectives will be given the fragment and are responsible for inserting the\nfragment into its parent.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fgrex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefi64%2Fgrex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fgrex/lists"}