- Add fs methods to write files, save file upload
- golang/go#45757 (comment)
- https://github.com/hack-pad/hackpadfs
- https://github.com/jarxorg/wfs
- Add separate "wfs" for writable fs?
- Update
xtemplate-caddy
. Note only caddy 2.8.0 uses Go 1.22- Figure out how to run caddy with xtemplate
- Must test on caddy head?
- Accept dot provider configuration from Caddyfile
- Add .TemplateLazy that renders a template to a io.ReadSeeker after the first call to a method. Can be used for mail, servecontent, etc
- Add mail module:
- Send mail, send mail by rendering template
- https://github.com/Shopify/gomail
- Use https://github.com/abhinav/goldmark-frontmatter
- Publish docker image, document docker usage
- Pass Config.Ctx down to http.Server/net.Listener to allow caller to cancel .Serve() and associated instances.
- Test configuration methods
- CLI
- Go API
- Test dot providers
- FS
- DB
- Using different databases
- Should be documented with DotDBProvider go docs (?)
- Using the new go-arg cli flags
- Using json config
- Creating a provider
- Measure performance
- Make and link to more example applications
- Demo/test how to use sql
- Demo/test reading and writing to the context fs
- Demonstrate how to do auth with xtemplate
- Demo integration with caddy-git for zero-CI app deployments
- NATS provider:
- Request-Reply
- Look into https://github.com/42atomys/sprout
- Review https://github.com/hairyhenderson/gomplate for data source ideas
- Fix
superfluous response.WriteHeader call from github.com/felixge/httpsnoop.(*Metrics).CaptureMetrics
https://go.dev/play/p/spBB4w7nBCZ - Accept Env configuration
- Built-in CSRF handling?
- Fine tune timeouts? https://ieftimov.com/posts/make-resilient-golang-net-http-servers-using-timeouts-deadlines-context-cancellation/
- Idea: Add special FILE pseudo-func that is replaced with a string constant of the current filename.
- Potentially useful for invoking a template file with a relative path. (Add DIR constant too?)
- Parse().Tree.Root.(*ListNode).[].(recurse) where NodeType()==NodeIdentifier replace with StringNode
- Modify relative path invocations to point to the local path. https://pkg.go.dev/text/template/[email protected]#TemplateNode
- Should be fine?
- See if its possible to implement sql queryrows with https://go.dev/wiki/RangefuncExperiment
- Not until caddy releases 2.8.0 and upgrades to 1.22.
- Add command that pre-compresses static files
- Schema migration? https://david.rothlis.net/declarative-schema-migration-for-sqlite/
- Schema generator: https://gitlab.com/Screwtapello/sqlite-schema-diagram/-/blob/main/sqlite-schema-diagram.sql?ref_type=heads
- Add a way to register additional routes dynamically during init
- Organize docs according to https://diataxis.fr/
- Research alternative template loading strategies:
- Rename ConfigOverride to Option
- Add NATS provider:
- Publish, Subscribe to subject, loop on receive to send via open SSE connection
- Add basic multiuser chat demo
- KV: Get/Put/Delete/Purge/Watch
- Documentation
- Fix readme to include links to the godoc page
- Remove markdown
code
sections from godoc comments since they are not supported - Fix godoc formatting in general: https://pkg.go.dev/github.com/fluhus/godoc-tricks
- Add version information to binaries
- Fix docker build, add to ci
- Expose Main() so Go lib users can use it, moving cmd to app/cmd
- Documentation
- Fix formatting; see https://pkg.go.dev/github.com/fluhus/godoc-tricks
- Have .Resp handle response serving for fs files.
- Tag v0.5.0
- Tests
- Reorganize tests so hurl files correspond with directories in templates
- Test provider configuration
- JSON
- Test dot providers
- KV
- Accept JSON configuration
- Implement Json Unmarshaller https://pkg.go.dev/encoding/json
- Add config flag to load config from JSON file
- Allow raw config with --config and config file with --config-file
- Parse args -> decode config files in args to args -> decode config values in args to args -> parse args again
- Test that everything can be configured, load config -> dump back
- [-] Downgrade to go 1.21 - Cannot due to using 1.22 ServeMux
- Documentation
- Streamline readme
- Provider Go API docs
- Expose all funcmap funcs so godoc can be the primary documentation.
- Dot Provider system
- Create system for customizing template dot value
- Convert existing modules
- Accept configuration from cli
- Figure out how to document providers: Use go docs
- Get rid of Server/Instance interfaces, expose structs directly
- Catch servemux addhandler panics and return an error instead
- Use go-arg library for arg parsing
- Fix go-arg embedded structs or don't use them alexflint/go-arg#242
- Add library documentation
- Reorganize to expose different layers:
- Config: Configure xtemplate
- Instance: Serves as the local context and http.Handler
- Server: Manages instances and lets you live reload live.
- Fix dockerfile
- Refactor watch to be easier to use from both Main() and xtemplate-caddy.
- Use LogAttrs in hot paths
- Simplify handlers
- Use github.com/felixge/httpsnoop to capture response metrics
- Support minifying templates as they're loaded. https://github.com/tdewolff/minify
- Adjust the way config defaults are set
- Improve cli help output
- Republish caddy module as github.com/infogulch/xtemplate-caddy
- Add github workflow to publish binaries and release when a git tag is pushed
- Rewrite configuration to be normal
- Add Why and How to use sections to README
- Remove caddy module, to republish as github.com/infogulch/xtemplate-caddy
- Highlight file server feature
- Switch to using Go 1.22's new servemux
- Add PathValue method to .Req
- Allow truncated hash to positively identify file; switch to url-encoded hash value
- Allow searching for custom file extension to identify template files
- Don't route hidden files that start with a '.', not a '_'. We don't need to reinvent hidden files.
- Fix docs, tests after
_
->.
change.
- Make extrafuncs an array
- Split xtemplate from caddy so it can be used standalone
- Split watcher into a separate component
- Isolate caddy integration into one file
- Split into separate packages
xtemplate
andxtemplate/caddy
, rename repo toxtemplate
- Write basic server based on net/http
- Demo how to use standalone
- Update docs describe the separate packages
- Integrate a static file server
- Negotiate accept-encoding
- Set up automation
- Build and upload binaries
- Set up hurl tests
- Refactor router to return
http.Handler
, use custom handler for static files - Allow .ServeFile to serve files from contextfs
- Switch to functional options pattern for configuration
- Support SSE
- Demo client side hot reload