Releases: tungs/timeweb
v0.3.2
v0.3.1
- Adds support for listening to microtask events
- Adds
startRealtimeSimulation
/stopRealtimeSimulation
(name/API might change in the future) for quasi-syncing virtual and realtime timelines.- Time-getting functions (e.g. Date.now/performance.now) still don't increment in real time, but instead are stepped up every animation frame.
Full Changelog: v0.3.0...v0.3.1
v0.3.0
v0.3.0 removes the frame preparer functions from timeweb, in lieu of the event system.
Full Changelog: v0.2.2...v0.3.0
v0.2.2
v0.2.2 introduces an event system, where listeners can attach via timeweb.on
(type, fn). These can be used in lieu of frame preparers (which will be removed in v0.3.0). The current event types supported are 'preseek'
, 'postseek'
, 'preanimate'
, and 'postanimate'
.
Elements can also now use the data attribute data-timeweb-realtime
to indicate that they shouldn't be processed by timeweb. For example <video data-timeweb-realtime></video>
.
Full Changelog: v0.2.1...v0.2.2
v0.2.1
This release adds preliminary support for web workers, and fixes an issue with undocumented features of timeweb.realtime
properties not being properly assigned.
Full Changelog: v0.2.0...v0.2.1
v0.2.0
v0.2.0
v0.2.0 introduces some breaking changes to undocumented features
- DOM elements that are marked as processed now use the property
_timeweb_processed
instead of_timeweb_customized
- Removal of prefixed global variables and properties that were assigned to window and document for realtime handling functions. They're now moved to
timeweb.realtime
(introduced in v0.1.2):window._timeweb_oldDate
(nowtimeweb.realtime.Date
)window._timeweb_oldSetTimeout
(nowtimeweb.realtime.setTimeout
)window._timeweb_oldRequestAnimationFrame
(nowtimeweb.realtime.requestAnimationFrame
)window._timeweb_oldSetInterval
(nowtimeweb.realtime.setInterval
)window._timeweb_oldCancelAnimationFrame
(nowtimeweb.realtime.cancelAnimationFrame
)window._timeweb_oldClearTimeout
(nowtimeweb.realtime.clearTimeout
)window._timeweb_oldClearInterval
(nowtimeweb.realtime.clearInterval
)window._timeweb_oldPerformance
(nowtimeweb.realtime.performance
, as intimeweb.realtime.performance.now()
)document._timeweb_oldCreateElement
(nowtimeweb.realtime.createElement
)document._timeweb_oldCreateElementNS
(nowtimeweb.realtime.createElementNS
)
- Removal of prefixed global variables for internal timeweb methods. Most of them are now directly accessible via the
timeweb
object, as of v0.1.2:window._timeweb_processUntilTime
(nowtimeweb.processUntilTime
)window._timeweb_runAnimationFrames
(nowtimeweb.runAnimationFrames
)window._timeweb_addFramePreparer
(nowtimeweb.addFramePreparer
, though this is an unstable feature that may be changed in the future, in favor of an event-type model)window._timeweb_runFramePreparers
(nowtimeweb.runFramePreparers
)window._timeweb_processNextBlock
(not accessible anymore)
Full Changelog: v0.1.2...v0.2.0
v0.1.2
v0.1.2 exports more time-handling functions through export
statements. In the built file, they are available via the timeweb
object:
- the
realtime
property gives access to real-time functions and objects (e.g.timeweb.realtime.performance.now()
):Date
setTimeout
requestAnimationFrame
cancelAnimationFrame
clearTimeout
performance
createElement
createElementNS
Previously methods available in the global scope with the _timeweb
prefixed are now available in the timeweb
object as well:
processUntilTime
runAnimationFrames
runFramePreparers
addFramePreparer
All of the above methods are going to be removed from the global scope in the next release, so it's recommended to switch over to using invocations from the timeweb
object.
Full Changelog: v0.1.1...v0.1.2
v0.1.1
Version 0.1.1
Version 0.1.1 slightly changes the way that video is handled
- fixes an issue where nonattached video elements were not processed by
timeweb
, because customcreateElement
andcreateElementNS
functions were assigned towindow
instead ofdocument
. play
events are no longer immediately dispatched bytimeweb
, and are dispatched after a virtualsetTimeout
. This is useful for attaching event listeners to autoplayed videos defined in HTML. See #1.