Releases: discoveryjs/discovery
1.0.0-beta.80
- 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
- Reworked report page to support query graph and other improvements
- Uniformed font and size for monospace views
- Enlarged action buttons in
struct
andsignature
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
- 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
- Exposed
createLoadDataState()
method as utils - Introduced internal logging subsystem:
- Added
Widget#log()
method - Added
logLevel
option forWidget
andApp
. Supported values:silent
,error
,warn
,info
,perf
(default) anddebug
. To disable any logging setlogLevel
tosilent
- Added
logger
option (default toconsole
) to override an interface for a logging. Setting to falsy value will disable any logging
- Added
- Fixed displaying "Empty list" in view showcase when a view has no examples
- Fixed calling
onFinish()
callback onProgressbar
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
inexpand
view config - Removed warning on definition
resolveLink()
method in page config
1.0.0-beta.76
- Added
limitCompactObjectEntries
andmaxPropertyLength
options tostruct
view - Added
prelude
andpostlude
slots (new options in config) forsource
view - Added
sectionPrelude
andsectionPostlude
formarkdown
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 formarkdown
view to specify a config for code block rendering - Removed
codeActionButtons
option formarkdown
view, usecodeCofig.actionButtons
instead - Changed markup of
source
view:- Wrapped
action-buttons
,lines
andsource
blocks intoview-source__content
block - Added
view-source__
prefix for class names ofaction-buttons
,lines
andsource
blocks - Added auto scrolling for
source
view content when size of source block is restricted - Fixed positioning for actions block when content overflows
- Wrapped
- 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
andafterDemo
sections in usage render
1.0.0-beta.75
- 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 forsource
view to add extra buttons (or any views) before "Copy to clipboard" button - Added
codeActionButtons
option formarkdown
view to pass it as is tosource
view used to render code blocks in markdown
1.0.0-beta.74
- Fixed preloader init when no data specified
1.0.0-beta.73
- Fixed
loadDataFromStream()
andloadDataFromFile()
methods when nooptions
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
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. Useignore-href
class on an anchor to prevent navigation byhref
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')
andWidget#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
withApp#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 inWidget#setData()
method options to provide dataset's attributes, which is optional and a dataset object will hasdata
field only if the option is not provided - Added
start(resource)
method toloadFromPush()
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 asoptions
- Changed
Widget#setDataProgress(data, context, progressbar)
signature intosetDataProgress(data, context, options)
, whereoptions
is an object{ dataset?, progressbar? }
- Removed
#.name
and#.createdAt
, use#.datasets[].resource | { name, createdAt }
instead - Removed
data
fromWindget#context
, however,data
is still available in a render context asdata
of default dataset, i.e.#.data
which the same as#.datasets[].data
- Removed
Widget#dataLoaded
and#.dataLoaded
flags, useWidget#hasDatasets()
method or#.datasets
in jora queries - Changes in
loadDataFromUrl()
method:- Changed
getContentSize
option to not takeurl
parameter anymore - Changed the default
getContentSize
handler to preferX-File-Size
header overContent-Length
header - Added
getContentCreatedAt
option to specify a function to retrievecreatedAt
from a fetch's response (by default, retrieve a value from theX-File-Created-At
header if present, orLast-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
- Changed
- Removed
Widget#lib
1.0.0-beta.71 Embed API and reworked actions
- 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 forupload
extension to specify custom settings - Added
#.actions.uploadFile.dragdrop
to indicate drag&drop file supported or not (provided byupload
extension) - Added
startLoadData
,startSetData
andunloadData
events - Added
callAction(name, ...args, callback?)
andactionHandler(name, ...args, callback?)
jora helpers, thecallback
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 fromPublisher
- Replaced
Widget#actions
withWidget#action
which is a dictionary, i.e. now availableWidget#action.define(name, callback)
,Widget#action.revoke(name)
,Widget#action.call(name, ...args)
and the rest methods ofDict
(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()