Skip to content

Releases: discoveryjs/discovery

1.0.0-beta.80

21 Jan 18:21
Compare
Choose a tag to compare
  • Fixed the highlighting of Jora assertions when the assertion is the same as a literal keyword
  • Fixed updating of an expanded query output in query editor
  • Fixed the issue with displaying popups using showDelay when the pointer moves over nested trigger elements before coming to a stop
  • Improved view inspecting of popups
  • Bumped jora to 1.0.0-beta.10

1.0.0-beta.79 Query graph, reworked query editor

30 Oct 02:06
Compare
Choose a tag to compare
  • Reworked report page to support query graph and other improvements
  • Uniformed font and size for monospace views
  • Enlarged action buttons in struct and signature views
  • Improved UX for signature popup displaying in struct view
  • Changed rendering of after-annotations to render in a prelude when a value is expanded
  • Changed default rendering of arrays in a table cell to display number of array elements instead of […]
  • Added separate colors for keywords and assertions in a query editor
  • Added a 3-second delay for enabling view inspect mode when the "inspect" button is clicked with the Cmd (⌘) or Ctrl key (useful for tooltips, context menus etc.)
  • Added Widget#view.attachTooltip(el, config, data, context) method
  • Added Popup#showDelay option to control the behavior of popup appearance. The option specifies the delay in milliseconds after the pointer stops moving over a trigger before the popup is displayed. By default, there is no delay. When set to true, the default delay of 300 milliseconds is applied. If a positive number is provided, it is used as the delay, while other values are treated as 0, resulting in an immediate show.
  • Added third parameter for Popup#show() method, when set to a truthy value it specifies to bypass show delay if any
  • Removed Popup#options in favor of properties
  • Fixed editor to not render text until gets focus
  • Fixed suggestion popup positioning in query editor in some cases
  • Modified Widget to utilize deep comparison for page params, ensuring more accurate detection of changes
  • Fixed query editor to not suggest a variant which exactly equals to current text
  • Fixed Widget#log() method where it would crash when attempting to output a single collapsed error
  • Added "Copy report as page hash" button
  • Fixed "Copy report permalink" button being always disabled
  • Fixed defaultPage option to have no effect
  • Bumped jora to 1.0.0-beta.9

1.0.0-beta.78

22 Sep 01:22
Compare
Choose a tag to compare
  • Bumped jora to 1.0.0-beta.8: assertions and dozens of new methods
  • Tweaked error output on app & data loading

1.0.0-beta.77

28 Jul 01:39
Compare
Choose a tag to compare
  • Exposed createLoadDataState() method as utils
  • Introduced internal logging subsystem:
    • Added Widget#log() method
    • Added logLevel option for Widget and App. Supported values: silent, error, warn, info, perf (default) and debug. To disable any logging set logLevel to silent
    • Added logger option (default to console) to override an interface for a logging. Setting to falsy value will disable any logging
  • Fixed displaying "Empty list" in view showcase when a view has no examples
  • Fixed calling onFinish() callback on Progressbar getting an error
  • Fixed an exception on unsubscribing from progressbar state sync on loading data error
  • Fixed "uncaught error in promise" on data load failure in preloader
  • Removed deprecated option title in expand view config
  • Removed warning on definition resolveLink() method in page config

1.0.0-beta.76

10 Jul 16:27
Compare
Choose a tag to compare
  • Added limitCompactObjectEntries and maxPropertyLength options to struct view
  • Added prelude and postlude slots (new options in config) for source view
  • Added sectionPrelude and sectionPostlude for markdown view to define view config to render in the beggining of the section (right after a header) or in the end of the section (before next header or end of source)
  • Added codeConfig option for markdown view to specify a config for code block rendering
  • Removed codeActionButtons option for markdown view, use codeCofig.actionButtons instead
  • Changed markup of source view:
    • Wrapped action-buttons, lines and source blocks into view-source__content block
    • Added view-source__ prefix for class names of action-buttons, lines and source blocks
    • Added auto scrolling for source view content when size of source block is restricted
    • Fixed positioning for actions block when content overflows
  • Improved styles of the expanded section line in struct view to no longer rely on paddings used
  • Fixed rendering of truncated urls in struct view
  • Fixed table view rendering when a column content defined as a view shorthand with config, e.g. view{ prop: 1 }
  • Fixed context value for beforeDemo, demo and afterDemo sections in usage render

1.0.0-beta.75

27 Jun 22:48
Compare
Choose a tag to compare
  • Added .jsonxl to list of default extensions for upload
  • Improved markdown syntax highlighting in source view
  • Added "Copy to clipboard" button to source view
  • Added actionButtons option for source view to add extra buttons (or any views) before "Copy to clipboard" button
  • Added codeActionButtons option for markdown view to pass it as is to source view used to render code blocks in markdown

1.0.0-beta.74

11 Apr 15:56
Compare
Choose a tag to compare
  • Fixed preloader init when no data specified

1.0.0-beta.73

05 Apr 20:35
Compare
Choose a tag to compare
  • Fixed loadDataFromStream() and loadDataFromFile() methods when no options parameter is specified
  • Fixed "data collected at" date displaying on a report page
  • Fixed #.actions availability for an App's overlay rendering

1.0.0-beta.72 Big bada boom in data loading API

05 Apr 00:51
Compare
Choose a tag to compare

Updated data and metadata loading logic

