8000 Releases · go-humble/router · GitHub
[go: up one dir, main page]

Skip to content

Releases

Version 0.5.0

Version 0.5.0 Pre-release
Pre-release

Choose a tag to compare

@albrow albrow released this 09 Mar 22:58

This version includes an improvement to the regex used for route pattern matching and support for query parameters.

This version is backwards compatible with version 0.4.0.

Big thanks to @jancona for contributing!

Changelog

  • Improved regex for route pattern matching to support various special characters.
  • Added support for query parameters. They are accessible from within rout handlers via Context.QueryParameters.

Version 0.4.0

Version 0.4.0 Pre-release
Pre-release

Choose a tag to compare

@albrow albrow released this 10 Jan 15:43

This version includes small bug fixes and minor new features.

Changelog

  • Fixed a bug where InterceptLinks was not working in some cases when multiple links were present on the page. (Thanks @boyvinall!)
  • Removed a call to log.Fatal if a path did not match any known routes. This was causing Karma tests to fail and may have been causing some issues in real world usage.
  • Added a new Verbose option, which if set to true will cause a router to log whenever a path does not match any known routes. This can be viewed as a replacement for the old log.Fatal behavior.
  • Updated guidelines in CONTRIBUTING.md to make contributing easier.

Version 0.2.2

Version 0.2.2 Pre-release
Pre-release

Choose a tag to compare

@albrow albrow released this 13 Sep 03:08

This release simply fixes some typos in the README.

Version 0.2.0

Version 0.2.0 Pre-release
Pre-release

Choose a tag to compare

@albrow albrow released this 17 May 17:16

This release fixes one minor bug and makes handler functions more flexible.

In previous releases, router.Handler was a function that accepted a map[string]string as an argument. Version 0.2.0 changes that, instead using router.Context as an argument, which is defined as follows:

// Context is used as an argument to Handlers
type Context struct {
    // Params is the parameters from the url as a map of names to values.
    Params map[string]string
    // Path is the path that triggered this particular route. If the hash
    // fallback is being used, the value of path does not include the '#'
    // symbol.
    Path string
    // InitialLoad is true iff this route was triggered during the initial
    // page load. I.e. it is true if this is the first path that the browser
    // was visiting when the javascript finished loading.
    InitialLoad bool
}

In addition, this release fixes a minor bug. In previous releases, a router behaved differently depending on whether or not history.pushState was supported. If the router was using the hash fallback, it would trigger a route during the initial page load. However, if the pushState implementation was being used, it would not do so. Version 0.2.0 unifies the two implementations, and now they will both trigger the appropriate route on initial page load. We have also included Context.InitialLoad, which is a boolean indicating whether or not the route was triggered on initial page load.

Full Changelog

  • Handlers now take Context as an argument instead of a map of parameters.
  • If pushState is supported, router will trigger the appropriate route on the initial page load.

Version 0.1.0

Version 0.1.0 Pre-release
Pre-release

Choose a tag to compare

@albrow albrow released this 16 May 02:48

This is the initial release following the migration from github.com/soroushjp to github.com/go-humble and the split into stand-alone packages.

See the README for a list of features, a getting started guide, and more information.

0