Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Yomguithereal/baobab
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.3
Choose a base ref
...
head repository: Yomguithereal/baobab
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 17,546 additions and 3,261 deletions.
  1. +12 −0 .editorconfig
  2. +1 −0 .github/FUNDING.yml
  3. +4 −0 .gitignore
  4. +8 −0 .npmignore
  5. +6 −2 .travis.yml
  6. +150 −7 CHANGELOG.md
  7. +19 −0 CONTRIBUTING.md
  8. +1 −1 LICENSE.txt
  9. +572 −347 README.md
  10. +40 −0 benchmark.js
  11. +1 −1 bower.json
  12. +3,385 −0 build/baobab.js
  13. +9 −2 build/baobab.min.js
  14. +0 −22 defaults.js
  15. +8 −0 eslint.config.js
  16. +0 −50 gulpfile.js
  17. +0 −25 index.js
  18. +7,239 −0 package-lock.json
  19. +37 −18 package.json
  20. +9 −0 scripts/banner.tmpl
  21. +40 −0 scripts/build.js
  22. +5 −0 scripts/commonjs-addendum.js
  23. +3 −0 scripts/test-commonjs.js
  24. +3 −0 scripts/test-es6-import.js
  25. +204 −0 src/baobab.d.ts
  26. +531 −162 src/baobab.js
  27. +751 −288 src/cursor.js
  28. +0 −175 src/facet.js
  29. +476 −247 src/helpers.js
  30. +0 −80 src/merge.js
  31. +281 −0 src/monkey.js
  32. +215 −67 src/type.js
  33. +272 −126 src/update.js
  34. +147 −0 src/watcher.js
  35. +0 −9 test/endpoint.js
  36. +3 −0 test/register.js
  37. +13 −3 test/{state.js → state.ts}
  38. +0 −517 test/suites/baobab.js
  39. +581 −0 test/suites/baobab.ts
  40. +0 −700 test/suites/cursor.js
  41. +1,098 −0 test/suites/cursor.ts
  42. +0 −412 test/suites/helpers.js
  43. +306 −0 test/suites/helpers.ts
  44. +917 −0 test/suites/monkey.ts
  45. +166 −0 test/suites/watcher.ts
  46. +19 −0 test/utils.ts
  47. +6 −0 tsconfig.json
  48. +8 −0 tslint.json
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: Yomguithereal
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
node_modules
.DS_Store
TODO.md
benchmark.js
*.log
dist
.idea/
*.iml
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
node_modules
.DS_Store
.editorconfig
.gitignore
.npmignore
.travis.yml
test/
build/
gulpfile.js
benchmark.js
*.log
.eslintrc
.babelrc
TODO.md
bower.json
.idea/
*.iml
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
language: node_js
node_js:
- "node"
- "iojs"
- "8"
- "9"
- "10"
- "11"
- "12"
- "13"
157 changes: 150 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,151 @@
# Changelog

## v2.6.1

