Repository navigation
v0.0.9
What's New in v0.0.9
✨ Features
- Dynamic Component Selection: Added
RenderComponent()function that allows Props methods to dynamically select which component to render - Improved Props Resolution: Props method resolution now correctly uses PageConfig for component selection
- Skip Rendering Support: Added proper support for
ErrSkipPageRenderin Props methods for conditional rendering
🐛 Bug Fixes
- Fixed props method resolution to correctly interact with PageConfig
- Resolved deprecation warnings in the codebase
🧪 Testing Improvements
- Added comprehensive tests for
ErrSkipPageRenderfunctionality - Removed templ dependency from test files for cleaner testing
📝 Example Usage
The new RenderComponent function allows dynamic component selection:
func (p MyPage) Props(r *http.Request) (string, error) {
if r.URL.Query().Get("partial") == "true" {
// Render PartialView component with custom data
return "", RenderComponent("PartialView", "custom data")
}
return "default data", nil
}This release improves the flexibility of the structpages framework while maintaining backward compatibility.