Skip to content

v0.0.10 - Fix route registration for pages without handlers

Choose a tag to compare

@jackielii jackielii released this 29 Sep 10:54
· 187 commits to main since this release

What's Changed

🐛 Bug Fixes

  • Fixed route registration dependency on struct field order - Routes now register correctly regardless of where pages without handlers are positioned in the struct
  • Skip pages without handlers or children - Pages that have neither a handler nor children are now silently skipped instead of causing registration errors

🧪 Testing

  • Added comprehensive test coverage for parent/children registration scenarios
  • Added mounting completeness tests to verify all expected routes are registered
  • Added test assertions for 404 handling of unregistered routes

📋 Details

Previously, if a page struct had no Page() method and no children, it would cause an error that stopped the entire route registration process. This particularly affected scenarios where such pages weren't placed at the end of the struct definition.

The fix changes the behavior to silently skip these pages, allowing all other valid routes to register properly.

Full Changelog: v0.0.9...v0.0.10