All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.
1.14.0 (2024-11-04)
- add array intersects function (ced9e90)
- can extract attribute key from Group (46ba490)
- typeEvaluator: implement proper support for defined in filters (d319f1c)
- upgrade groq-test-suite version to v0.1.46 (a71e3ec)
- functions: fix typo mapConcrete to mapNode (7f57a91)
1.13.0 (2024-08-26)
- add new GROQ function sanity::documentsOf (c086187)
- typeEvaluator: do not let unknown always resolve to unknown (41679a3)
- typeEvaluator: remove resolve condition, use walk to determine conditions (38ca510)
1.12.0 (2024-07-26)
- typeEvaluator: add support for global::dateTime (8ed40ea)
- typeEvaluator: add support for global::length (a244bdc)
1.11.1 (2024-07-25)
- typeEvaluator: fix bug when splatting over optional attributes (92d2449)
1.11.0 (2024-07-23)
- add support for sanity::versionOf() (fb2f5d0)
- add type evaluator for sanity::versionOf() (db54be4)
- typeEvaluator: validate if arg to sanity::versionOf is string (0f4d047)
1.10.0 (2024-07-02)
- typeEvaluate: preserve value when casting string upper/lower case (fc189a0)
- typeEvaluator: add support for array functions (86b1053)
- typeEvaluator: add support for dateTime::now() (9ad8200)
- typeEvaluator: add support for global::now() (d8cf2d9)
- typeEvaluator: add support for round() (641ecc6)
- typeEvaluator: add support for upper() and lower() (0934a3c)
- typeEvaluator: expand all unions inside a object (1a5106d)
- typeEvaluator: bail early if splatting over a non-union/object (117ec01)
- typeEvaluator: handle access{attribute,element) when resolving conditions (313369c)
- typeEvaluator: handle not nodes when resolving conditions (c940472)
- typeEvaluator: handle rest on object splat operations (2ce28eb)
- typeEvaluator: make sure we are not inside a hidden scope when resolving parent nodes (f109098)
- typeEvaluator: map over concrete values and return them as alternatives (f3adc53)
- typeEvaluator: move object splat into separate methods to ensure conrete mapping (8f1a8d9)
- typeEvaluator: properly handle object splats with non-concrete types (97aee3e)
- typeEvaluator: return undefined by default when resolving condition (bfb3d5e)
1.9.0 (2024-05-14)
- typeEvaluator: add support for global::references (af958db)
- typeEvaluator: add support for string::split (dd823dd)
- typeEvaluator: add support for string::startsWith (6b51180)
- typeEvaluator: update hash group to capture start/end (531fe81)
1.8.0 (2024-04-24)
- typeEvaluation: add support for global::string (133d8af)
- typeEvaluator: add support for count (49e05c7)
- loosen strictness for equality with unions (04b4b36)
- typeEvaluation: map over unions to support filtering null-unions (6ad2398)
- types: use the strictest tsconfig preset (#222) (8a83812)
1.7.0 (2024-04-02)
- typeEvaluation: let optional resolved condition be evaulated (91ef6b5)
1.6.1 (2024-04-02)
1.6.0 (2024-04-02)
- type-evaluation: add support for Pos and Neg nodes (bef4ad5)
Exports
should beexports
(5cea533)- deps: bump
@sanity/pkg-utils
tov5.1.5
(d2e8f6c) - remove legacy
typings
field, astypes
is already used (7c05d5e) - test ecospark push override (1e4b895)
1.5.0 (2024-03-19)
- access optinal attributes should return null (8e3f7e4)
- add support for slice in type evaluator (7877990)
- add tsdoc to describe the type nodes (65cbc41)
- add type evaluator (637603b)
- evaluateQueryType: add more tests (#180) (5d2528e)
- export type evaluation with version 1 (62c6b7f)
- only export typeEvaluate function (e3e3875)
- replace esbuild with tsx. fixes linenumber (8a60c87)
- typeEvaluator: rename main function to
typeEvaluate
(9c2f345)
- dont access attributes inside arrays (0e267bc)
- dont stringify objects, let debug/util handle it (bb7d646)
- forward type on map unexpected (8131a71)
- handle flatmap over unions correctly (70dc0c3)
- order unions (5a940e0)
- query node type eval tests (522bd9b)
- recursively lookup attributes in object rest (fecc1a1)
- refactor and reuse scope handling from evaluator (7bed827)
- remove un-evaluated Slice-case (349645b)
- typeEvaluate: resolve inline when mapping type (7a3742c)
- update snapshots (0860eaf)
- various type evaluation bugs (3da42d7)
1.4.3 (2024-02-21)
1.4.2 (2024-02-21)
1.4.1 (2024-01-25)
1.4.0 (2024-01-18)
- export Path class (c7a8a46)
1.3.0 (2023-09-08)
- export
DateTime
class (fixes #144) (4d4e397) - expose
namespace
on FuncCall node (fixes #145) (ea77e7e) - implement dateTime namespace (fixes #143) (932b2bc)
1.2.0 (2023-08-23)
1.1.12 (2023-08-10)
- handle parenthesis directly inside filters (abe94a9)
1.1.11 (2023-08-07)
- add
node.module
condition for bundlers (67365ac)
1.1.10 (2023-08-04)
1.1.9 (2023-04-13)
- package.json: add
repository
field (3638394)
1.1.8 (2023-03-06)
1.1.7 (2023-02-14)
- use pkg-utils to generate JS and typings (195352f)
1.1.6 (2023-01-18)
- namespaced functions should consume any whitespace before function arguments (481e88d)
1.1.5 (2023-01-12)
- add API.md to npm publish (e92bb78)
1.1.4 (2023-01-12)
- add pkg keywords (8f6fdad)
1.1.3 (2023-01-12)
- docs: add pnpm example (98010d2)
1.1.2 (2023-01-12)
- add
sideEffects: false
for better tree-shaking (77b3366) - setup release automation (f676dff)
- support
swcMinify
in NextJS 13 (9beabc1)
New features:
- Implement
array::unique()
- Implement aggregation functions on the
math
namespace:min()
max()
sum()
avg()
- Implement functions on the
string
namespace:startsWith()
split()
- Implement functions on the
array
namespace:join()
compact()
- Introduce support for using specific GROQ versions
- Introduce validation for selector syntax
Tooling changes:
- Support local test via
$GROQTEST_SUITE
Bug fixes
- Correctly accept function calls with trailing commas:
select(123,)
. - Correctly parse object expressions which start with literal strings (e.g.
{"mail" == … => …}
). - Correctly accept comments with no text (
//
on a single line).
Bug fixes:
- Fix error
ReferenceError: marks is not defined
which happened while parsing strings in strict mode.
New features:
- Support specifying
now()
andidentity()
during evaluation. - Support for validating Delta GROQ.
Backwards compatible API changes:
- Introduce
params
andmode
option onparse
. - Introduce
before
andafter
option onevaluate
. - The main file is now an UMD file usable in the browser, exported under
groqJS
.
Private changes:
- Rewrite parser, optimizing for performance.
Tooling changes:
- Use Vite and esbuild instead of TSDX.
- Switch completely over from Jest to Tap for running test.
API changes:
- Introduce
params
parameter onparse
which is required to properly parse an expression (@judofyr)
GROQ compatibility fixes:
- Preserve nulls in objects (@judofyr, #36)
- Add support for arrays in
length
(@judofyr) - Use stable sorting in
order
(@judofyr) - Implement
string
function (@judofyr, @israelroldan) - Add support for arrays in
references
(@judofyr) - Implement
dateTime
(@judofyr) - Implement proper array traversal (@judofyr)
- Implement
score
function (@judofyr) - Implement namespaced functions (@judofyr)
- Implement
lower
andupper
(@judofyr) - Implement
pt::text
(@judofyr) - Improve
match
behavior (@judofyr)
Private changes:
- Simplify and restructure AST (@judofyr)
- Split up
SyntaxNode
into a specialExprNode
represent what's returned fromparse
(@judofyr)
Tooling changes:
- Use
tap
for running tests since Jest is too slow (@judofyr)
- Require native generators (@rexxars)
- Support concatenation of arrays (@rexxars)
- Correctly fail on invalid asc/desc (@judofyr)
- Projection should not be mapped inside traversals (@judofyr)
- getType: Detect Pair correctly (@judofyr)
- Add support for object merging (@judofyr)
- Improve match semantics (@judofyr)
- Fix ESM build (@rexxars)
- Upgrade dependencies (@rexxars)
- Fix build so that it includes rawParser (@judofyr)
- Work around bug in babel-plugin-transform-async-to-promises (@judofyr)
- Migrate to TypeScript (#18, @rexxars, @judofyr)
- Update semantics to work with latest GROQ spec
- Add LICENSE.md
- Add
license
-field in package.json - Fix crash during dereferencing when the dataset is non-array
- Implement
now()
function (#16, @rexxars)
- Add custom syntax error object (#10, @asbjornh)
- Implement
path()
function (#7)
- Add support for parameters (#6)
- Add support for escape sequences in string literals
- Big rewrite with much improved support
- Initial hacky version