Skip to content

Commit

Permalink
issue #77: ci refact (#78)
Browse files Browse the repository at this point in the history
* issue #77: ci refact

* issue #77: ci refact

* issue #77: ci refact

* issue #77: ci refact

* issue #77: prepare for release
  • Loading branch information
gullerya committed Apr 23, 2021
1 parent 9753cf6 commit 466307e
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 98 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Prepare 'object-observer' release
name: Trigger 'object-observer' release

on:
push:
tags:
- release
workflow_dispatch:
inputs:
version:
description: 'Version to bump to'
required: false

jobs:
prepare-verify:
prepare-verify-trigger:
runs-on: ubuntu-18.04

steps:
Expand All @@ -15,9 +17,6 @@ jobs:
with:
token: ${{ secrets.OO_CI_AT }}

- name: Delete temporary trigger tag
run: git push origin --delete release

- name: Setup NodeJS 14
uses: actions/setup-node@v2
with:
Expand All @@ -26,6 +25,10 @@ jobs:
- name: Install NPM
run: npm install

# Bump version
- name: Bump to target version, if any
if: ${{ github.event.inputs.version }}
run: npm run bump -- --version=${{ github.event.inputs.version }}
- name: Bump release version
run: |
npm run bump -- --release
Expand Down
11 changes: 10 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.2.1] - 2021-03-15
## [4.2.2] - 2021-04-23
### Added
- [Issue no. 77](https://github.com/gullerya/object-observer/issues/77) - manual CI trigger for release
### Changed
- documentation improved and updated
- dependencies updated

## [4.2.1] - 2021-03-15
### Added
- [Issue no. 73](https://github.com/gullerya/object-observer/issues/73) - added DOM-like API of `ObjectObserver`
### Changed
- documentation improved and updated
- dependencies updated

## [4.1.3] - 2021-02-01
### Added
Expand Down
92 changes: 56 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
"bump": "node ./ci/tools/version-utils.js"
},
"devDependencies": {
"eslint": "^7.22.0",
"eslint": "^7.24.0",
"fs-extra": "^9.1.0",
"just-test": "2.3.2",
"puppeteer": "^8.0.0",
"puppeteer": "^9.0.0",
"uglify-es": "^3.3.9"
}
}
80 changes: 29 additions & 51 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,49 @@
[![Codecov](https://img.shields.io/codecov/c/github/gullerya/object-observer/main.svg)](https://codecov.io/gh/gullerya/object-observer/branch/main)
[![Codacy](https://img.shields.io/codacy/grade/a3879d7077eb4eef83a591733ad7c579.svg?logo=codacy)](https://www.codacy.com/app/gullerya/object-observer)

# Summary
# `object-observer`

__`object-observer`__ provides a deep observation of a changes performed on an object/array graph.

Main aspects and features:

* implemented via native __Proxy__ (revokable)

* observation is 'deep', yielding changes from a __sub-graphs__ too

* nested objects of the observable graph are observables too

* changes delivered in a __synchronous__ way by default, __asynchronous__ delivery (experimental) is optionally available as per `Observable` configuration; [more details here](docs/sync-async.md)

* observed path may optionally be filtered as per `observer` configuration; [more details here](docs/filter-paths.md)

* original objects are __cloned__ while turned into `Observable`s

* __array__ specifics:
* generic object-like mutations supported
* intrinsic `Array` mutation methods supported: `pop`, `push`, `shift`, `unshift`, `reverse`, `sort`, `fill`, `splice`, `copyWithin`
* massive mutations delivered in a single callback, usually having an array of an atomic changes

* __typed array__ specifics:
* generic object-like mutations supported
* intrinsic `TypedArray` mutation methods supported: `reverse`, `sort`, `fill`, `set`, `copyWithin`
* massive mutations delivered in a single callback, usually having an array of an atomic changes

* intrinsic mutation methods of `Map`, `WeakMap`, `Set`, `WeakSet` (`set`, `delete`) etc __are not__ observed (see this [issue](https://github.com/gullerya/object-observer/issues/1) for more details)

* following host objects (and their extensions) are __skipped__ from cloning / turning into observables: `Date`, `Blob`, `Error`
- implemented via native __Proxy__ (revokable)
- observation is 'deep', yielding changes from a __sub-graphs__ too
- nested objects of the observable graph are observables too
- changes delivered in a __synchronous__ way by default, __asynchronous__ delivery is optionally available as per `Observable` configuration; [more details here](docs/sync-async.md)
- observed path may optionally be filtered as per `observer` configuration; [more details here](docs/filter-paths.md)
- original objects are __cloned__ while turned into `Observable`s
- __array__ specifics:
- generic object-like mutations supported
- intrinsic `Array` mutation methods supported: `pop`, `push`, `shift`, `unshift`, `reverse`, `sort`, `fill`, `splice`, `copyWithin`
- massive mutations delivered in a single callback, usually having an array of an atomic changes
- __typed array__ specifics:
- generic object-like mutations supported
- intrinsic `TypedArray` mutation methods supported: `reverse`, `sort`, `fill`, `set`, `copyWithin`
- massive mutations delivered in a single callback, usually having an array of an atomic changes
- intrinsic mutation methods of `Map`, `WeakMap`, `Set`, `WeakSet` (`set`, `delete`) etc __are not__ observed (see this [issue](https://github.com/gullerya/object-observer/issues/1) for more details)
- following host objects (and their extensions) are __skipped__ from cloning / turning into observables: `Date`, `Blob`, `Error`

#### Support matrix: ![CHROME](docs/browser-icons/chrome.png)<sub>61+</sub> | ![FIREFOX](docs/browser-icons/firefox.png)<sub>60+</sub> | ![EDGE](docs/browser-icons/edge.png)<sub>16+</sub> | ![NODE JS](docs/browser-icons/nodejs.png) <sub>8.10.0+</sub>

#### Performance report can be found [here](docs/performance-report.md)

#### Last versions (full changelog is [here](docs/changelog.md))

- __4.2.1__
- documentation improved and updated
- dependencies updated
- [Issue no. 73](https://github.com/gullerya/object-observer/issues/73) - added DOM-like API of `ObjectObserver`
#### Changelog is [here](docs/changelog.md)

- __4.1.3__
- implemented [Issue no. 71](https://github.com/gullerya/object-observer/issues/71) - added CDN deployment

- __4.1.1__
- [Issue no. 70](https://github.com/gullerya/object-observer/issues/70) - automated version bump
- unified `Change` object structure (so that it is always the same shape)
- improved perf tests
## Preview

For a preview/playground you are welcome to:
- [CodePen](https://codepen.io/gullerya/pen/zYrGMNB)
- [JSFiddle](https://jsfiddle.net/gullerya/5a4tyoqs/latest)

## Install

Use regular `npm install object-observer --save-prod` to use the library from your local environment.
Use regular `npm install object-observer --save-prod` to use the library from your local environment:
```js
import { Observable } from 'node_modules/object-observer/dist/object-observer.min.js';
```

Additionally, a __CDN__ deployment available (AWS driven), so one can import it directly:
Alternatively, a __CDN__ deployment available (AWS driven), so one can import it directly:
```js
import { Observable } from 'https://libs.gullerya.com/object-observer/x.y.z/object-observer.min.js';
```
Expand All @@ -76,20 +59,15 @@ CDN features:
- highly available (with many geo spread edges)
- agressive caching setup

Import `object-observer` as __ES6 module__:
```js
import { Observable } from 'object-observer.min.js';
```

## API

Library implements `Observable` API as it is defined [here](docs/observable.md).

Additionally, from version 4.2.0 there is also 'DOM-like' API flavor, a one that resonating with DOM's `MutationObserver`, `ResizeObserver` etc from the syntax perspective.
Additionally, from version 4.2.0 there is also 'DOM-like' API flavor, a one that is resonating with DOM's `MutationObserver`, `ResizeObserver` etc from the syntax perspective.
Under the hood it uses the same `Observable` mechanics.
Read docs about this API flavor [here](docs/dom-like-api.md).

> This is __experimental__ API until specified here otherwise.
> This is __experimental__ API until specified otherwise.
## Security

Expand All @@ -101,7 +79,7 @@ Security policy is described [here](https://github.com/gullerya/object-observer/

```javascript
const
order = { type: 'book', pid: 102, ammount: 5, remark: 'remove me' },
order = { type: 'book', pid: 102, ammount: 5, remark: 'remove me' },
observableOrder = Observable.from(order);

observableOrder.observe(changes => {
Expand Down Expand Up @@ -130,8 +108,8 @@ delete observableOrder.remark;
// { type: "delete", path: ['remark'], oldValue: 'remove me', object: observableOrder }

Object.assign(observableOrder, { amount: 1, remark: 'less is more' }, { async: true });
// - by default the changes below would be delivered in a separate callback
// - due to async use, they are delivered as a batch in a single callback
// - by default the changes below would be delivered in a separate callback
// - due to async use, they are delivered as a batch in a single callback
// { type: 'update', path: ['ammount'], value: 1, oldValue: 7, object: observableOrder }
// { type: 'insert', path: ['remark'], value: 'less is more', object: observableOrder }
```
Expand Down

0 comments on commit 466307e

Please sign in to comment.