Skip to content

Releases: unchartedsoftware/lex

Release 0.17.4

14 May 21:05
1884789
Compare
Choose a tag to compare
Release 0.17.4 Pre-release
Pre-release

Fix for #342

Release 0.17.3

09 May 14:23
b481038
Compare
Choose a tag to compare
Release 0.17.3 Pre-release
Pre-release
  • Added configurable hook to OptionState for transforming a user-created OptionStateOption on creation (e.g. as a means of adding metadata). See config.onUnknownOption in OptionState and #336 for details.
  • Fix for #337

Release 0.17.2

04 May 20:45
b991b54
Compare
Choose a tag to compare
Release 0.17.2 Pre-release
Pre-release

Fixes for #330 and #333, which make the lex binary significantly smaller, and the codebase more readable.

No API changes.

Release 0.17.1

01 May 22:10
1add97e
Compare
Choose a tag to compare
Release 0.17.1 Pre-release
Pre-release

Addition of hooks for the acceptance and rejection of suggestion tokens to Lex configuration. If supplied, these hooks allow for app functionality to take place when these events occur, the transformation of suggestions before acceptance, or even the complete blocking of Lex's internal suggestion-add/remove handling in favour of your own (via setQuery and setSuggestions).

See the documentation of the Lex component for more details:

* @param {function | undefined} config.onAcceptSuggestion - A callback called when the user presses "add" on a suggestion. A no-op by default (`(s, idx) => s`) but, if supplied, can be used to transform the incoming boxed suggestion, perform additional actions, etc. Return `null` to stop Lex from updating suggestions and query automatically, or return the suggestion (or a transformed version) to allow Lex to handle the rest.
* @param {function | undefined} config.onRejectSuggestion - A callback called when the user presses "x" on a suggestion. A no-op by default (`(s, idx) => true`) but, if supplied, can be used to perform additional actions or stop Lex from auto-updating the suggestions and query (by returning `false`)

Release 0.17.0

01 May 17:22
72e9526
Compare
Choose a tag to compare
Release 0.17.0 Pre-release
Pre-release

Refactors to State and StateTemplate to improve performance, stability and API flexibility going forward.

All existing State types now extend State directly, rather than StateTemplate, and StateTemplate is thus no longer exported by the library.

No refactoring of the search language in existing applications is required, but the following minor changes (basically find/replace) to custom Builders and Assistants are necessary:

  • any custom States created will need to extend State instead of StateTemplate.
  • any reference to machineStateTemplate in a custom Builder or Assistant should be changed to machineState.
  • any reference to machineState.template in a custom Builder or Assistant should be removed and replaced with machineState (or this.state.machine.state.template -> this.state.machine.state). A find replace for .template -> '' should be sufficient.
  • Any custom logic for fetching options in an OptionState that used the third archive parameter should replace this parameter with an in-method reference to this.archive, as the State's value and archive are now directly accessible in the scope of the option-fetching function.

Release 0.16.3

30 Apr 17:36
4de360d
Compare
Choose a tag to compare
Release 0.16.3 Pre-release
Pre-release

Temporary fix for #321. Performance problems will be addressed in the next release.

Release 0.16.2

29 Apr 23:25
bd6d27c
Compare
Choose a tag to compare
Release 0.16.2 Pre-release
Pre-release

Improving error messages for OptionState initialization.

Release 0.16.1

28 Apr 04:04
7ea5719
Compare
Choose a tag to compare
Release 0.16.1 Pre-release
Pre-release

Fix for #319

Release 0.16.0

27 Apr 20:37
1620a39
Compare
Choose a tag to compare
Release 0.16.0 Pre-release
Pre-release
  • Major performance improvements to OptionState via #302 and #304
  • An API-breaking change which is a consequence of these improvements is that OptionStates which fetch async options need to supply an additional configuration parameter config.fetchOptions which is a function which, given a list of specific values, can fetch their corresponding OptionStateOptions for validation purposes. This is distinct from the config.options function, which fetches suggestions.

Updating to 0.16.0 will require the addition of a config.fetchOptions parameter to ALL async OptionStates.

Release 0.15.3

24 Apr 17:49
77e0b44
Compare
Choose a tag to compare
Release 0.15.3 Pre-release
Pre-release

Fix for #299