* Fixing prototype pollution issue ([@arjunshibu](https://github.com/arjunshibu)).

## v2.6.0

* Adding TypeScript declaration files.

## v2.5.3

* Refreshing the library's build to fix `babel` issues when consuming the library.

## v2.5.2

* Fixing the library's export.

## v2.5.1

* Fixing issue related to monkey not firing the correct events ([@roark](https://github.com/roark)).

## v2.5.0

* Adding the `monkeyBusiness` option ([@Tuhis](https://github.com/Tuhis)).

## v2.4.3

* Better `tree/cursor.splice` ([@jrust](https://github.com/jrust)).

## v2.4.2

* Fixing monkey-related memory leak ([@jrust](https://github.com/jrust)).

## v2.4.1

* Fixing `tree/cursor.splice` descriptor ([@Nimelrian](https://github.com/Nimelrian)).

## v2.4.0

* Handling non-enumerable properties ([@BrendanAnnable](https://github.com/BrendanAnnable)).

## v2.3.4

* Fixing an issue concerning objects created through `Object.create(null)` ([@fmal](https://github.com/fmal)).

## v2.3.3

* Fixing again an issue concerning merging an monkeys (thanks to [@abalmos](https://github.com/abalmos) and [@Zache](https://github.com/Zache)).

## v2.3.2

* Fixing issue concerning merging and monkeys.
* Fixing path coercion in monkeys' dependencies.

## v2.3.1

* Adding internal `tree.getMonkey`.
* Fixing issue concerning monkey's recursivity.
* Fixing a bug concerning setters & dynamic paths.

## v2.3.0

* Adding the `tree/cursor.clone` and the `tree/cursor.deepClone` methods.
* Adding the `tree/cursor.pop` and the `tree/cursor.shift` methods.
* Adding a way to disable a single monkey's immutability.
* Fixing an issue where the `tree.commit` method would fire a useless update.
* Fixing an issue related to updates and dynamic paths.
* Fixing the `tree/cursor.splice` to correctly handle negative indexes.
* Fixing a bug related to eager monkeys and immutability.

## v2.2.1

* Fixing a bug with watcher not able to handle path polymorphisms.

## v2.2.0

* Cursors are now ES6 iterables ([@kirjs](https://github.com/kirjs)).
* Dropping the `.babelrc` file from the npm build.

## v2.1.2

* Storing hashed paths using `λ` as delimiter instead of `/` to enable some edge cases ([@nivekmai](https://github.com/nivekmai)).
* Fixing an issue with cursors where a stopped history wouldn't restart correctly ([@nikvm](https://github.com/nikvm)).
* Fixing monkeys' laziness.
* Fixing an edge case when one watches over paths beneath monkeys.

## v2.1.1

* Fixing existence checking of `undefined` values.
* Fixing the `lazyMonkeys` option.
* Fixing the tree's behavior regarding ES6 collections ([@askmatey](https://github.com/askmatey)).
* Fixing the `splice` method ([@SaphuA](https://github.com/SaphuA)).

## v2.1.0

* Adding the `lazyMonkeys` option.
* Adding relative paths for monkeys' dependencies.

## v2.0.1

* Fixing monkeys' laziness ([@Zache](https://github.com/Zache)).
* Fixing issues related to the root cursor.
* Fixing `get` event edge cases.

## v2.0.0

* The tree is now immutable by default.
* Cursor's setters method won't return themselves but rather the affected node now.
* Adding `cursor.concat`.
* Adding `cursor.deepMerge`.
* Adding `cursor.serialize`.
* Adding `cursor.project`.
* Adding `cursor.exists`.
* Adding `tree.watch`.
* Adding the `pure` option.
* Changing the way you can define computed data in the tree, aka "facets". Facets are now to be defined within the tree itself, are called "monkeys", and can be accessed using the exact same API as normal data.
* Adding an alternative dynamic node definition syntax for convenience.
* Dropped the `syncwrite` option. The tree is now writing synchronously but still emits its updates asynchronously by default.
* Max number of records is now set to `Infinity` by default, meaning there is no limit.
* Update events are now exposing the detail of each transaction so you can replay them elsewhere.
* Fixing `cursor.push/unshift` behavior.
* Dropped the `$cursor` helper.
* Dropped the `update` specs for a simpler transaction syntax.
* Updated `emmett` to `3.1.1`.
* ES6 codebase rewrite.
* Full code self documentation.

## v1.1.1

* Updating `emmett` to `v3.0.1`.
* Adding missing setters methods to the tree.
* Fixing `cursor.root` method.

## v1.1.0

* Adding an `immutable` option to the tree.
* Adding a `syncwrite` option to the tree.
* Adding a `get` and `select` event to the tree.
* Facets getters are now applied within the tree's scope.
* `update` events are now exposing the related data for convenience.
* Fixing a `$cursor` related bug.
* Fixing `type.Primitive`.
* Fixing `facet.release` issues.

## v1.0.3

* Exposing `Cursor` and `Facet` classes for type checking (**@charlieschwabacher**).
* Exposing `Cursor` and `Facet` classes for type checking ([@charlieschwabacher](https://github.com/charlieschwabacher)).
* Fixing `type.Object`.
* Fixing root updates.

@@ -50,13 +193,13 @@

## v0.4.3

* Adding React mixins function polymorphisms thanks to **@denisw**.
* Fixing `cursor.chain` thanks to **@jonypawks**.
* Fixing transaction flow issues thanks to **@jmisterka**.
* Adding React mixins function polymorphisms thanks to [@denisw](https://github.com/denisw).
* Fixing `cursor.chain` thanks to [@jonypawks](https://github.com/jonypawks).
* Fixing transaction flow issues thanks to [@jmisterka](https://github.com/jmisterka).

## v0.4.2

* Fixing deep object comparison and dynamic paths matching thanks to **@angus-c**.
* Fixing deep object comparison and dynamic paths matching thanks to [@angus-c](https://github.com/angus-c).

## v0.4.1

@@ -80,8 +223,8 @@

## v0.3.2

* Bug fixes thanks to **@jacomyal**, **@jondot**.
* Better perfs thanks to **@christianalfoni**.
* Bug fixes thanks to [@jacomyal](https://github.com/jacomyal), [@jondot](https://github.com/jondot).
* Better perfs thanks to [@christianalfoni](https://github.com/christianalfoni).
* `release` method for the tree.

## v0.3.1
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Contributing to Baobab

Contributions are obviously welcome.

Be sure to add relevant unit tests, lint & build the code before submitting your pull request.

```bash
# Installing the dev environment
git clone git@github.com:Yomguithereal/baobab.git
cd baobab
npm install

# Running the tests
npm test

# Linting & building
npm run lint
npm run build
```
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2015 Guillaume Plique (Yomguithereal)
Copyright (c) 2014-2016 Guillaume Plique (Yomguithereal)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Loading