Skip to content

Commit

Permalink
1.0.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed May 14, 2020
1 parent d0aeb4d commit ae8069b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
30 changes: 15 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
## next
## 1.0.0-beta.1 (May 14, 2020)

- Fixed `~=` operator to produce a boolean result only
- Added `[...expr]` syntax
- Allowed numbers without integer part, i.e. `.123` or `.5e-4`
- Allowed numbers and literals as property name in object literals, i.e. `{ 1: 'ok', null: 'ok' }`
- Fixed suggestion in empty function body for new syntax, i.e. `group(=>)` will suggest between `=>` and `)`
- Added `$$` root reference (`arg1`), which refers to second parameter of closest function or `undefined` when no such
- Added `reduce()` method
- Changed `pick()` method:
- Added support for methods as a reference to definition's value, i.e. `$method: => 123; $method() or path.$method()`
- Added `walk()` method to traverse AST
- Allowed numbers without integer part, i.e. `.123` or `.5e-4`
- Allowed numbers and literals as property name in object literals, i.e. `{ 1: 'ok', null: 'ok' }`
- Changed `=` and `!=` operators to use `Object.is()` instead of `===` and `!==` operators
- Changed behaviour for references to undefined definitions, now an exception raises in default mode, but no exceptions in tolerant mode
- Changed array-like access notation (i.e. `foo[expr]`) to behave like `pick()` method
- Reworked `pick()` method:
- Return first entry value when no argument gived
- String values are treat as an array
- Added support for negative indicies for array and strings
- Return a value for object and function as reference, instead of entry
- Pass index or key to function reference as second parameter (can be accessed by `$$`)
- When no arguments given or reference is `undefined` for object, return first entry value instead of value with key `undefined`
- Cast boolean values to a number index when access to an array or string, i.e. `false` -> `0` and `true` -> `1`
- Changed array-like access notation (i.e. `foo[expr]`) to behave like `pick()` method
- Improved tolerant mode to not fail on methods that doesn't exists, such invocations silently returns `undefined`
- Improved parse and some compile errors
- Fixed suggestion in empty function body for new syntax, i.e. `group(=>)` will suggest between `=>` and `)`
- Fixed `~=` operator to produce a boolean result only
- Removed `mapToArray()` method, use `entries().({ nameProp: key, ...value })` instead
- Grand internal refactoring around AST processing:
- Added `walk()` method
- Parser generates less virtual nodes, so parse->stringify is much closer to original code (white spaces and comments mostly lost)
- Suggestion subsystem is moved from parser to separate module which is using in stat mode only
- Suggestion subsystem moved aside from parser to a separate module which uses in stat mode only
- Various fixes and improvements in suggestions
- The new approach allows to implement more complex suggestion scenarios like suggestions in array values for operators `in`, `not in`, `has` and `has no` which was added (e.g. in query `["a", "b", 1, 2][$ in ["b", 2]]` jora will suggest only `"a"` and `1` values in array after `in` operator)
- Changed `=` and `!=` operators to use `Object.is()` instead of `===` and `!==` operators
- Added support for methods as a reference to definition's value, i.e. `$method: => 123; $method() or path.$method()`
- Changed behaviour for references to undefined definitions, now an exception raises in default mode, but no exceptions in tolerant mode
- Improved tolerant mode to not fail on methods that doesn't exists, such invocations silently returns `undefined`
- Removed `mapToArray()` method, use `entries().({ nameProp: key, ...value })` instead
- Improved parse and some compile errors

## 1.0.0-alpha.13 (January 6, 2020)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2019 Roman Dvornov <[email protected]>
Copyright (c) 2018-2020 Roman Dvornov <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

JavaScript object query engine

> STATUS: A proof of concept. Syntax may change in next releases.
> STATUS: Jora is still very much work in progress. Syntax may change in next releases.
Features:

Expand All @@ -24,8 +24,8 @@ Related projects:

- [jora-cli](https://github.com/discoveryjs/jora-cli) – Command line interface for Jora
- [Jora sandbox](https://discoveryjs.github.io/jora-sandbox/) – A Web interface where you can play with jora syntax or transform some JSON with zero setup
- [Discovery](https://github.com/discoveryjs/discovery)Hackable JSON discovery tool. Uses jora to query a data for views
- [JsonDiscovery](https://github.com/discoveryjs/browser-extension-json-discovery) – a browser’s extension for viewing JSON built on Discovery, available for [Chrome](https://chrome.google.com/webstore/detail/jsondiscovery/pamhglogfolfbmlpnenhpeholpnlcclo) and [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/jsondiscovery/) (read more in the article [Changing a way we’re viewing JSON in a browser](https://medium.com/@rdvornov/changing-a-way-were-viewing-json-in-a-browser-51eda9103fa2))
- [Discovery](https://github.com/discoveryjs/discovery) – Uses jora to query a data for views
- [JsonDiscovery](https://github.com/discoveryjs/browser-extension-json-discovery) – a browser’s extension for viewing JSON based on Discovery, available for [Chrome](https://chrome.google.com/webstore/detail/jsondiscovery/pamhglogfolfbmlpnenhpeholpnlcclo) and [Firefox](https://addons.mozilla.org/en-GB/firefox/addon/jsondiscovery/) (read more in the article [Changing a way we’re viewing JSON in a browser](https://medium.com/@rdvornov/changing-a-way-were-viewing-json-in-a-browser-51eda9103fa2))

TODO:

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jora",
"version": "1.0.0-alpha.13",
"version": "1.0.0-beta.1",
"description": "JavaScript object query engine",
"author": "Roman Dvornov <[email protected]> (https://github.com/lahmatiy)",
"repository": "discoveryjs/jora",
Expand Down

0 comments on commit ae8069b

Please sign in to comment.