- Supports
immutable 4.0.0-rc.*
- In order to support multiple versions, ImmutableJS is now only listed as peer dependency.
- API changes:
- Introduce new method
walk
.
- Introduce new method
- Test setup for multiple versions.
- Docs updated.
- Dependencies updated.
- API changes:
- Introduce new method
depth
.
- Introduce new method
- Minor fixes in docs.
- Dependencies updated.
- Remove
for...of
loop innodes
method. Fixes #10.
This is mainly a backport to good old ES5 in order to definitely get rid of Babel et al. The reasoning behind this is, that 90% of the maintenance work I did on this library was somehow related to runtime environments that the Babel build of TreeUtils was incompatible with.
In 0.1.11 I tried to just enforce a modern enough Node version to keep the generators but this enforced people to manually add TreeUtils to a list of should-get-transpiled node modules in order to support older runtimes through let's say Webpack. And that is really not an option.
In the end and given the fact that TreeUtils is actually a very small and single-minded piece of software that doesn't really need the fancy new stuff, it seemed to be more reasonable to take the code back to the least common denominator (Node 0.12, VERY old browsers) than hassling my way through transpiler/build chain hell.
I want to apologize for the messed up 0.1.11 release and hope TreeUtils still works for you.
The tree method nodes
returns an Immutable.List instead of an Iterator.
So instead of
for (let keyPath of utils.nodes(state)) {
// ...
}
you would
utils.nodes(state).forEach(keyPath => {
// ...
})
Other changes:
- Backport to ES5: source, tests and scripts.
- No longer enforce a Node version.
- Requires Node >= 6 or any environment that supports ES6, especially generators.
- Removed dependencies on all Babel and ESLint related packages and config files.
- File structure flattened.
- Docs: Removed hint regarding the generators issue, removed the babel reference.
- Dependencies updated.
- Docs updated.
- API changes: - TreeUtils constructor accepts a
none
parameter to customize the result of queries with no results. - ESLint rules changed to a somehow customized version of the well-established AirBnB ruleset.
- Code base refactored according to the new linting rules.
- Build tests refactored to ES5.
- Dependencies updated.
- Support default export in pre-ES2015 environments courtesy of Jürgen Schlieber.
- Dependencies updated.
- Fix several documentation typos and errors (npm install command 😊) courtesy of Jürgen Schlieber and Love Luang.
- Comparator functions used with find or filter receive the key path to the current node as second parameter courtesy of Jürgen Schlieber.
- Fix test script to conform jasmine-spec-reporters new module structure.
- Dependencies updated.
- Docs: Fix typos and source links.
- Dependencies updated.
- All methods that need to evaluate whether a value exists or not check not only for
undefined
but fornull
as well now. Some methods were broken if you e.g. were usingnull
as default value on Record definitions, which by some people is considered best practise.
- Dependencies updated. Added tests for the transpiled source (trivial).
- Minor fixes in API docs. Updated dependencies.
- Migration to Babel 6 courtesy of Kei Takashima.
- README hint to use environment with generators enabled courtesy of Emanuele Ingrosso.
- Further updated dependencies, most notably ImmutableJS.
- Added estraverse-fb to devDependencies (eslint/eslint#5476).