Releases: DimensionDev/Holoflows-Kit
0.9.0
See doc/holoflows-kit.api.report.md for API changes
Removal
- Deprecated
AutomatedTabTaskremoved {DOMProxy,Watcher,LiveSelector}.enhanceDebugger()removed- Deprecated
GetContext(),OnlyRunInContextremoved - Deprecated
LiveSelector.nthremoved (useLiveSelector.atinstead) - Deprecated
MessageCenterremoved
Breaking changes
Watcherno longer extends@servie/events@1.EventEmitter
Feature
Watcher.startWatchnow supports AbortSignal andonceWebExtensionMessagenow supports AbortSignal andonceWebExtensionMessagenow supports connection from external plugins.
0.8.0
See doc/holoflows-kit.api.report.md for API changes
Deprecation
GetContextis deprecated, usegetEnvironmentinstead.LiveSelector.nthis renamed toLiveSelector.at, old name is deprecated.MessageCenteris deprecated, useWebExtensionMessageinstead.OnlyRunInContextis deprecated, useassertEnvironmentinstead.
Breaking changes
AutomatedTabTaskremove and changed default value for optionsactiveandpin- Now this package define
exportsfield in the package.json
Feature
DOMProxynow add event for changes- new API
WebExtensionMessage(replace oldMessageCenter) - new API
assertEnvironment,assertNotEnvironment,isEnvironment,printEnvironmentandgetEnvironment(replace oldgetContext)
0.7.0
0.7.0 (2020-03-03)
Breaking changes
MessageCenter has changed:
Before:
const mc = new MessageCenter(key)
mc.emit(key, data, alsoSendToDocument)After:
const mc = new MessageCenter(alsoSendToDocument, key)
mc.emit(key, data)Bug Fixes
- apply @rollup/plugin-replace rename (b24c0b8)
- bypass concurrent lock (7e627ee)
- getTabOrCreate not correctly update tab (c8feb0b)
- nullish chain in get context (5b2113f)
- type error when upgrade mitt (79c7c4b)
- type not portable error (a3c2f65)
- typo in import decl (0cf93a6)
- mc: missing instanceKey when dispatch event to document (c4444f9)
- update jsx renderer (dd105c7)
Features
Reverts
- "chore: to ts 3.7 and enable useDefineForClassFields" (9fb3b34)
0.6.0 (2019-10-11)
Bug Fixes
- [close #22], add warning for nth on SingleMode (3c8e0eb)
- AutomatedTabTask not work well with ID 0 (5919900)
- bugs in AutomatedTabTask, MessageCenter and AsyncCall (cffb695)
- mixed single mode in ls and watcher; close #18 (45bb024)
- use ts 3.6 new stricter iterator type to fix AsyncCall's type (dded411)
- when tab id is 0, go through wrong branch (78af7b5)
- AsyncCall: false result dropped (49311a7)
- AsyncCall: options and call stack (3321b73)
- AsyncCall: reject methods starts with "rpc." (081be1e)
- AutomatedTabTask: can not use twice (480153e)
- docs: fix doc inconsistency (cb72dae)
- LiveSelector: ban mutation on LiveSelector (5477a55)
- LiveSelector: replace (687e9e4)
- MessageCenter: async listener (62d6113)
- MessageCenter: browser.runtime.onMessage.addListener type error (ce69f8a)
- clone the liveselector to avoid unexpected modify (7509efd)
- done is undefined (a727f06)
- ValueRef: called when value has not changed (b1b77d5)
- Watcher: false positive warning (25b3987)
- Watcher: fix warning (424f302)
- Watcher: then() emits wrong value (820aca8)
- Watcher: type error for EventCallback (b425d1e)
Features
- add devtools enhance for LiveSelector (450b507)
- add devtools for DOMProxy (2cca36c)
- add stopWatchOnDisconnected in debugger (f5bcb41)
- brand new LiveSelector and Watcher debugger (0637d6a)
- remove duplicate doms in ls. close #10 (163a195)
- split AsyncCall as a dependency (5ce733e)
- Watcher's single mode now relay on LiveSelector (a05cf3b)
- AsyncCall: new option preferLocalImplementation (6a8182f)
- AsyncCall: send local stack to remote when calling (170c5f7)
- AsyncCall: support async generator functions now. (17804bd)
- AsyncCall: support execute patch mode (3a71bb9)
- AsyncCall: support Notification now (0a9b884)
- AsyncCall: transfer Error type (586effd)
- AutomatedTabTask: support tabID as input (b1d606f)
- LiveSelector: add a shortcut to .replace(() => arr) (615a4e6)
- MessageCenter: add off function, let on return a canceller (db4751b)
- MessageCenter: add serialization (80d32fd)
- add Watcher.omitWarningForForgetWatch (8c9589f)
Reverts
0.6.0
0.6.0 (2019-10-11)
Breaking changes
- Now
MutationObserverWatcher.startWatchrequires aMutationObserverInitobject where was optional before. See https://mdn.io/MutationObserverInit
Deprecates
- Because AsyncCall is too general that it even have no dependent to any ECMAScript host environment, it is a standalone package now.
- import { AsyncCall } from '@holoflows/kit'
+ import { AsyncCall } from 'async-call-rpc'All AsyncCall related methods, types and interfaces are deprecated now and will be removed in 0.7.0.
- The name
DomProxyis depercated. Please replace it toDOMProxy. The old name will be removed in 0.7.0
- import { DomProxy } from '@holoflows/kit'
+ import { DOMProxy } from '@holoflows/kit'Watcher.enableSingleMode()brings inconsistency in the internal state ofWatcherandLiveSelector.
So this methods is deprecated, useLiveSelector.enableSingleMode()instead.
const ls = new LiveSelector()
.querySelector('*')
+ .enableSingleMode()
const watcher = new Watcher(ls)
.useForeach(fn)
- .enableSingleMode()Watcher.firstVirtualNodeis renamed toWatcher.firstDOMProxy.Watcher.getVirtualNodeByKeyis renamed toWatcher.getDOMProxyByKeyWatcher.enableBatchModeis renamed toWatcher.dismissSingleModeWarning- Property
keysandvaluesof eventonIterationon theWatcheris deprecated since they can't represent the mapping relationship of the keys and values.
Feature
- New property
destroyedonDOMProxy - Add a warning for
LiveSelector.nthin the SingleMode - New constructor option
stopWatchOnDisconnectedonMutationObserverWatcher - Add nice debuggers for the
LiveSelector,DOMProxyandWatcher.
Enable them by:
LiveSelector.enhanceDebugger()
DOMProxy.enhanceDebugger()
Watcher.enhanceDebugger()Open this feature in Chrome by: https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview
Bug Fixes
- [close #22], add warning for nth on SingleMode (3c8e0eb)
- AutomatedTabTask not work well with ID 0 (5919900)
- mixed single mode in ls and watcher; close #18 (45bb024)
- when tab id is 0, go through wrong branch (78af7b5)
- AsyncCall: false result dropped (49311a7)
Features
- add devtools enhance for LiveSelector (450b507)
- add devtools for DOMProxy (2cca36c)
- add stopWatchOnDisconnected in debugger (f5bcb41)
- brand new LiveSelector and Watcher debugger (0637d6a)
- remove duplicate doms in ls. close #10 (163a195)
- split AsyncCall as a dependency (5ce733e)
- Watcher's single mode now relay on LiveSelector (a05cf3b)
0.5.0
0.5.0 (2019-09-05)
Breaking changes
Watcher.useForeach
The callback parameter type of Watcher.useForeach has changed. (See 42df24f)
declare const x: Watcher<string>
declare const y: Watcher<HTMLElement>
x.useForeach((value, key) => {}) // Signature for Watcher<not Element> has not changed
- // before
- y.useForeach((ele: DomProxy, key, realNode: Element) => {})
+ // after, the first `ele`'s type is equal to the generic type. But it is not a real element, it is DomProxy.current
+ // if you want to access realNode, use metadata.realCurrent
+ y.useForeach((ele: HTMLElement, key, metadata: DomProxy) => {})LiveSelector.evaluateOnce
has renamed to LiveSelector.evaluate (bae3e27)
AutomatedTabTask(options)
options.key has removed. use options.asyncCallOptions.key instead (5ad6560)
Bug Fixes
- bugs in AutomatedTabTask, MessageCenter and AsyncCall (cffb695)
- AutomatedTabTask: can not use twice (480153e)
- docs: fix doc inconsistency (cb72dae)
- LiveSelector: ban mutation on LiveSelector (5477a55)
- LiveSelector: replace (687e9e4)
- MessageCenter: async listener (62d6113)
- MessageCenter: browser.runtime.onMessage.addListener type error (ce69f8a)
- clone the liveselector to avoid unexpected modify (7509efd)
- done is undefined (a727f06)
- use ts 3.6 new stricter iterator type to fix AsyncCall's type (dded411)
- AsyncCall: options and call stack (3321b73)
- AsyncCall: reject methods starts with "rpc." (081be1e)
- ValueRef: called when value has not changed (b1b77d5)
- Watcher: false positive warning (25b3987)
- Watcher: fix warning (424f302)
- Watcher: then() emits wrong value (820aca8)
- Watcher: type error for EventCallback (b425d1e)
Features
- AsyncCall: new option preferLocalImplementation (6a8182f)
- AsyncCall: send local stack to remote when calling (170c5f7)
- AsyncCall: support async generator functions now. (17804bd)
- AsyncCall: support execute patch mode (3a71bb9)
- AsyncCall: support Notification now (0a9b884)
- AsyncCall: transfer Error type (586effd)
- AutomatedTabTask: support tabID as input (b1d606f)
- LiveSelector: add a shortcut to .replace(() => arr) (615a4e6)
- MessageCenter: add off function, let on return a canceller (db4751b)
- MessageCenter: add serialization (80d32fd)
- add Watcher.omitWarningForForgetWatch (8c9589f)
Reverts
0.4.0
You can install it on npm now.
π₯ Breaking Changes
Import path changes
- For UMD version. We changed import url (0b414cf)
+/umd/index.js
-/dist/out.jsValueRefhas moved (1550669)
+es/util/ValueRef
-es/DOM/Watcher/Watchers/ValueRefAsyncCallhas move fromsrc/Extension/Async-Calltosrc/util/AsyncCall
+es/util/AsyncCall
-es/Extension/Async-CallAsyncCall breaking changes
option.dontThrowOnNotImplementedhas changed tooption.strict.methodNotFound(1e7af22)option.MessageCenterhas changed tooption.messageChannel, and it's type has changed too (fc0e5cb)option.writeToConsolehas changed tooption.logand have more options you can modify (1e7af22)JSONSerialization's replacer and receiver parameter has fixed and its type has changed (cb886da)
DomProxy breaking changes
.weakAfterand.weakBeforehas changed to.has('before')and.has('after')
Watcher breaking changes
- Both event name and data structure emitted by Watcher has changed (bc999fd)
.assignKeyshas splitted into 2 apis.assignKeysand.setComparer(3a1e6fe)- Remove
.once()and Watcher implementsPromiseLike<T>, so you can justawait watcherto get the result (options still supported) (d763ebd) - Change
.useNodeForeach()to.useForeach()and any type of Watcher can use this API now (bc999fd)
π New Feature
AsyncCall
Now AsyncCall is a JSONRPC 2.0 compatible server and client!
- New option
option.log, you can control what to log to the console (1e7af22) - New option
option.parameterStructuresto let AsyncCall behavior sendby-nameparameters if possible (cb886da) - New option
option.strictto disable AsyncCall's non-standard JSONRPC behaviors (1e7af22)
AutomatedTabTask
- New option
option.needRedirectandoption.runAtTabIDlet you run tasks on existing tab instead of open a new one (9eb4db0)
Watchers
- All watcher now have a
.enableSingleMode()which can improve the performance of the watcher when you only have 1 element emitted from the LiveSelector (bc999fd)
LiveSelector
- LiveSelector now has a
.enableSingleMode()which can improve performance when you only have 1 element to emit (bc999fd) .mapnow have 2nd and 3rd parameter just like Array (20d3775)
MessageCenter
- MessageCenter now has a alias
.emitto.send(fc0e5cb) - MessageCenter now extends
EventTarget(fc0e5cb)
π Bug Fixes
- d761c17 - Fix Watcher.firstVirtualNode not responding to setDomOption
- 5cdabb1 - Fix "this" error on requestIdleCallback on Firefox
- 03073dc - Widen Element to Node in DomProxy and Watcher. Fix when undefined emitted, watcher will not clear the old realCurrent
- 424f302 - fix(Watcher): fix warning
π©βπ» Miscellaneous
@holoflows/kit 0.3.0
You can install it on npm now.
π₯ Breaking Changes
- You need to install webextension-polyfill on Chrome to use @holoflows/kit
- The behavior of
.querySelectorand.querySelectorAllchaining has changed!
- previously: .querySelector('a').querySelector('.b') means `a, b`
+ currently : .querySelector('a').querySelector('.b') means `a b`- Effect forwarding of
stylehas changed.
- previously: style (forward, no-undo, move)
+ currently : style (forward, undo, move)- metadata support for
AsyncCallhas dropped. - Two new contexts for
Contextnow ('options' and 'debugging')
π New
- Add
.clone,.getElementsByClassName,.getElementsByTagName,.closest(beta) onLiveSelector - Add creating options for
DomProxy(See document for details). - New
.observerproperty onDomProxycan help you watch the dom changes. - New
.beforeShadow,.afterShadowproperty onDomProxycan directly attach shadow roots. - New
.weakBefore,.weakAfterproperty onDomProxycan checkbeforeandafterwithout creating them implicitly. - Now
beforeandafterof DomProxy get typed. - New
.onceonWatcherclass, it will return a promise and resolved when LiveSelector selects enough element then stop watching. - You can omit the warning from Watcher now. (omitWarningForRepeatedKeys)
AutomatedTabTaskis configurable now!
π Document
We switch to @microsoft/api-documenter to generate our document from code!
π©βπ» Others
timeoutandsleepis@internalnow (but you can still use them!)
π Internal
- Watcher now use
requestIdleCallback(with fallback) to control execute frequency of callback stopWatchonWatcheris notabstractnow.- Watcher is no longer a subclass of NodeJS.EventEmitter.
@holoflows/kit 0.2.0
You can install it on npm now.
π₯ Breaking Changes
- The interface of
AsyncCallhas been fully re-written and it gets simpler and more documented now. ValueRefhas also been fully re-written. Now it does not extend fromWatcherand provides a clearer interface.
π New
- Add a new utility called
AutomatedTabTask, that enables you to execute a task on a new tab and then close it. See document for details. - Add two undocumented utility
sleepandtimeout. Useful in async functions. AsyncCallnow supports transferring metadata on parameters and return values (Not documented yet).
π Document
- Add the document for
AsyncCall.
π©βπ» Others
- Upgrade to Typescript 3.4.1.
MessageCenternow uses''instead ofundefinedas the default key. This is not a breaking change.- We added CI! π·ββοΈ

