- Introduced
beforeRender
option to mangle a view model before Taunus renders a server-side view
- Fixed a long-standing bug where partials appended to other places would emit events using the wrong
container
- Introduced
taunus.partial.afterOf
method
- Introduced
taunus.partial.beforeOf
method
- Upgraded
hget
to2.0.0
- Added
wet
option that avoids history updates on redirects
- Upgraded
accepts
to1.3.0
- The client-side implementation now emits a
render.error
event whenever a view fails to render. It includes the following arguments:err, container, model, route
- Upgraded
gradual
to1.0.7
- Fixed a bug where the prefetched wouldn't work
- Changed
taunus.xhr
so that it can only make identical requests once every second
- Fixed a bug where deferral wouldn't work because the global alias was miscalculated
- Fixed a bug in the prefetcher logic
- Introduced the ability to filter
DEBUG
message types usingDEBUG.filter('name|name|name')
- Added a
taunus.track
method that keeps track of things that should be destroyed when a view or partial view gets removed from the document
- Now using
crossvent
for event handling - Incorporated
gradual
into Taunus core - It can be accessed as
taunus.gradual
- Option to disable
gradual
by settingforms: false
in the options - Option to disable link hijacking by setting
links: false
in the options
For form submissions to be handled properly, make sure to honor the as-text
query string, returning a plain text response even if the request asks for JSON
- Replaced
contra.emitter
withcontra@1.9.1/emitter
- Fixed
console.log
patch intaunus/browser/debug
which would fail under IE9
- Replaced
fast-url-parser
withomnibox
to broaden browser support
taunus.partial.replace
changes thecontainer
to the first topmost element after replacementpartial(...).on('render', fn)
changed so thatfn
now receivescontainer
in addition tohtml
taunus.partial.replace
now gets rid of the target DOM element entirely, as originally intended
- Exposed a
versionCheck(version, url?)
method on the client-side that will redirect tourl
(or refresh the page), if there's a version mismatch. Returnstrue
if the check passes - Exposed a
state
object on the server-side containing theversion
that was used to mount Taunus
- The
router
event is now properly emitted after a timeout
- Partial view templates can now interact with the
route
model property just like master views - Added
taunus.partial.appendTo
,taunus.partial.beforeOf
, andtaunus.partial.replace
methods to complementtaunus.partial
- Added
dry
option totaunus.go
, which only updates the URL and relevant state components - Added a
router(route)
event whenever the history route changes through Taunus
- Added an optional
as-text
query parameter for Taunus view responses to return JSON responses as plain-text HTML
taunus.resolve
no longer returns routes with trailing slashes if they have a missing optional parameter
- All deferred templates and controllers are stored in memory, sorted by version
- Fixed an issue where versioning mismatches wouldn't refresh the page
- Taunus now ignores anchor tags with a
download
attribute - Taunus now ignores anchor tags with
target='_blank'
- Taunus now ignores anchor tags with a
data-taunus-ignore
attribute
- Introduced ability to call
taunus.xhr
with(options, done)
in addition to(url, done)
and(url, options, done)
- Added ability for redirects to be forced even if redirecting to the same URL
- Fixed a bug where views wouldn't emit an event asynchronously if the view could be rendered immediately
- Introduced a view-level event emitter. You can now do
taunus.partial(div, 'tags', ['a', 'b']).on('render', fn)
andfn
will be eventually invoked when the partial is rendered. Useful for situations where a partial view may be rendered asynchronously because it was deferred.
- Exposed
taunus.redirect
method on the client-side
taunus.xhr
now allows you to issue requests with content other than JSON (e.gmultipart/form-data
) and still get a JSON response back
taunus.redirect
now takes anoptions
object, where you can set ahard
option. If it's set totrue
, AJAX redirects will be followed usinglocation.href = url
rather thantaunus.navigate(url)
- Exposed
route
information directly on view models, for convenience.- Most useful for accessing
route.query
parameters - Has
toJSON
no-op so that it doesn't bloat the model itself after use on templates
- Most useful for accessing
- Removed
parts
from the result - Introduced
hash
as a string containing the#hash
part of a URL (equivalent ofparts.hash
, except it's''
if empty) - Introduced
path
(equivalent ofparts.path
) - Introduced
pathname
(equivalent ofparts.pathname
) - Introduced
search
(equivalent ofparts.search
) - Introduced
query
as an equivalent ofparts.query
. Parsed according to input values:''
and'true'
are converted totrue
'false'
is converted tofalse
'123'
,'-123'
, and'+123'
are all converted to base-10 integers- Anything else stays a string
- Faster and simpler, now compares on
route.path
(ignoring hashes as usual)
require('taunus')
is automatically transformed intorequire('taunus/global')
in deferred modules
- Fixed an issue in the underlying IndexedDB caching layer where it would throw on WebKit-based devices (Safari, Chrome for iOS, etc)
- Hash navigation no longer triggers a Taunus activation. Navigating from
/foo
to/foo#bar
has no effect, while navigating from /foo#bar to/baz#bar
still triggers an activation
- The
taunus
API that's available in view templates will no longer leave a trace in the view model - Partial templates can no longer modify the view model, and they have access to a cloned copy instead
- If loading a server-side controller results in an error other than
'MODULE_NOT_FOUND'
, the error is now thrown
- Exposed
version
property on client-side API - Fixed an issue where routes with the same path but different query part would be considered identical
- Removed
startIndex
parameter to Router API introduced in4.0.0
- Navigating to the same route over and over no longer pushes new history states, uses
replaceState
instead - Added
startIndex
parameter to Router API - Taunus notices redirects and renders the appropriate view
- Introduced
taunus.redirect
API on the server-side
- Fixes a bug caused by
v3.3.0
- Internal
taunus.render
method (consumed bytaunus-express
andtaunus-hapi
) changed signature. Upgrade totaunus-express@1.2.0
ortaunus-hapi@1.4.0
.
- Fix a bug on the client-side where you couldn't have multiple routes with the same route pattern
- Internal: Replaced
routes
withruta3
for flexibility and convenience
- Fix failing test in
taunus.resolve
where optional parameters would be enforced
- Fixed an issue where
taunus.resolve
would replace named regular expression parameters such as:hash(d+)
and keep the regular expression part, resulting in/hashes/5499cf5f(d+)
instead of/hashes/5499cf5f
- Fixed an issue where
taunus.resolve
would replace falsy values with empty strings
- Introduced
taunus.resolve(action, data)
method to resolve routes without manually constructing them, on both client-side and server-side
- Layout gets access to rendered
action
(partials can always use JavaScript!)
- Removed
uglifyify
dependency - Removed duplicate
uglify-js
dependency
- Bumped
hget
to1.1.0
- Public
taunus.prefetch(url, element)
API exposed
- ETag is now computed out of the HTML (or text) and not just the model in non-JSON responses
- Added dependency on
contra
- Taunus exposes itself as a global to simplify script deferral
- Introduced
taunus/browser/debug
andtaunus/global
alternative entry points - Introduced deferred loading for view templates and view controllers
- Added
--defer
flag to the CLI - Added
deferMinified
option totaunus.mount
to minify deferred bundles - Changed
taunus.route()
, now exposes query string as an object inroute.parts
- Created
'change'
event, emitted whenever a view navigation occurs - Created
taunus.state.clear()
method to clear the cache - Renamed
--standalone
to--bundle
in the CLI - Created
getPartial
option fortaunus.mount
on the server-side
- Fixed an issue where Taunus version-tracking was updating the wrong file
- Reduced maximum interceptor latency to
50ms
, from previous200ms
maximum - Force directory creation when using the
taunus
CLI
- Improved consistency across event handler arguments
- Routes baked by the CLI are an array similar to the server-side routes created by the consumer, avoiding confusion
- Exposed an
.xhr(url, options?, done)
method on the client-side Taunus API
- When navigating to a hashed route on a different view, the scroll position will be properly updated
- Introduced versioning API, Taunus now has the ability to work through application version changes
- Fixed an issue where the Taunus CLI would generate invalid CommonJS wiring modules
- Introduced
scroll
option fortaunus.navigate
, allowing the consumer to control whether scroll position should be modified - Use
document.documentElement
as the default scroll target
- Created
router.equals(route, route)
method - Router now works even when passed partial routes such as
'#foo'
or''
, usinglocation.href
as reference taunus.navigate
won't fetch the model for a route that has the same parameters as the last route- A
force
option ontaunus.navigate
can be used to request a model anyways - A
strict
option ontaunus.navigate
can be used to ignore unmatched URLs taunus.state
now exposes the currentroute
alongside its model- Fixed a bug where the caching layer would never pull cached results for hashed routes
- The
ETag
is now calculated using the fullviewModel
, and not just thepartial
view model
- Routes now properly override caching on an individual basis
- CLI flag
--replacements
renamed--resolvers
for consistency - Shortened resolver names for simplicity and to mitigate confusion
getViewTemplatePath
is nowgetView
getViewControllerPath
is nowgetClientController
getControllerActionPath
is nowgetServerController
- On the client-side, throw if
bootstrap
is unsupported whentaunus.mount
is called - If
taunus.navigate
is called with an URL that doesn't match any route, then the user will be redirected vialocation.href
- Added
canPreventDefault
property to interceptorevent
parameters
- Client-side controller signature changed to
controller(model, container, route)
- Renamed public
hget
option intoplaintext
- Fixed link behavior where hash navigation (as in
/foo#comments
) would trigger unnecessary AJAX requests - Introduced simpler
manual
bootstrap option
- Added additional safe-guards against failed IndexedDB bootstrapping
- Fixed a bug when resolving relative paths in the Taunus CLI
- Fixed a bug when omitting the
options
object when invokingtaunus.mount
in the client-side document.title
only changes if it's defined in the model- The
container
object passed totaunus.mount
on the client-side must be a DOM element
- Removed
manual
bootstrap option - Introduced automatic bootstrap that fetches the model for you
- Reinstated inline bootstrap that expects model to be inline in a
<script type='text/taunus'>
tag - Reduced maximum caching latency to
200ms
from500ms
- Got rid of
localStorage
cache, relying solely on memory and IndexedDB cache stores - Introduced link prefetching on
mouseover
andtouchstart
for anchor links with valid Taunus routes - Default cache half-life set to
30
seconds - Simplified interface to
'fetcher.*'
events
- Introduced ability to use different backends through
taunus-express
ortaunus-hapi
- CLI arguments now have proper shorthand one-character aliases
- CLI supports transforming routes, e.g using
hapiify
to transform Hapi routes into something the client-side Taunus router understands - Reasonable defaults using a dedicated
.bin
directory
- Interceptors are now event-drived
- Introduced blind-caching engine based on interceptors, disabled by default
- Introduced more XHR-tracking events
- Model is now expected to load asynchronously via
taunusReady
global - Introduced
jsonp
support - Reduced amount of data transferred over JSON
- Requesting a new page provokes Taunus to
.abort
the request currently being made
- Removed dependency on
lodash.unescape
- A
max-age=0
header prevents stale content from never being refreshed
- Changed
max-age
to only 1 hour
- Add ability to rebuild default view model at a later point in time
Wait for defaults
to become available before serving any responses
- Use
accepts
for content negotiation
- Fixed an issue when navigating to hashes
- Fixed an issue with links being reloaded
- Fixed an issue when navigating backwards
- Changed caching model to
private, must-revalidate
, and setmax-age
to a day
- Default view model no longer request-based, more memory efficient
- Use a different URL when hijacking AJAX requests so that browsers properly cache JSON vs HTML
- Introduced server-side view caching, setting
ETag
,Vary
, andcache-control
HTTP headers
- Fix a bug where old browsers would change the
location.href
and execute AJAX code afterwards - Fix a bug where
ignore
wouldn't be propagated by the CLI to client-side routes
- Anchor links containing
<span>
or any other child elements that may be event targets now get hijacked as well
- Print the stack trace of captured template rendering errors
- Fix a bug in browsers without history API
- Prevent
.mount
to be called more than once in the client-side - Friendly error message if view rendering fails
- Fix a bug where links wouldn't be ajax-enhanced
- Introduced
skip
to skip over view routes in certain situations
- Added
ignore
option to allow routes that go straight to the server
- Introduced ability to set response status code in model
- Implemented public API method that allows generating a response using the Taunus API
- Browser support when
history
API is missing
- Moved around arguments for
'error'
event
- Event emitter no longer throws on errors
- Renders views using
function(model)
on the server-side as well
- Play nice on links with
href='#...'
- Fixed a missing reference to
raf
- Taunus now expects
data-taunus
attributes to match a<script>
tag containing the view model
- Navigating through history properly triggers the corresponding scroll towards the route hash, or the top of the document
- Improved routing logic so that it remembers
search
andhash
parts of a URL, while these won't factor into routing itself
taunus.state.model
now exposes the current view's model
- Introduced middleware option to modify base view model on a request basis
- Publish
state
on public API
- Fix a bug when navigating backwards where the
document.title
wouldn't be updated
- Fix a bug when navigating backwards to a view that re-routed the action through
model.action
req.user
is automatically copied intomodel.user
- Relative paths for convenience
- Ability to change the default action through a property in the model
- Introduced public API method
.navigate(url)
- Added an optional
route
parameter for internal use
- Fixed a bug where the initial
start
andrender
events would broadcast the wrong context
- Fixed navigation when clicking links that don't match a route
- Fixed navigation when clicking links
res.viewModel.action
allows you to change the view to be rendered- If the request has a
.flash
method, then it'll get consumed when generating a response
- Expose partials on the core API in the client-side
- Use
'
intead of"
in auto-generated wiring
- Reworded standalone CLI usage
Fixes
- Fixed an issue with controllers not running on the client-side
- Separated concerns in routing, templating, and controllers in the client-side
- Added ability to intercept model requests and return a cached response before they server is queried
.taunusrc
options can also be configured inpackage.json
, as thetaunus
property
taunus --standalone taunus.js
eliminates dependency on Common.JS and Browserify
Fixes
- Fixed an issue when clicking on links
- Turned into an event emitter
- Link click route-checking is delegated from
document.body
- Implemented replaceable module path resolvers for customization
- Fixed a CLI issue forming paths on Windows
- Initial Public Release