Releases: DimensionDev/Holoflows-Kit
0.9.0
See doc/holoflows-kit.api.report.md for API changes
Removal
- Deprecated
AutomatedTabTask
removed {DOMProxy,Watcher,LiveSelector}.enhanceDebugger()
removed- Deprecated
GetContext()
,OnlyRunInContext
removed - Deprecated
LiveSelector.nth
removed (useLiveSelector.at
instead) - Deprecated
MessageCenter
removed
Breaking changes
Watcher
no longer extends@servie/events@1
.EventEmitter
Feature
Watcher.startWatch
now supports AbortSignal andonce
WebExtensionMessage
now supports AbortSignal andonce
WebExtensionMessage
now supports connection from external plugins.
0.8.0
See doc/holoflows-kit.api.report.md for API changes
Deprecation
GetContext
is deprecated, usegetEnvironment
instead.LiveSelector.nth
is renamed toLiveSelector.at
, old name is deprecated.MessageCenter
is deprecated, useWebExtensionMessage
instead.OnlyRunInContext
is deprecated, useassertEnvironment
instead.
Breaking changes
AutomatedTabTask
remove and changed default value for optionsactive
andpin
- Now this package define
exports
field in the package.json
Feature
DOMProxy
now add event for changes- new API
WebExtensionMessage
(replace oldMessageCenter
) - new API
assertEnvironment
,assertNotEnvironment
,isEnvironment
,printEnvironment
andgetEnvironment
(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.startWatch
requires aMutationObserverInit
object 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
DomProxy
is 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 ofWatcher
andLiveSelector
.
So this methods is deprecated, useLiveSelector.enableSingleMode()
instead.
const ls = new LiveSelector()
.querySelector('*')
+ .enableSingleMode()
const watcher = new Watcher(ls)
.useForeach(fn)
- .enableSingleMode()
Watcher.firstVirtualNode
is renamed toWatcher.firstDOMProxy
.Watcher.getVirtualNodeByKey
is renamed toWatcher.getDOMProxyByKey
Watcher.enableBatchMode
is renamed toWatcher.dismissSingleModeWarning
- Property
keys
andvalues
of eventonIteration
on theWatcher
is deprecated since they can't represent the mapping relationship of the keys and values.
Feature
- New property
destroyed
onDOMProxy
- Add a warning for
LiveSelector.nth
in the SingleMode - New constructor option
stopWatchOnDisconnected
onMutationObserverWatcher
- Add nice debuggers for the
LiveSelector
,DOMProxy
andWatcher
.
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.js
ValueRef
has moved (1550669)
+es/util/ValueRef
-es/DOM/Watcher/Watchers/ValueRef
AsyncCall
has move fromsrc/Extension/Async-Call
tosrc/util/AsyncCall
+es/util/AsyncCall
-es/Extension/Async-Call
AsyncCall breaking changes
option.dontThrowOnNotImplemented
has changed tooption.strict.methodNotFound
(1e7af22)option.MessageCenter
has changed tooption.messageChannel
, and it's type has changed too (fc0e5cb)option.writeToConsole
has changed tooption.log
and have more options you can modify (1e7af22)JSONSerialization
's replacer and receiver parameter has fixed and its type has changed (cb886da)
DomProxy breaking changes
.weakAfter
and.weakBefore
has changed to.has('before')
and.has('after')
Watcher breaking changes
- Both event name and data structure emitted by Watcher has changed (bc999fd)
.assignKeys
has splitted into 2 apis.assignKeys
and.setComparer
(3a1e6fe)- Remove
.once()
and Watcher implementsPromiseLike<T>
, so you can justawait watcher
to 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.parameterStructures
to let AsyncCall behavior sendby-name
parameters if possible (cb886da) - New option
option.strict
to disable AsyncCall's non-standard JSONRPC behaviors (1e7af22)
AutomatedTabTask
- New option
option.needRedirect
andoption.runAtTabID
let 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) .map
now have 2nd and 3rd parameter just like Array (20d3775)
MessageCenter
- MessageCenter now has a alias
.emit
to.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
.querySelector
and.querySelectorAll
chaining has changed!
- previously: .querySelector('a').querySelector('.b') means `a, b`
+ currently : .querySelector('a').querySelector('.b') means `a b`
- Effect forwarding of
style
has changed.
- previously: style (forward, no-undo, move)
+ currently : style (forward, undo, move)
- metadata support for
AsyncCall
has dropped. - Two new contexts for
Context
now ('options' and 'debugging')
π New
- Add
.clone
,.getElementsByClassName
,.getElementsByTagName
,.closest
(beta) onLiveSelector
- Add creating options for
DomProxy
(See document for details). - New
.observer
property onDomProxy
can help you watch the dom changes. - New
.beforeShadow
,.afterShadow
property onDomProxy
can directly attach shadow roots. - New
.weakBefore
,.weakAfter
property onDomProxy
can checkbefore
andafter
without creating them implicitly. - Now
before
andafter
of DomProxy get typed. - New
.once
onWatcher
class, it will return a promise and resolved when LiveSelector selects enough element then stop watching. - You can omit the warning from Watcher now. (omitWarningForRepeatedKeys)
AutomatedTabTask
is configurable now!
π Document
We switch to @microsoft/api-documenter to generate our document from code!
π©βπ» Others
timeout
andsleep
is@internal
now (but you can still use them!)
π Internal
- Watcher now use
requestIdleCallback
(with fallback) to control execute frequency of callback stopWatch
onWatcher
is notabstract
now.- 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
AsyncCall
has been fully re-written and it gets simpler and more documented now. ValueRef
has also been fully re-written. Now it does not extend fromWatcher
and 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
sleep
andtimeout
. Useful in async functions. AsyncCall
now supports transferring metadata on parameters and return values (Not documented yet).
π Document
- Add the document for
AsyncCall
.
π©βπ» Others
- Upgrade to Typescript 3.4.1.
MessageCenter
now uses''
instead ofundefined
as the default key. This is not a breaking change.- We added CI! π·ββοΈ