The data loading logic in Discovery.js has been modified to consistently expect raw data and separate meta info, if provided. Previously, the Discovery.js app was designed to work exclusively with data generated by @discoveryjs/cli (either via a server or builder), which wrapped the data in an object { name, createdAt, elapsed, data: /* actual data */ } (combining actual data with meta information). As Discovery.js evolved, it gained the ability to load data from various data sources like url, file, stream, raw data, etc., which do not use the same wrapper. The differences in data structure made it challenging to create versatile apps that could load data from diverse sources in various ways. This issue became particularly significant with the addition of the embed API.

Starting with the latest release of @discoveryjs/cli, data is no longer wrapped, and meta info is provided differently. As a result, the Discovery.js app now handles data loading uniformly, regardless of the data source type.

To ensure compatibility with data using the old @discoveryjs/cli wrapper, code has been added to detect and unwrap the data during the transition period, allowing for a seamless experience.

Uniform load data methods

This release uniforms API shape responsible for data loading. This related to loadDataFrom* functions as well as App#loadDataFrom* methods. With the release now functions and methods have similar semantics, with a single exception for loadDataFromPush() which has no subject to load from:

  • loadDataFromUrl(url, options)
  • loadDataFromEvent(event, options)
  • loadDataFromFile(file, options)
  • loadDataFromStream(stream, options)
  • loadDataFromPush(options)

The options optional parameter an object which structure depends on a method. However, there are one common option resource, which specify metadata related to a loading dataset.

Changes

  • Made internal navigation using anchors (<a> tags) work without router extension enabled. Use ignore-href class on an anchor to prevent navigation by href attribute if needed
  • Added permalink action to generate current state of an app (absolute page URL by default), it can be overridden by embedding host
  • Changed Widget#setPageHash() to make leading # optional, i.e. Widget#setPageHash('#report') and Widget#setPageHash('report') give the same result now
  • Embed API:
    • Reworked internals for more efficient data transfer, e.g. transfer a data stream intead of tranfering data with chunks
    • Replaced App#loadData with App#uploadData(source, extractResourceMetadata) method, which takes source instead of a function returning a source
    • Added setRouterPreventLocationUpdate() method for preloader and app to prevent location updates (and browser's history as well) on internal navigation
    • Added setPageHash() method for preloader embed API
  • Reworked loading data API and internals:
    • Added support for loading binary encoded data (jsonxl snapshot 9)
    • Added Widget#datasets and #.datasets to store loaded datasets (data itself and its meta data as an object). Current APIs assume to work with a single dataset (data), so this list contains zero or one element for now. However, future version will allow to load and work with multiple datasets (still need to think about the details)
    • Added dataset option in Widget#setData() method options to provide dataset's attributes, which is optional and a dataset object will has data field only if the option is not provided
    • Added start(resource) method to loadFromPush() API
    • Changed loading data logic to always expect raw data and meta info specified aside (via options) if provided (see release notes for details)
    • Changed preloader to pass loadDataOptions into all the loading methods as options
    • Changed Widget#setDataProgress(data, context, progressbar) signature into setDataProgress(data, context, options), where options is an object { dataset?, progressbar? }
    • Removed #.name and #.createdAt, use #.datasets[].resource | { name, createdAt } instead
    • Removed data from Windget#context, however, data is still available in a render context as data of default dataset, i.e. #.data which the same as #.datasets[].data
    • Removed Widget#dataLoaded and #.dataLoaded flags, use Widget#hasDatasets() method or #.datasets in jora queries
    • Changes in loadDataFromUrl() method:
      • Changed getContentSize option to not take url parameter anymore
      • Changed the default getContentSize handler to prefer X-File-Size header over Content-Length header
      • Added getContentCreatedAt option to specify a function to retrieve createdAt from a fetch's response (by default, retrieve a value from the X-File-Created-At header if present, or Last-Modified header otherwise)
      • Added getContentEncodedSize option
      • Fixed a potential crash on JSON parse for a bad response with application/json content type
      • Removed dataField option
      • Removed support for loading raw data using this function
  • Removed Widget#lib

1.0.0-beta.71 Embed API and reworked actions

20 Mar 15:28
Compare
Choose a tag to compare
  • Added embed extension to provide a communication with a host in case when an app is loaded into iframe
  • Added embed support for preloader
  • Added dist/discovery-embed-host.js into package, a ESM module which provides an API to communicate with an app loaded into a sandbox (iframe)
  • Added setup() method for upload extension to specify custom settings
  • Added #.actions.uploadFile.dragdrop to indicate drag&drop file supported or not (provided by upload extension)
  • Added startLoadData, startSetData and unloadData events
  • Added callAction(name, ...args, callback?) and actionHandler(name, ...args, callback?) jora helpers, the callback is applying to handle a result of an action call when specified
  • Changed tooltip to use evaluated value instead of raw config value
  • Changed Progressbar to be inherited from Publisher
  • Replaced Widget#actions with Widget#action which is a dictionary, i.e. now available Widget#action.define(name, callback), Widget#action.revoke(name), Widget#action.call(name, ...args) and the rest methods of Dict (actions also available via #.actions in jora queries)
  • Fixed markerAll() jora helper
  • Fixed upload options setting
  • Fixed applying twice the extensions passed via App's options
  • Fixed suggestions for context value (#) in report's query editor
  • Tweaked nested list styles in markdown view
  • Removed obsoleted methods:
    • Widget#addEntityResolver()
    • Widget#addValueLinkResolver()
    • Widget#addBadge()
    • Widget#addQueryHelpers()