Skip to content

v4.0.0-beta.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@jakeboone02 jakeboone02 released this 23 Oct 01:10

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 and RuleGroup props now include path: number[], and id may be undefined.
  • getLevel has been removed from the schema prop.
  • The following functions that are part of the schema prop have been refactored to use path or parentPath instead of id or parentId: onGroupAdd, onGroupRemove, onPropChange, onRuleAdd, onRuleRemove.

External

These changes could potentially affect users that depend on certain features.

  • onAddRule and onAddGroup callbacks now pass a number[] (parentPath) as the second argument instead of a string (parentId).
  • The exported method findRule has been replaced by findPath, which is useful in conjunction with the previously mentioned, refactored onAddRule and onAddGroup callbacks.
  • The onQueryChange callback's argument, the current query object, will include a path for each rule and group. The formatQuery default output format, "json", will also include paths.
  • Rule and group divs now include a data-path attribute.

Features

Only one new feature in this release.

  • formatQuery accepts a new format 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 option paramPrefix is available in order to use a different character than the default ":" within the sql 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

v3.12.1...v4.0.0-beta.1