v4.0.0-beta.1
Pre-release
Pre-release
Breaking changes
This release introduces several small API changes, both internal and external, that warrant a major version bump.
Internal
These changes shouldn't affect most users.
Rule
andRuleGroup
props now includepath: number[]
, andid
may be undefined.getLevel
has been removed from theschema
prop.- The following functions that are part of the
schema
prop have been refactored to usepath
orparentPath
instead ofid
orparentId
:onGroupAdd
,onGroupRemove
,onPropChange
,onRuleAdd
,onRuleRemove
.
External
These changes could potentially affect users that depend on certain features.
onAddRule
andonAddGroup
callbacks now pass anumber[]
(parentPath
) as the second argument instead of astring
(parentId
).- The exported method
findRule
has been replaced byfindPath
, which is useful in conjunction with the previously mentioned, refactoredonAddRule
andonAddGroup
callbacks. - The
onQueryChange
callback's argument, the current query object, will include apath
for each rule and group. TheformatQuery
default output format, "json", will also includepath
s. - Rule and group
div
s now include adata-path
attribute.
Features
Only one new feature in this release.
formatQuery
accepts a newformat
type: "parameterized_named". This new format is similar to "parameterized", but instead of anonymous?
-style bind variables, each parameter is given a unique name based on the field name and the order in the query. A corresponding optionparamPrefix
is available in order to use a different character than the default ":" within thesql
string.
Commits
- Simplify code by removing _.clone and replacing _.uniqWith with _.uniqBy e018c5e
- Merge pull request #229 from react-querybuilder/path-based-ids 9812556
- Default to "json_without_ids" output format in demo d1ecdff
- Prettified code f1dcd98
- Add parameterized_named output format 7938867
- Fixed bug with key prop in RuleGroup 5e4508f
- Updated some variable names in formatQuery.test.ts 6a49d29
- Changed build command from dist to build b5fbbcd
- Converted to path-based query management from ID-based 88913e7
- Remove unnecessary dependencies 64765b0
- Merge pull request #228 from react-querybuilder/add-codesandbox-ci 62c5d99
- Specify buildCommand in CodeSandbox CI 39239d5
- Specify node version in CodeSandbox CI 2ea1840
- Add CodeSandbox CI c99f0e0
- Merge pull request #227 from react-querybuilder/syntax-highlight-demo f3bc058
- Fix demo webpack config after adding react-syntax-highlighter 20fd951
- Add syntax highlighting to the demo 6a77f54
- Fix pre line wrapping in demo f105da3
- Allow line wrapping in demo pre tag a5931f6
- Add fallbackExpression option for formatQuery d65c05e
- Update README.md with link to wiki fe76990
- Formalize the ParameterizedSQL interface f985f53