Commit graph

701 commits

Author SHA1 Message Date
maddalax
72c171709e wrap example in div 2025-08-16 09:47:51 -05:00
maddalax
5dba9d0167 param -> urlParam 2025-08-15 09:05:46 -05:00
github-actions[bot]
6f29b307ec Auto-update HTMGO framework version 2025-07-03 19:08:02 +00:00
Eliah Rusin
06f01b3d7c
Refactor caching system to use pluggable stores (#98)
* Refactor caching system to use pluggable stores

The commit modernizes the caching implementation by introducing a pluggable store interface that allows different cache backends. Key changes:

- Add Store interface for custom cache implementations
- Create default TTL-based store for backwards compatibility
- Add example LRU store for memory-bounded caching
- Support cache store configuration via options pattern
- Make cache cleanup logic implementation-specific
- Add comprehensive tests and documentation

The main goals were to:

1. Prevent unbounded memory growth through pluggable stores
2. Enable distributed caching support
3. Maintain backwards compatibility
4. Improve testability and maintainability

Signed-off-by: franchb <hello@franchb.com>

* Add custom cache stores docs and navigation

Signed-off-by: franchb <hello@franchb.com>

* Use GetOrCompute for atomic cache access

The commit introduces an atomic GetOrCompute method to the cache interface and refactors all cache implementations to use it. This prevents race conditions and duplicate computations when multiple goroutines request the same uncached key simultaneously.

The changes eliminate a time-of-check to time-of-use race condition in the original caching implementation, where separate Get/Set operations could lead to duplicate renders under high concurrency.

With GetOrCompute, the entire check-compute-store operation happens atomically while holding the lock, ensuring only one goroutine computes a value for any given key.

The API change is backwards compatible as the framework handles the GetOrCompute logic internally. Existing applications will automatically benefit from the

* rename to WithCacheStore

---------

Signed-off-by: franchb <hello@franchb.com>
Co-authored-by: maddalax <jm@madev.me>
2025-07-03 14:07:16 -05:00
maddalax
d555e5337f make run server build the binary instead of outputting each run to a tmp file
ensure tailwind cli is v3 for now
2025-01-24 11:51:01 -06:00
maddalax
c406b5f068 Revert "Revert "make run server build the binary instead of outputting each run to a tmp file""
This reverts commit c52f10f92d.
2025-01-24 11:50:44 -06:00
maddalax
c52f10f92d Revert "make run server build the binary instead of outputting each run to a tmp file"
This reverts commit d9c7fb3936.
2025-01-24 11:39:22 -06:00
maddalax
d9c7fb3936 make run server build the binary instead of outputting each run to a tmp file 2025-01-24 11:36:53 -06:00
github-actions[bot]
66b6dfffd3 Auto-update HTMGO framework version 2025-01-06 16:27:11 +00:00
maddalax
24b41a7604 Merge remote-tracking branch 'origin/master' 2025-01-06 10:26:19 -06:00
maddalax
0c84e42160 add info on how to change it 2025-01-06 10:26:15 -06:00
github-actions[bot]
ca4faf103e Auto-update HTMGO framework version 2025-01-06 16:25:41 +00:00
maddalax
4f537567ad allow port to be configured 2025-01-06 10:24:49 -06:00
maddalax
0d61b12561 fix snippet 2024-11-30 10:57:42 -06:00
maddalax
3f719d7011 remove new lines 2024-11-28 10:13:23 -06:00
maddalax
331f4cde82 test auto deploy 2024-11-25 11:03:40 -06:00
maddalax
ab50eaecf4 mobile fixes css 2024-11-25 10:34:22 -06:00
maddalax
baf10419f7 fix examples link 2024-11-25 10:23:12 -06:00
maddalax
c924f63ffb test 2024-11-24 10:11:41 -06:00
maddalax
ab342535d3 test 2024-11-24 10:08:41 -06:00
maddalax
15655d5c02 Merge remote-tracking branch 'origin/master' 2024-11-23 02:08:15 -06:00
maddalax
14272d6507 test 2024-11-23 02:08:11 -06:00
maddalax
d325677a1f
Update README.md 2024-11-21 07:54:23 -06:00
maddalax
e0bb30b976 remove assets dir 2024-11-21 07:51:49 -06:00
maddalax
baf5292212 add js 2024-11-21 07:51:08 -06:00
maddalax
9b69b25d0b minimal htmgo doc 2024-11-21 07:45:34 -06:00
maddalax
495e759689 remove from pages as its not needed 2024-11-21 07:29:51 -06:00
maddalax
ba8c0106d9 Merge remote-tracking branch 'origin/master' 2024-11-21 07:29:10 -06:00
maddalax
4c942a0a16
Minimal htmgo (#84)
* add RunAfterTimeout & RunOnInterval

* minimal htmgo
2024-11-21 07:27:22 -06:00
maddalax
407cc12079 Merge remote-tracking branch 'origin/master' 2024-11-21 07:04:32 -06:00
maddalax
01e4568c48
Update README.md 2024-11-18 18:14:51 -06:00
maddalax
158a6264a9 Merge remote-tracking branch 'origin/master' 2024-11-18 11:28:40 -06:00
github-actions[bot]
909d38c7f4 Auto-update HTMGO framework version 2024-11-16 14:52:58 +00:00
maddalax
825c4dd7ec
add RunAfterTimeout & RunOnInterval (#75) 2024-11-16 08:52:00 -06:00
maddalax
ef83e34b1e add RunAfterTimeout & RunOnInterval 2024-11-16 08:45:03 -06:00
Rafael de Mattos
a1af01a480
Check project directories (#70)
* Check project directories

* Remove partials directory

---------

Co-authored-by: maddalax <jm@madev.me>
2024-11-14 09:54:53 -06:00
maddalax
971f05c005 Revert "move socket manager"
This reverts commit 423fd3f429.
2024-11-12 18:16:20 -06:00
maddalax
b06d1b14bd log http requests 2024-11-12 18:15:59 -06:00
maddalax
423fd3f429 move socket manager 2024-11-12 13:04:20 -06:00
maddalax
257def3b53 up cli version 2024-11-12 08:55:35 -06:00
maddalax
97a5687f2e astgen only 2024-11-11 10:12:29 -06:00
maddalax
d2d8e449ae does this work 2024-11-11 10:10:40 -06:00
maddalax
a2d3a367d1 move codecov 2024-11-11 10:01:11 -06:00
maddalax
dc8a62313c only generate routes for partials or pages that have *h.RequestContext as a param 2024-11-11 09:55:09 -06:00
maddalax
6ec582a834
allow partials throughout the project, not just partials folder (#72)
* allow partials throughout the project, not jsut partials file

* route directly to partial

* generate correctly even if there is no partials

* run cli tests

* tidy

* only run tests on master if push

* add codecov
2024-11-11 09:17:57 -06:00
github-actions[bot]
b3834bf559 Auto-update HTMGO framework version 2024-11-09 18:33:21 +00:00
maddalax
b234ead964 fix loading livereload extension 2024-11-09 12:32:30 -06:00
github-actions[bot]
a756a0484f Auto-update HTMGO framework version 2024-11-09 18:06:38 +00:00
maddalax
34e816ff7c
Websocket Extension - Alpha (#22)
* wip

* merge

* working again

* refactor/make it a bit cleaner

* fix to only call cb for session id who initiated the event

* support broadcasting events to all clients

* refactor

* refactor into ws extension

* add go mod

* rename module

* fix naming

* refactor

* rename

* merge

* fix manager ws delete, add manager tests

* add metric page

* fixes, add k6 script

* fixes, add k6 script

* deploy docker image

* cleanup

* cleanup

* cleanup
2024-11-09 12:05:53 -06:00
maddalax
841262341a test 2024-11-05 15:17:12 -06:00