{"id":44822362,"url":"https://github.com/grace-plugins/grace-htmx","last_synced_at":"2026-02-16T20:40:02.094Z","repository":{"id":221927282,"uuid":"751682836","full_name":"grace-plugins/grace-htmx","owner":"grace-plugins","description":"Grace Plugin for using Grace with htmx","archived":false,"fork":false,"pushed_at":"2025-07-05T07:56:00.000Z","size":1748,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T08:38:10.242Z","etag":null,"topics":["grace","graceframework","grails","htmx","spring-boot"],"latest_commit_sha":null,"homepage":"https://plugins.graceframework.org/grace-htmx/latest/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grace-plugins.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,"zenodo":null}},"created_at":"2024-02-02T05:07:39.000Z","updated_at":"2025-07-05T07:56:04.000Z","dependencies_parsed_at":"2024-02-11T06:22:34.337Z","dependency_job_id":"4395948d-fefe-439c-9cc3-da9965e80971","html_url":"https://github.com/grace-plugins/grace-htmx","commit_stats":null,"previous_names":["grace-plugins/grace-htmx"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/grace-plugins/grace-htmx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grace-plugins%2Fgrace-htmx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grace-plugins%2Fgrace-htmx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grace-plugins%2Fgrace-htmx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grace-plugins%2Fgrace-htmx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grace-plugins","download_url":"https://codeload.github.com/grace-plugins/grace-htmx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grace-plugins%2Fgrace-htmx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29517653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T18:37:19.720Z","status":"ssl_error","status_checked_at":"2026-02-16T18:36:46.920Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["grace","graceframework","grails","htmx","spring-boot"],"created_at":"2026-02-16T20:40:01.479Z","updated_at":"2026-02-16T20:40:02.086Z","avatar_url":"https://github.com/grace-plugins.png","language":"JavaScript","readme":"[![Main branch build status](https://github.com/grace-plugins/grace-htmx/workflows/Grace%20CI/badge.svg?style=flat)](https://github.com/grace-plugins/grace-htmx/actions?query=workflow%3A%Grace+CI%22)\n[![Apache 2.0 license](https://img.shields.io/badge/License-APACHE%202.0-green.svg?logo=APACHE\u0026style=flat)](https://opensource.org/licenses/Apache-2.0)\n[![Latest version on Maven Central](https://img.shields.io/maven-central/v/org.graceframework.plugins/htmx.svg?label=Maven%20Central\u0026logo=apache-maven\u0026style=flat)](https://search.maven.org/search?q=g:org.graceframework.plugins)\n[![Grace Document](https://img.shields.io/badge/Grace_Document-0.9.x-blue?style=flat\u0026logo=asciidoctor\u0026logoColor=E40046\u0026labelColor=ffffff\u0026color=f49b06)](https://plugins.graceframework.org/grace-htmx/0.9.x/)\n[![Grace on X](https://img.shields.io/twitter/follow/graceframework?style=social)](https://x.com/graceframework)\n\n[![Groovy Version](https://img.shields.io/badge/Groovy-3.0.22-blue?style=flat\u0026color=4298b8)](https://groovy-lang.org/releasenotes/groovy-3.0.html)\n[![Grace Version](https://img.shields.io/badge/Grace-2022.2.8-blue?style=flat\u0026color=f49b06)](https://github.com/graceframework/grace-framework/releases/tag/v2022.2.8)\n\n# Grace with Htmx\n\nGrace Plugin for using Grace/Grails app with htmx.\n\n## Ducumentation\n\n* [0.9.x](https://plugins.graceframework.org/grace-htmx/0.9.x/)\n\n## Usage\n\nAdd dependency to the `build.gradle`,\n\n```gradle\n\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation \"org.graceframework.plugins:htmx:VERSION\"\n}\n```\n\nHtmx plugin supports controller-specific `withFormat()` method,\n\n```groovy\nclass BookController {\n\n    def list() {\n        def books = Book.list()\n\n        withFormat {\n            htmx {\n                render(template: \"book\", model: [bookList: books])\n            }\n            json {\n                render books as JSON\n            }\n        }\n    }\n}\n```\n\nAlso, this plugin supports extendsions for Grails Request and Response,\n\n```groovy\n// You can get htmx request headers from Grails Request\n\nrequest.htmx.boosted == request.getHeader('HX-Boosted')\nrequest.htmx.target  == request.getHeader('HX-Target')\n\n// Check htmx request?\nif (request.htmx as boolean) { // or use request.isHtmx()\n    template = 'book-detail'\n}\n\n// You can set htmx response headers in Grails\n\nresponse.htmx.trigger = 'itemAdded'\n\n```\n\nIf you use [`respond`](https://grails.github.io/legacy-grails-doc/4.0.0/ref/Controllers/respond.html) method introduced in Grails 2.3. The respond method tries to produce the most appropriate response for the requested content type (JSON, XML, HTML etc.)\n\nYou can [configure mime types](https://grails.github.io/legacy-grails-doc/4.0.0/guide/theWebLayer.html#contentNegotiation) for Htmx.\n\nUpdate the `app/conf/application.yml`:\n\n```yml\ngrails:\n    mime:\n        types:\n            htmx: text/html\n```\n\nFor example given the show action:\n\n```groovy\ndef show(Book book) {\n    respond book\n}\n```\n\nYou could supply a `show.htmx.gsp` file to render the HTMX:\n\n```html\n\u003cdiv id=\"${book.id}\"\u003e\n    \u003ch1\u003e${book.title}\u003c/h1\u003e\n    \u003cp\u003e${book.description}\u003c/p\u003e\n\u003c/div\u003e\n```\n\nIf you use `asset-pipeline` plugin, this plugin already includes `htmx.js`, `hyperscript.js`,\nso you can add `htmx.js` to the `app/assets/application.js`,\n\n```javascript\n//= require hyperscript\n//= require htmx\n//= require_self\n```\n\nAlso, you can use `asset` tag in the GSP,\n\n```HTML\n\u003casset:javascript src=\"hyperscript.js\"/\u003e\n\u003casset:javascript src=\"htmx.js\"/\u003e\n```\n\n\u003e [!TIP]\n\u003e Add `hyperscript.js` to `assets.minifyOptions.excludes` If your app has an error when compiling assets.\n\n\n```bash\nhyperscript.unminified.js:85:24: ERROR - [JSC_PARSE_ERROR] Parse error. '(' expected\n  85|         static OP_TABLE = {\n                              ^\n\n1 error(s), 0 warning(s)\nClosure uglify JS Exception\nasset.pipeline.processors.MinifyException: [JSC_PARSE_ERROR. Parse error. '(' expected at hyperscript.unminified.js line 85 : 24]\n        at asset.pipeline.processors.ClosureCompilerProcessor.process(ClosureCompilerProcessor.groovy:81)\n        at asset.pipeline.processors.ClosureCompilerProcessor$process.call(Unknown Source)\n        at asset.pipeline.AssetCompiler$_compile_closure4.doCall(AssetCompiler.groovy:171)\n```\n\n```gradle\nassets {\n    minifyJs = true\n    minifyCss = true\n    minifyOptions = [\n        excludes: ['hyperscript.js'],\n        languageMode: 'ES6',\n        targetLanguage: 'ES6', //Can go from ES6 to ES5 for those bleeding edgers\n        optimizationLevel: 'SIMPLE' //Or ADVANCED or WHITESPACE_ONLY\n    ]\n}\n```\n\n## Example\n\n* [Grace Htmx TodoMVC](https://github.com/grace-guides/gs-htmx-todomvc)\n\n## Development\n\n### Build from source\n\n```\ngit clone https://github.com/grace-plugins/grace-htmx.git\ncd grace-htmx\n./gradlew publishToMavenLocal\n```\n\n## Support Version\n\n### Versions\n\nTo make it easier for users to use and upgrade, Plugin adopts a version policy consistent with the [Grace Framework](https://github.com/graceframework/grace-framework).\n\n| Plugin Version | Grace Version |\n|----------------|---------------|\n| 1.0.x          | 2023.0+       |\n| 0.9.x          | 2022.0+       |\n\n\n## License\n\nThis plugin is available as open source under the terms of the [APACHE LICENSE, VERSION 2.0](http://apache.org/Licenses/LICENSE-2.0)\n\n## Links\n\n- [Grace Framework](https://github.com/graceframework/grace-framework)\n- [Grace Plugins](https://github.com/grace-plugins)\n- [Grace Htmx Plugin](https://github.com/grace-plugins/grace-htmx)\n- [Grace Htmx TodoMVC](https://github.com/grace-guides/gs-htmx-todomvc)\n- [Grails Htmx TodoMVC](https://github.com/rainboyan/grails-htmx-todomvc)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrace-plugins%2Fgrace-htmx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrace-plugins%2Fgrace-htmx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrace-plugins%2Fgrace-htmx/lists"}