Q:

How can I force Aurelia updating the DOM?

I'm rebuilding this pentomino blocks puzzle in Aurelia (Angular version is here: http://www.ashware.nl/pentomino) because I could not achieve the effect I wanted in Angular. The puzzle game is working fine, but the auto solver - a service that's computing all the possible solutions for the puzzle (there are many) is so busy that Aurelia does not update the DOM.
The service I'm building (solver-service.js) mainly consists of a function that tries to fit a block (in all it's possible positions) on the board. When it succeeds it calls itself recursively to fit the next block and it uses backtracking when it gets stuck.
I tried several methods to reflect the model changes by the solver in the view, the latest being 'signal' to trigger value converters for the positioning and orientation of the puzzle blocks (pentominoes).
I tried micro-tasks to reflect the changes during the life cycle of aurelia, requestAnimationFrame() and promises to do the next step in the .then() part, but that makes the process asynchronous which breaks the backtracking mechanism here.
It might be possible that the fact that I'm using a double (nested) repeat.for to render the blocks is the culprit.
When I interrupt the execution in the inspector, Aurelia does update the view, but only the first level of the repeat.for, so the positions are updated, but not the orientation / rotation of the blocks, which are reflected by the second level.
Code can be viewed here: https://github.com/Esger/Pentominos2/tree/feature/solver
So what is the best way to let Aurelia update the view all the time during heavy computation? - I want to show the solving process continuously.

A:

Web workers did the trick! :) I put the solver service in a web worker, a separate thread, so Aurelia isn't blocked by the heavy computing of it anymore.
The worker sends data to the main thread from time to time or when it has found a solution. Perfect!
One problem abides: Aurelia does update the view with the positions of the blocks found by the worker, but only when I click or try to scroll the page - I have to keep doing that in order to see updates continuously.
So clicking and scrolling the page triggers Aurelia to update the view. It would be nicer if it could do that by itself. Thanks @jeffG for the direction.

