Skip to content

@thesephist thesephist released this May 11, 2019 · 9 commits to master since this release

Besides the usual performance improvements and bug fixes (TM), this patch release addresses three rendering bugs discovered while building side projects.


  • Fix a major bug that broke templates when jdom tags were nested inside jdom tags with falsy template params
  • Fixes in Styled(): when rendering nested CSS rules, nested rules should take precedence over rules on self
  • In render(): when rendering a reflected HTML attribute, first check if the property is already set, since it may trigger setters inadvertently on HTML elements like <video>, <iframe>, and <audio>.

Debugging improvements

  • Improve core library debugging facilities and remove potential breaking points in debugging, especially around logging replacement of nodes
Assets 5
Apr 30, 2019

This update focuses on two improvements:

  1. Error messages have been optimized to be equally helpful, but take up less data on the wire in a gzipped bundle.

  2. When calling Router.go(routeURL), we can now also pass the {replace: true} option to replace a current history entry rather than simply appending.

Assets 5

@thesephist thesephist released this Mar 24, 2019 · 61 commits to master since this release

This is a purely under-the-hood update that includes a significant performance improvement for Styled components that declare styles using the css template tag, by taking advantage of caching at multiple levels in the pipeline.

More information about this optimization can be found in 67575b7.

Assets 5

@thesephist thesephist released this Mar 24, 2019 · 65 commits to master since this release

Besides regular maintenance / dependency upgrades, this is a feature release containing one major new feature, a template tag called css to simplify declaring styles for Styled() components in Torus.

Like React's styled-components, the css tag takes a template literal that contains SCSS syntax for styles, and converts it to Torus's native style format. This makes authoring style easier, currently at the cost of a bit of measurable performance hit. You can read more about this new API in the documentation page.

See the new syntax in action at

Assets 5

@thesephist thesephist released this Mar 3, 2019 · 84 commits to master since this release

Besides regular maintenance / dependency upgrades, this release fixes a bug in the router that previously made it possible to push the same route onto the history stack multiple times.

Assets 5

@thesephist thesephist released this Feb 4, 2019 · 92 commits to master since this release

This is a regular maintenance update with small improvements and optimizations

  • Bundle size / performance improvements with terser notations around loops and redundant type casts
  • torus-dom is now linted with ESLint! yarn lint to lint the codebase


  • No dynamic values passed into jdom templates are evaluated as templates, to avoid script injection vulnerabilities. This was existing behavior, but is now made clearer in the documentation and covered by regression tests.
Assets 5

The API seems to be settling into a definite shape, so I'm anticipating that in a few more releases we'll hit 1.0, at which point most future changes will be API backwards-compatible. There is only one breaking change this release, for an internal API, and a few new APIs for collection types, Store and List.

API Changes

  • Store class's add/remove/create methods now return the added/removed/created record, for chaining and keeping track of the added record.
  • Added Store#find method for plucking record with a given ID from a store.
  • The internal renderJDOM function that encapsulates the vDOM reconciliation logic has been renamed to render. This isn't a "breaking" change since render isn't intended to be a public API, but is an API change worth noting.
  • Stores and Lists are now full ECMAScript iterables, and you can spread them ( and for...of loop over them!


  • Fixed broken TypeScript type definitions
  • Fixed bug in routing logic where route parameters would match against an empty string, resulting in funny behavior.

Other changes

  • If your custom Component#compose() method doesn't return valid JDOM (returns undefined instead), Torus now emits a more descriptive error message about invalid JDOM being returned, rather than throwing the component's vDOM into a broken state.
  • Optimized children render paths so there's fewer checks and newer render passes for unchanged children, resulting in faster vDOM reconciliation.
  • CI setup with Travis CI for continuous build status monitoring.
Assets 3
Jan 3, 2019

There's been lots of work since the last release, but this release focuses on three big things: a few new APIs, minor bug fixes, and meaningful performance optimizations across the board.

API changes

  • Components used as itemClass for a list are now passed a second argument to the constructor, which is the callback used to remove the item from the list and the backing store.
  • Components used as itemClass for a list are also transparently passed through any extra nth arguments passed to the list constructor, as n+1th arguments to the item class constructor.
  • Torus now exports all the APIs through two globals, Torus and jdom, when loaded using a <script> tag, and exports all APIs correctly (and also installs and builds correctly) when installed using NPM and bundled with Webpack or another bundler.

Fixes and improvements

  • Fixed bugs around styling. Specifically, comma-separated CSS selectors in Styled() components are now parsed correctly
  • Fixed bugs that broke the renderer when a Node or text elements were rendered as the root node of a component multiple times.
  • The rendering and reconciliation algorithm was refactored to more easily support asynchronous rendering (React calls this "concurrent" rendering in React Fiber), should Torus want to support that in the future. Before, splitting up render work in requestIdleCallback calls would throw.
  • Improved debugging statements in development mode, especially around rendering children elements.
  • Typescript type definitions are now bundled in the package!


  • The renderer now doesn't touch expensive DOM traversal operations until the very end, when committing changes to the DOM. This makes rendering 20-40% faster than before.
  • Other parts of the renderer have also been rewritten or refactored to make it interact with the DOM less, take up less bytes on the wire, or run faster without any API changes.
  • The jdom template tag has received a host of optimizations to make it quicker as well.
  • The entire bundle is still well under 5kB gzipped, giving you a good performance budget.
Assets 3
You can’t perform that action at this time.