Skip to content

Releases: DimensionDev/Holoflows-Kit

0.9.0

20 May 09:49
Compare
Choose a tag to compare

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 (use LiveSelector.at instead)
  • Deprecated MessageCenter removed

Breaking changes

  1. Watcher no longer extends @servie/events@1.EventEmitter

Feature

  1. Watcher.startWatch now supports AbortSignal and once
  2. WebExtensionMessage now supports AbortSignal and once
  3. WebExtensionMessage now supports connection from external plugins.

0.8.0

15 Dec 08:57
Compare
Choose a tag to compare

See doc/holoflows-kit.api.report.md for API changes

Deprecation

  1. GetContext is deprecated, use getEnvironment instead.
  2. LiveSelector.nth is renamed to LiveSelector.at, old name is deprecated.
  3. MessageCenter is deprecated, use WebExtensionMessage instead.
  4. OnlyRunInContext is deprecated, use assertEnvironment instead.

Breaking changes

  1. AutomatedTabTask remove and changed default value for options active and pin
  2. Now this package define exports field in the package.json

Feature

  1. DOMProxy now add event for changes
  2. new API WebExtensionMessage (replace old MessageCenter)
  3. new API assertEnvironment, assertNotEnvironment, isEnvironment, printEnvironment and getEnvironment (replace old getContext)

0.7.0

03 Mar 07:16
Compare
Choose a tag to compare

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

  • add isEqual to ValueRef (5e52bc5)
  • make ValueRef.isEqual public (f39d05e)

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

11 Oct 09:05
97a4ddc
Compare
Choose a tag to compare

0.6.0 (2019-10-11)

Breaking changes

  1. Now MutationObserverWatcher.startWatch requires a MutationObserverInit object where was optional before. See https://mdn.io/MutationObserverInit

Deprecates

  1. 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.

  1. The name DomProxy is depercated. Please replace it to DOMProxy. The old name will be removed in 0.7.0
- import { DomProxy } from '@holoflows/kit'
+ import { DOMProxy } from '@holoflows/kit'
  1. Watcher.enableSingleMode() brings inconsistency in the internal state of Watcher and LiveSelector.
    So this methods is deprecated, use LiveSelector.enableSingleMode() instead.
const ls = new LiveSelector()
    .querySelector('*')
+    .enableSingleMode()

const watcher = new Watcher(ls)
    .useForeach(fn)
-    .enableSingleMode()
  1. Watcher.firstVirtualNode is renamed to Watcher.firstDOMProxy.
  2. Watcher.getVirtualNodeByKey is renamed to Watcher.getDOMProxyByKey
  3. Watcher.enableBatchMode is renamed to Watcher.dismissSingleModeWarning
  4. Property keys and values of event onIteration on the Watcher is deprecated since they can't represent the mapping relationship of the keys and values.

Feature

  1. New property destroyed on DOMProxy
  2. Add a warning for LiveSelector.nth in the SingleMode
  3. New constructor option stopWatchOnDisconnected on MutationObserverWatcher
  4. Add nice debuggers for the LiveSelector, DOMProxy and Watcher.

Enable them by:

LiveSelector.enhanceDebugger()
DOMProxy.enhanceDebugger()
Watcher.enhanceDebugger()

Before enable this feature:
image

Open this feature in Chrome by: https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview

After enable this feature:
image

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

05 Sep 04:22
Compare
Choose a tag to compare

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

12 Jul 13:25
Compare
Choose a tag to compare

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
+es/util/ValueRef
-es/DOM/Watcher/Watchers/ValueRef
  • AsyncCall has move from src/Extension/Async-Call to src/util/AsyncCall
+es/util/AsyncCall
-es/Extension/Async-Call

AsyncCall breaking changes

  • option.dontThrowOnNotImplemented has changed to option.strict.methodNotFound (1e7af22)
  • option.MessageCenter has changed to option.messageChannel, and it's type has changed too (fc0e5cb)
  • option.writeToConsole has changed to option.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 implements PromiseLike<T>, so you can just await 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 send by-name parameters if possible (cb886da)
  • New option option.strict to disable AsyncCall's non-standard JSONRPC behaviors (1e7af22)

AutomatedTabTask

  • New option option.needRedirect and option.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

  • 0b414cf - ci: update project config
  • bc1efe1 - doc: tutorial up to date

@holoflows/kit 0.3.0

13 May 12:06
Compare
Choose a tag to compare

You can install it on npm now.

πŸ’₯ Breaking Changes

  1. You need to install webextension-polyfill on Chrome to use @holoflows/kit
  2. 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`
  1. Effect forwarding of style has changed.
- previously: style (forward, no-undo, move)
+ currently : style (forward, undo, move)
  1. metadata support for AsyncCall has dropped.
  2. Two new contexts for Context now ('options' and 'debugging')

πŸ†• New

  1. Add .clone, .getElementsByClassName, .getElementsByTagName, .closest(beta) on LiveSelector
  2. Add creating options for DomProxy (See document for details).
  3. New .observer property on DomProxy can help you watch the dom changes.
  4. New .beforeShadow, .afterShadow property on DomProxy can directly attach shadow roots.
  5. New .weakBefore, .weakAfter property on DomProxy can check before and after without creating them implicitly.
  6. Now before and after of DomProxy get typed.
  7. New .once on Watcher class, it will return a promise and resolved when LiveSelector selects enough element then stop watching.
  8. You can omit the warning from Watcher now. (omitWarningForRepeatedKeys)
  9. AutomatedTabTask is configurable now!

πŸ“ƒ Document

We switch to @microsoft/api-documenter to generate our document from code!

πŸ‘©β€πŸ’» Others

  1. timeout and sleep is @internal now (but you can still use them!)

πŸ” Internal

  1. Watcher now use requestIdleCallback (with fallback) to control execute frequency of callback
  2. stopWatch on Watcher is not abstract now.
  3. Watcher is no longer a subclass of NodeJS.EventEmitter.

@holoflows/kit 0.2.0

08 Apr 09:14
Compare
Choose a tag to compare

You can install it on npm now.

πŸ’₯ Breaking Changes

  1. The interface of AsyncCall has been fully re-written and it gets simpler and more documented now.
  2. ValueRef has also been fully re-written. Now it does not extend from Watcher and provides a clearer interface.

πŸ†• New

  1. 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.
  2. Add two undocumented utility sleep and timeout. Useful in async functions.
  3. AsyncCall now supports transferring metadata on parameters and return values (Not documented yet).

πŸ“ƒ Document

  1. Add the document for AsyncCall.

πŸ‘©β€πŸ’» Others

  1. Upgrade to Typescript 3.4.1.
  2. MessageCenter now uses '' instead of undefined as the default key. This is not a breaking change.
  3. We added CI! πŸ‘·β€β™€οΈ